Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(headers): Ensures that Markdown headers are preceded by a space #277

Closed
wants to merge 1 commit into from

Conversation

nikz
Copy link

@nikz nikz commented Jul 20, 2016

Changes subParser for headers to require a space or tab character before a header, so that

  # Header

Is a valid header, whereas:

  #Header

Is not rendered as a header.

(This seems to be the standard from what I can tell by testing across the internets, but if we'd prefer to make this an option so that it's not a breaking change I'm happy to do that too!)

Changes subParser for headers to require a space or tab
character before a header, so that

```md
  # Header
```

Is a valid header, whereas:

```md
  #Header
```

Is **not** rendered as a header.
@tivie
Copy link
Member

tivie commented Jul 20, 2016

According to the spec, a space is not required between # and the rest of the text.

For this reason (and because it's a breaking change) making this an option is preferable.

@nikz
Copy link
Author

nikz commented Jul 20, 2016

The spec at http://spec.commonmark.org/0.26/#atx-headings would seem to
indicate that the space is required.

Every implementation I can find does it this way also - but I understand
the desire to avoid a breaking change. Which Markdown spec does showdown
follow?
On Wed, 20 Jul 2016 at 14:20, Estevão Soares dos Santos <
notifications@github.com> wrote:

According to the spec, a space is not required between # and the rest of
the text.

For this reason (and because it's a breaking change) making this an option
is preferable.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#277 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAZSvu_YGC5fLAARML_1oeVckai7dN-ks5qXpE0gaJpZM4JRL88
.

@tivie
Copy link
Member

tivie commented Jul 20, 2016

Showdown follows the original markdown spec. https://daringfireball.net/projects/markdown/syntax

In markdown.pl, created by the original author, spaces are explicitely optional.

commonmark is a variant of the markdown spec

@nikz
Copy link
Author

nikz commented Jul 20, 2016

OK, cool - so would you be open to a patch that added a requireSpacesBeforeHeadings option? This is how GFM works, and we're trying to maintain render compatibility between our Ruby and Javascript libs.

@tivie
Copy link
Member

tivie commented Jul 21, 2016

Yes, that would be the best option. I ask you, however, to make the MPR against develop branch instead of master

@tivie
Copy link
Member

tivie commented Dec 17, 2016

Since there's no update on this, I'm gonna implement this as a feature myself.

@tivie tivie self-assigned this Dec 17, 2016
tivie added a commit that referenced this pull request Dec 17, 2016
@tivie tivie closed this Dec 17, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants