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

Parse header IDs with colons #72

Closed
MattiSG opened this issue Aug 8, 2013 · 7 comments
Closed

Parse header IDs with colons #72

MattiSG opened this issue Aug 8, 2013 · 7 comments
Assignees

Comments

@MattiSG
Copy link

MattiSG commented Aug 8, 2013

Kramdown does not parse valid HTML IDs for the {#} anchor syntax, and differs from PHP Markdown Extra behavior on header IDs:

# Header {#id:with-a-colon}

Parsed by Kramdown as:

<h1 id="header-idwith-a-colon">Header {#id:with-a-colon}</h1>

Expected (and properly parsed by PHP Markdown Extras):

<h1 id="id:with-a-colon">Header</h1>

Also, the HTML spec explicitly states:

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

Source

@ghost
Copy link

ghost commented Aug 8, 2013

You cannot use a Span IAL with a Block-Level Element AKA <h1>

kramdown.rubyforge.org/syntax.html#inline-attribute-lists

Proper syntax

$ cat foo.md
{:#with:colon}
# Header

$ kramdown foo.md
<h1 id="with:colon">Header</h1>

@MattiSG
Copy link
Author

MattiSG commented Aug 9, 2013

This is not an IAL, this is a Header ID. Notice there is no colon between the opening curly bracket and the hash :)

Le 9 août 2013 à 01:00, Steven Penny notifications@github.com a écrit :

You cannot use a Span IAL with a Block-Level Element AKA

kramdown.rubyforge.org/syntax.html#inline-attribute-lists

Proper syntax

$ cat foo.md
{:#with:colon}

Header

$ kramdown foo.md

Header


Reply to this email directly or view it on GitHub.

@ghost ghost assigned gettalong Aug 9, 2013
@gettalong
Copy link
Owner

Thanks for finding this bug! Using a header ID and an IAL should definitely work the same, so I will add support for the colon to the header ID.

@gettalong
Copy link
Owner

Implemented.

@MattiSG
Copy link
Author

MattiSG commented Aug 26, 2013

Cool, thanks!

Any ETA on this being available on RubyGems? :)

@gettalong
Copy link
Owner

I would like to incorporate one more patch and then release a new version, so probably this week.

@MattiSG
Copy link
Author

MattiSG commented Aug 27, 2013

Great, thanks Thomas! :)

Le 27 août 2013 à 07:44, Thomas Leitner notifications@github.com a écrit :

I would like to incorporate one more patch and then release a new version, so probably this week.


Reply to this email directly or view it on GitHub.

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 a pull request may close this issue.

2 participants