Skip to content

Duplicate IDs in parsed block element #7810

@arthurattwell

Description

@arthurattwell

My Environment

Software Version(s)
Operating System Windows, Ubuntu
jekyll 3.8.6, 4.0.0
github-pages No

Expected Behaviour

When I use this markdown, I should get unique IDs on the headings:

## Heading

<div markdown="1">

## Heading

</div>

Expected output:

<h2 id="heading">Heading</h2>
<div>
  <h2 id="heading-1">Heading</h2>
</div>

Current Behavior

However, I get duplicate IDs:

<h2 id="heading">Heading</h2>
<div>
  <h2 id="heading">Heading</h2>
</div>

At first, I thought this was a kramdown bug, but when I use kramdown directly from the command line, I get the expected unique IDs. This suggests that the bug is happening in the Jekyll context.

This happens with kramdown 1.17 and 2.1, and in both Jekyll 3.8.6 and 4.0.0 on Windows and Ubuntu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions