You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a trio of issues with the rendering of headers where Parsedown is inconsistent with the original Markdown implementation:
####### not an h7 is rendered as a paragraph, while the original Markdown interprets it as <h6># not an h7</h6>.
# # of levels (mind the space) is rendered as <h1>of levels</h1>. The original Markdown retains the extra hash as <h1># of levels</h1>.
# # of levels # # is also rendered as <h1>of levels</h1>. The original Markdown retains the extra hashes both at the start and the end, <h1># of levels #</h1>.
These inconsistencies can be resolved by removing only the first n characters from the start of the string, n being the heading level. An additional trim(rtrim($line, '#')) should be performed --- the original Markdown implementation doesn't seem to care about the heading level when removing trailing hashes.
The text was updated successfully, but these errors were encountered:
Thanks! The first is supposed to work like this. That's related to the CommonMark spec. The second and the third, however, aren't. I'll see what i can do.
I found a trio of issues with the rendering of headers where Parsedown is inconsistent with the original Markdown implementation:
####### not an h7
is rendered as a paragraph, while the original Markdown interprets it as<h6># not an h7</h6>
.# # of levels
(mind the space) is rendered as<h1>of levels</h1>
. The original Markdown retains the extra hash as<h1># of levels</h1>
.# # of levels # #
is also rendered as<h1>of levels</h1>
. The original Markdown retains the extra hashes both at the start and the end,<h1># of levels #</h1>
.These inconsistencies can be resolved by removing only the first n characters from the start of the string, n being the heading level. An additional
trim(rtrim($line, '#'))
should be performed --- the original Markdown implementation doesn't seem to care about the heading level when removing trailing hashes.The text was updated successfully, but these errors were encountered: