mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
Fix Table of Contents for id less headers #424
This commit is contained in:
parent
356faa7d20
commit
60e3ca6af1
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user