Skip to content

Fix for Heading without space after # #70

Closed
codesForLiving wants to merge 1 commit intocommonmark:masterfrom
codesForLiving:master
Closed

Fix for Heading without space after # #70
codesForLiving wants to merge 1 commit intocommonmark:masterfrom
codesForLiving:master

Conversation

@codesForLiving
Copy link
Copy Markdown

#Heading

Is not parsed as heading now. Space or tab is needed after #

@codesForLiving
Copy link
Copy Markdown
Author

codesForLiving commented Oct 30, 2016

Closing as tests were not updated

@robinst
Copy link
Copy Markdown
Collaborator

robinst commented Oct 31, 2016

Looked at the code anyway :). So just a heads-up: The reason it requires a space is so that it conforms to the commonmark spec:

The opening sequence of # characters must be followed by a space or by the end of line.

So I wouldn't merge a pull request that makes the space optional in all cases. Maybe it could be an option on the parser, but I'm also not sure if that's a good thing to do, I don't want to provide too many non-spec-compliant options either.

@codesForLiving
Copy link
Copy Markdown
Author

codesForLiving commented Oct 31, 2016

but I'm also not sure if that's a good thing to do

From : commnmark spec page:

Note that many implementations currently do not require the space.

It seems like a good enough reason to provide it as option. :)

@robinst
Copy link
Copy Markdown
Collaborator

robinst commented Oct 31, 2016

The "many implementations" in that sentence refers to other Markdown implementations as opposed to CommonMark, see other uses of "implementations" in the spec.

Could you explain what your use case is for which you need this?

@codesForLiving
Copy link
Copy Markdown
Author

I need it to parse data from Reddit.
They don't need space after #.
I can use my fork for my requirement. Thanks :)

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.

2 participants