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

Move ATX header parsing closer to CommonMark #3512

Closed
jgm opened this issue Mar 16, 2017 · 1 comment
Closed

Move ATX header parsing closer to CommonMark #3512

jgm opened this issue Mar 16, 2017 · 1 comment

Comments

@jgm
Copy link
Owner

jgm commented Mar 16, 2017

Currently pandoc doesn't require a space after the #, so these are headers:

#CasualFriday
#5 bolt

CommonMark does require the space, and I think it's better to change this in pandoc, even at the risk of breaking some existing documents.

See http://spec.commonmark.org/0.27/#atx-heading
See https://talk.commonmark.org/t/heading-not-working/819/35

@jgm jgm added this to the pandoc 2.0 milestone Mar 16, 2017
@jgm
Copy link
Owner Author

jgm commented Mar 17, 2017

It would make sense to add an extension atx_spaceless, perhaps, so the old behavior could be enabled when needed (e.g. for markdown_strict).

@jgm jgm closed this as completed in 48c88d5 Mar 20, 2017
jgm added a commit that referenced this issue Mar 21, 2017
This is enabled by default in pandoc and GitHub markdown but not the
other flavors.

This requirse a space between the opening #'s and the header
text in ATX headers (as CommonMark does but many other implementations
do not).  This is desirable to avoid falsely capturing things ilke

    #hashtag

or

    #5

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

No branches or pull requests

1 participant