Skip to content

Append identical header ids with counter#28

Open
emilbayes wants to merge 1 commit intoGitbookIO:masterfrom
emilbayes:unique-header-ids
Open

Append identical header ids with counter#28
emilbayes wants to merge 1 commit intoGitbookIO:masterfrom
emilbayes:unique-header-ids

Conversation

@emilbayes
Copy link

This ensures unique HTML id's in line with the HTML spec, and allows anchors
to always reference the intended header.

Fixes #27

@emilbayes
Copy link
Author

Not that this change will break another test that has two identical headers. It is also not finished, since the instance of Renderer persists across blobs of Markdown, and therefore the counters do not get reset. However looking at renderer.js it doesn't hold much state, and probably would be cheap to instantiate anew for each Markdown blob.

This ensures unique HTML id's in line with the HTML spec, and allows anchors
to always reference the intended header.

Fixes GitbookIO#27
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.

1 participant