[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gb.markdown] Markdown.ToHTML() does not recognize triple-backtick code fences (```)
[Thread Prev] | [Thread Next]
- Subject: Re: [gb.markdown] Markdown.ToHTML() does not recognize triple-backtick code fences (```)
- From: Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
- Date: Mon, 9 Nov 2026 08:52:41 +0100
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Le 08/11/2026 à 23:36, Alarch a écrit :
Hello,
While using gb.markdown (Markdown.ToHTML) in a small internal web project, I noticed that code blocks delimited by triple backticks (``` ... ```) are not recognized as code blocks: each fence line is treated as inline code (a single backtick), which inserts an error message into the produced HTML ("Missing closing '`'") instead of the expected code block. Only 4-space indentation (the original Markdown syntax) works correctly.
Tested with gambas3-gb-markdown 3.19.5+git202409271332.897eab4fc+build16~ubuntu22.04.1 (component alone, Dim hMd As New Markdown / hMd.ToHTML(sMd)).
Input:
Before.
```
some code
```
After.
Resulting HTML:
Before.
<p></p>
<code style="white-space:nowrap;">`</code><div class="error">Missing closing '`'</div>
some code
<code style="white-space:nowrap;">`</code><div class="error">Missing closing '`'</div>
<p></p>
After.
The same content with 4-space indentation gives the expected result:
Before.
<p></p>
<div><pre><code>some code
</code></pre></div>
<p></p>
After.
Since triple-backtick fences have become the near-univers in Markdown (GitHub, docsify, etc.), it would be nice if
gb.markdown recognized them too, in addition to indentation, which already works well. In the meantime, I'm working around this in my
application by rewriting ``` fences into 4-space indentat
I can provide a minimal test Gambas project if that's use
Thanks for all the work on Gambas!
Marc
I think this syntax can be supported by the Gambas markdown. Regards, -- Benoît Minisini.
| [gb.markdown] Markdown.ToHTML() does not recognize triple-backtick code fences (```) | Alarch <alarch@xxxxxxxxx> |