diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/js/even.js | 5 | ||||
-rw-r--r-- | src/package.json | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/js/even.js b/src/js/even.js index 33ca2f3..0d5813a 100644 --- a/src/js/even.js +++ b/src/js/even.js @@ -183,6 +183,7 @@ Even.toc = function () { } Even._refactorToc = function (toc) { + // when headings do not start with `h1` const oldTocList = toc.children[0] let newTocList = oldTocList let temp @@ -192,14 +193,14 @@ Even._refactorToc = function (toc) { } Even._linkToc = function () { - const links = document.querySelectorAll('#TableOfContents a') + const links = document.querySelectorAll('#TableOfContents a:first-child') for (let i = 0; i < links.length; i++) links[i].className += ' toc-link' for (let num = 1; num <= 6; num++) { const headers = document.querySelectorAll('.post-content>h' + num) for (let i = 0; i < headers.length; i++) { const header = headers[i] - header.innerHTML = `<a href="#${header.id}" class="headerlink" title="${header.innerHTML}"></a>${header.innerHTML}` + header.innerHTML = `<a href="#${header.id}" class="headerlink"></a>${header.innerHTML}` } } } diff --git a/src/package.json b/src/package.json index dcae54f..ffc23a8 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "even-src", - "version": "2.7.1", + "version": "2.7.2", "description": "even source file", "main": "index.js", "scripts": { |