diff options
author | Dillon <dillonzq@outlook.com> | 2020-02-18 11:22:24 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2020-02-18 11:22:24 +0300 |
commit | 4b3addf634eabaf8dffd75f4b808cba55dd42b19 (patch) | |
tree | 6f58704e227305642a23027e52a61fa493ed259b /src | |
parent | d8681cd4896f543ce4a58cd1d9ea39a5e4e82192 (diff) |
fix(check): fix some html check bugs
Diffstat (limited to 'src')
-rw-r--r-- | src/js/theme.js | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/js/theme.js b/src/js/theme.js index 7629260..21e3917 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -84,16 +84,6 @@ this.util.forEach(toc.querySelectorAll('a:first-child'), (link) => { link.classList.add('toc-link'); }); - - // when headings do not start with `h1` - const oldTocList = toc.children[0]; - let newTocList = oldTocList; - let temp; - while (newTocList.children.length === 1 - && (temp = newTocList.children[0].children[0]).tagName === 'UL') { - newTocList = temp; - } - if (newTocList !== oldTocList) toc.replaceChild(newTocList, oldTocList); } _initTocState(tocContainer) { @@ -157,7 +147,7 @@ initToc() { const tocContainer = document.getElementById('post-toc'); if (tocContainer !== null) { - const toc = document.getElementById('TableOfContents'); + const toc = tocContainer.getElementById('TableOfContents'); if (toc === null) { tocContainer.parentElement.removeChild(tocContainer); } else { |