You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR:
Some frameworks specifically parse h for IDs; and in the case of VuePress, some of its functionality is broken because of how this extension moves the ID from h to section.
I modified the code to:
- @ the main loop: remove the part that moves the ID from h to section
- @ openSection: give the section an ID equivalent to section--original-id
I was going to submit it as a pull request, however, for some reason it's not working as I expected.
The issue I ran into is that even though I maintained the same data structure of [["id", "some-id"]] from the original code, for some reason it's not actually being applied to the rendered page.
Instead, I'm seeing
<section foo="undefined">
<h2 id="foo">
where I would expect
<section id="section--foo">
<h1 id="foo">
Not sure if there's something I'm missing within markdown-it-header-sections, or if this is happening somewhere within markdown-it or elsewhere.
The text was updated successfully, but these errors were encountered:
As it is no standard that ids should be on headers like h1, h2, etc, maybe you could provide some evidence that most frameworks expects this? If most do, we'll fix and release as a new major version, as this is a breaking change.
maybe you could provide some evidence that most frameworks expects this?
VuePress is really my first exploration of documentation generation, but I just checked out an example of Gatsby's markdown rendering & it appears to use the same header ID convention as VuePress.
If most do, we'll fix and release as a new major version, as this is a breaking change.
See: VuePress/Issues/1203
TLDR:
Some frameworks specifically parse
h
for IDs; and in the case of VuePress, some of its functionality is broken because of how this extension moves the ID fromh
tosection
.I modified the code to:
- @ the main loop: remove the part that moves the ID from
h
tosection
- @ openSection: give the section an ID equivalent to
section--original-id
I was going to submit it as a pull request, however, for some reason it's not working as I expected.
The issue I ran into is that even though I maintained the same data structure of
[["id", "some-id"]]
from the original code, for some reason it's not actually being applied to the rendered page.Instead, I'm seeing
where I would expect
Not sure if there's something I'm missing within
markdown-it-header-sections
, or if this is happening somewhere withinmarkdown-it
or elsewhere.The text was updated successfully, but these errors were encountered: