markedjs/marked-gfm-heading-id

Permit "global" GFM Headings

dbolack-ab opened this issue · 1 comments

Introduces the notion of larger scale header uniqueness

Changes:

Adds globalSlugs parameter to the extension paramters. When set to false, the extension behaves as it historically has. If set to true, the slugger and headers list are not reset on each parse.

When set to true, the slugger and headers[] persist until the new `resetheadings` function is called.

Use Case:
Projects like Homebrewery where markdown parsing is chunked but headers should still have unique IDs.

Unsure why this created as an issue instead of a PR. Closing.