oreillymedia / HTMLBook

Let's write books in HTML!
http://oreillymedia.github.io/HTMLBook
MIT License
650 stars 100 forks source link

Conflict between TOC generation and footnotes in headings #151

Open fweyh opened 10 years ago

fweyh commented 10 years ago

Hi,

If a footnote is defined in a heading, the TOC generation seems to generate invalid XHTML.

For example, this HTMLBook content

<h1>Glossary<span data-type="footnote">Unless the field to which
it relates is stated (e.g., Digital Internet, Physical Internet or 
Logistics), the definition provided is general</span></h1>

will be transformed into the following invalid XHTML (imbricated <a> elements)

<li data-type="chapter"><a href="part04ch05.html#idm1623505328">
20. Glossary<a data-type="noteref" id="idm1623504688-marker"
 href="part04ch05.html#idm1623504688"><sup>11</sup></a>
</a></li>
sandersk commented 10 years ago

Thanks @fbdcw. Great catch. That's indeed a bug. Will add logic to prevent footnotes in headings from being added to TOC entries, and will let you know when that's in place.

Sanders