Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using in source code examples #1150

Open
BrahianVT opened this issue Nov 26, 2023 · 1 comment
Open

Error when using in source code examples #1150

BrahianVT opened this issue Nov 26, 2023 · 1 comment

Comments

@BrahianVT
Copy link

I'm working in eleventy with "html-minifier": "^4.0.0" and when I tried to create the prod release I've got error with this code:

      <div id="content" class="prose text-slate-800 max-w-none">
        <h1>How to resolve the algorithm 100 doors step by step  in the 11l programming language</h1>
<p>There are 100 doors in a row that are all initially closed.
You make 100 passes by the doors.
The first time through, visit every door and  toggle  the door  (if the door is closed,  open it;   if it is open,  close it).
The second time, only visit every 2nd door   (door #2, #4, #6, ...),   and toggle it.<br>
The third time, visit every 3rd door   (door #3, #6, #9, ...), etc,   until you only visit the 100th door.</p>
<p>Answer the question:   what state are the doors in after the last pass?   Which are open, which are closed?</p>
<p>Alternate:<br>
As noted in this page's   discussion page,   the only doors that remain open are those whose numbers are perfect squares.
Opening only those doors is an   optimization   that may also be expressed;
however, as should be obvious, this defeats the intent of comparing implementations across programming languages.</p>
<p>Let's start with the solution:</p>
<h2>Step by Step solution about How to resolve the algorithm 100 doors step by step  in the 11l programming language</h2>
<h2>Source code in the 11l programming language</h2>
<pre class="language-11l"><code class="language-11l"><span class="highlight-line">V doors = [0B] * 100</span>
<span class="highlight-line">L(i) 100</span>
<span class="highlight-line">   L(j) (i .< 100).step(i + 1)</span>
<span class="highlight-line">      doors[j] = !doors[j]</span>
<span class="highlight-line">   print(‘Door ’(i + 1)‘: ’(I doors[i] {‘open’} E ‘close’))</span>
<span class="highlight-line"></span>
<span class="highlight-line">  </span></code></pre>

    </div>

The error is:

  1. Having trouble writing to "dist/How_to_resolve_the_algorithm_100_doors_step_by_step__in_the_11l_programming_language/index.html" from "./src/posts/How_to_resolve_the_algorithm_100_doors_step_by_step__in_the_11l_programming_language.md" (via EleventyTemplateError)
    2023-11-26T16:59:55.369191Z [11ty] 2. Transform minifyHtml encountered an error when transforming ./src/posts/How_to_resolve_the_algorithm_100_doors_step_by_step__in_the_11l_programming_language.md. (via EleventyTransformError)
    2023-11-26T16:59:55.369402Z [11ty] 3. Parse Error: < 100).step(i + 1)
    2023-11-26T16:59:55.369576Z [11ty] doors[j] = !doors[j]
    2023-11-26T16:59:55.369719Z [11ty] print(‘Door ’(i + 1)‘: ’(I doors[i] {‘open’} E ‘close’))
    2023-11-26T16:59:55.369886Z [11ty]
    2023-11-26T16:59:55.370017Z [11ty]

The error is when using html-minifier I, isolate the error here: https://kangax.github.io/html-minifier/ with the same code above:
image

Any suggestion to resolve the issue?
Regards

@BrahianVT BrahianVT changed the title Error in whe using in source code examples Error when using in source code examples Nov 26, 2023
@DanielRuf
Copy link

That is because < is not valid HTML, but &lt; would be valid HTML. You might have to encode your HTML before passing it to html-minifier or use the ignore tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants