Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headings inconsistent with the original Markdown renderer #337

Closed
goblindegook opened this issue Jul 21, 2015 · 2 comments
Closed

Headings inconsistent with the original Markdown renderer #337

goblindegook opened this issue Jul 21, 2015 · 2 comments
Labels
Milestone

Comments

@goblindegook
Copy link

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.

@erusev erusev added the bug label Jul 21, 2015
@erusev
Copy link
Owner

erusev commented Jul 21, 2015

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.

@bkuhl
Copy link

bkuhl commented Nov 23, 2017

#337 is also a PR related to streamlining headers and if both are implemented, would be paired well with a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants