Fix Table of Contents for id less headers #424

This commit is contained in:
mhutti1 2017-01-06 22:53:56 +00:00
parent 356faa7d20
commit 60e3ca6af1

View File

@ -5,6 +5,9 @@ function() {
window.DocumentParser.start();
for (i = 0; i < document.querySelectorAll('h1, h2, h3, h4, h5, h6').length; i++) {
headerObject = document.querySelectorAll('h1, h2, h3, h4, h5, h6')[i];
if (headerObject.id === "") {
headerObject.id = "documentparserid" + i;
}
window.DocumentParser.parse(headerObject.textContent, headerObject.tagName, headerObject.id);
}
window.DocumentParser.stop();