Skip to content

Error when using in source code examples #1150

@BrahianVT

Description

@BrahianVT

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions