~sircmpwn/sr.ht-discuss

2 2

Incorrect markdown parsing

Details
Message ID
<c83cdbbe-d604-4de8-9a3f-c0b1208da529@biro-tisak.hr>
DKIM signature
pass
Download raw message
Greetings,

I have an unlisted project[1] that has a markdown README, which contains 
an installation section which is separated by numbered bulletpoints, 
with code examples below each point.

On website view, however, the README is rendered so that each 
bulletpoint is `1.` , which is not how README is written, or should be 
rendered. I've also tested it with Firefox extension 
GitLabMarkdownViewer[2], and it is rendered fine.

I'm not too familiar with the markdown parser sourcehut uses, but my 
theory is that it uses a simple state machine parser, which is unable to 
stack multiple HTML elements together, as inspecting the README render 
from the tree view reveals that each numbered bulletpoint is in its own 
<ol></ol> class, instead of being a single class, even if the code 
snippet isn't separated with a blank line.

- Filip

[1] https://git.sr.ht/~mlerp/rnamegen
[2] https://github.com/painyeph/GitLabMarkdownViewer
Details
Message ID
<D542ANS4DALJ.3Q9P3P6SYV0TY@cmpwn.com>
In-Reply-To
<c83cdbbe-d604-4de8-9a3f-c0b1208da529@biro-tisak.hr> (view parent)
DKIM signature
pass
Download raw message
Hi! We use the standardized CommonMark dialect of Markdown.

You could try this:

1. lorem ipsum

   ```
   lorem ipsum
   ```
2. lorem ipsum

   ```
   lorem ipsum
   ```
Details
Message ID
<1991b8c5-5048-476f-bbd5-07f34d142fbf@biro-tisak.hr>
In-Reply-To
<D542ANS4DALJ.3Q9P3P6SYV0TY@cmpwn.com> (view parent)
DKIM signature
pass
Download raw message
On 10/24/24 3:14 PM, Drew DeVault wrote:
> Hi! We use the standardized CommonMark dialect of Markdown.
> 
That does indeed fix it.

Thanks for pointing that out! I was not aware that there is indeed such 
variance in markdown standards. I will look into making sure my READMEs 
are compliant with one or the other standard from now on.
Reply to thread Export thread (mbox)