Skip to content

Conversation

@amarz45
Copy link
Contributor

@amarz45 amarz45 commented Sep 30, 2022

Markdown headings have at least one whitespace character after the hashtag(s).

This is a heading

#This is not a heading

@alerque
Copy link
Member

alerque commented Sep 30, 2022

This is an interesting one and I'm not 100% sure what to do. This rule is implemented differently across different Markdown parsers. The original daring fireball "spec" wasn't clear, and bath ways started getting implemented early on. These days many of the more formalized specs such as CommonMark, Pandoc FM, GitHub FM, etc. have converged on requiring the space. Many older or less spec dependent parsers don't care. Others like it-markdown have extensions to make them optional.

This raises the issue (yet again) of what this plugin targets. This is very much a legacy project and I think it should probably default to targeting as generic and legacy a "flavor" as possible. There are other plugins for Pandoc specific syntax or CM or whatever.

However given the daring fireball examples use a space (even if it wasn't required) I wonder how many people's usage this would actually break and whether the extra reliability and fewer false positives might be worth it anyway.

Thoughts?

@tomtomjhj
Copy link
Contributor

See also: #598

@amarz45
Copy link
Contributor Author

amarz45 commented Sep 30, 2022

This is an interesting one and I'm not 100% sure what to do. This rule is implemented differently across different Markdown parsers. The original daring fireball "spec" wasn't clear, and bath ways started getting implemented early on. These days many of the more formalized specs such as CommonMark, Pandoc FM, GitHub FM, etc. have converged on requiring the space. Many older or less spec dependent parsers don't care. Others like it-markdown have extensions to make them optional.

This raises the issue (yet again) of what this plugin targets. This is very much a legacy project and I think it should probably default to targeting as generic and legacy a "flavor" as possible. There are other plugins for Pandoc specific syntax or CM or whatever.

However given the daring fireball examples use a space (even if it wasn't required) I wonder how many people's usage this would actually break and whether the extra reliability and fewer false positives might be worth it anyway.

Thoughts?

I think we should add the space by default, then add an option to remove the space. Also, in Pandoc Markdown, #. can be used for ordered lists. This creates a false positive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants