HTML problem: duplicated ids for titles
nikophil opened this issue · 2 comments
Hello,
i think this PR https://github.com/weaverryan/docs-builder/pull/44/files introduced a small HTML problem: all ids are duplicated between <hX> element and related <div class="section">
meaning this rst:
Title
===results in this invalid html code:
<div class="section" id="title">
<h1 id="title">
<a class="headerlink" href="#title" title="Permalink to this headline">Title</a>
</h1>
</div>we should either override section-begin.html.twig file or remove the id of the title.
If possible, I'd prefer to keep the id in the heading instead of the section. It feels more correct to me (the section can be long and contain many things, so the id could be "wrong" because it doesn't identify the entire section). Also, with CSS properties like https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-top, it feels more natural to apply it to the heading itself to control the scroll when there are sticky headers. Thanks!
ok, I kinda agree with you, but I wanted to have your thoughts
I've prepared something, but it would be nice to merge https://github.com/weaverryan/docs-builder/pull/27 and https://github.com/weaverryan/docs-builder/pull/56 because a lot of tests are failing presently...