3 hours ago · Tech · hide · 0 comments

♠ Problem statement: a code block that quotes a markdown file swallows the first closing fence it meets, which is the inner one. The ADRs and LLMs post quotes a README.md that itself contains a fenced template. Written naively: ```markdown # README Use this template: ```markdown # ADR-NNNN: Title ``` That was the template. ``` The CommonMark spec says who wins: The content of the code block consists of all subsequent lines, until a closing code fence of the same type as the code block began with (backticks or tildes), and with at least as many backticks or tildes as the opening code fence. Three backticks close three backticks, so the template’s closing fence terminates the outer block. Everything after it leaks into the page: <div class="codeblock" data-lang="markdown"> <!-- header --> <p>That was the template.</p> <div class="codeblock"> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plaintext" data-lang="plaintext"></code></pre></div> </div> Two code…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.