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

GFM header IDs fail if header contains span markup #391

nfagerlund opened this Issue Nov 22, 2016 · 5 comments


None yet
3 participants

nfagerlund commented Nov 22, 2016

On GitHub proper (and kramdown prior to 1.13.0), the following MD:

### `code-span`

...results in the following HTML:

<h3 id="code-span"><code>code-span</code></h3>

Now, though, it results in something like:

<h3 id="-18"><code>code-span</code></h3>

(...assuming this wasn't the first code-span header in the page.)

This is bad, and also does not match what GitHub does.

nfagerlund added a commit to puppetlabs/puppet-docs that referenced this issue Nov 22, 2016

(guts) Lock kramdown to 1.12.0 due to bug #391

This breaks our header IDs in a very major way.

@gettalong gettalong self-assigned this Nov 23, 2016

@gettalong gettalong added the bug label Nov 23, 2016


This comment has been minimized.


gettalong commented Nov 23, 2016

Thanks for the additional test case, I will release a bug fix release soon that fixes this.

@gettalong gettalong closed this Nov 23, 2016


This comment has been minimized.


gettalong commented Nov 24, 2016

In addition the bug fix release will fix problems with entities, smart quotes and other specially parsed kramdown elements.


This comment has been minimized.


parkr commented Feb 15, 2017

Just upgraded to v1.13.2 and noticing some errors like:

---> Can't handle generic non-integer character reference 'raquo_space'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/utils/entities.rb:323:in `block in <module:Entities>'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/utils/entities.rb:337:in `entity'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/gfm.rb:87:in `block in update_raw_text'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/gfm.rb:89:in `block (2 levels) in update_raw_text'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/gfm.rb:89:in `each'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/gfm.rb:89:in `block in update_raw_text'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/gfm.rb:93:in `update_raw_text'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/kramdown.rb:189:in `block in update_tree'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/kramdown.rb:164:in `map!'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/kramdown.rb:164:in `update_tree'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/kramdown.rb:90:in `parse'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/gfm.rb:44:in `parse'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/base.rb:69:in `parse'
.bundle/ruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/document.rb:107:in `initialize'
.bundle/ruby/2.3.0/gems/jekyll-3.3.1/lib/jekyll/converters/markdown/kramdown_parser.rb:41:in `new'

Could we consider a fallback mechanism for this PR so it doesn't break on headings when it gets confused on the entity?


This comment has been minimized.


gettalong commented Feb 18, 2017

@PARKS Thanks, this is a bug in handling typographic symbols for GFM header IDs - will fix that for the next release.

@gettalong gettalong reopened this Feb 18, 2017


This comment has been minimized.


gettalong commented Jun 26, 2017

The special typographic syms laquo_space and raquo_space are now handled correctly - will be in the next release.

@gettalong gettalong closed this Jun 26, 2017

yulijia added a commit to yulijia/ that referenced this issue Jul 20, 2017

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