Skip to content

Commit

Permalink
Use css class for headers in toc
Browse files Browse the repository at this point in the history
  • Loading branch information
simov committed Jan 4, 2020
1 parent c1017b7 commit d1792f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions content/index.css
Expand Up @@ -68,11 +68,11 @@ body._toc-right { padding-right: 300px !important; }
overflow-y: auto;
overflow-x: hidden;
}
#_toc #_ul {
#_toc ._ul {
padding: 0 0 0 20px !important;
margin: 0 !important;
}
#_toc #_ul a {
#_toc ._ul a {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
font-size: 14px !important;
line-height: 17px !important;
Expand All @@ -87,7 +87,7 @@ body._toc-right { padding-right: 300px !important; }
padding: 10px 15px !important;
display: block !important;
}
#_toc #_ul a:hover {
#_toc ._ul a:hover {
text-decoration: underline !important;
}

Expand Down
4 changes: 2 additions & 2 deletions content/index.js
Expand Up @@ -180,11 +180,11 @@ var toc = (
title: node.innerText
}))
.reduce((html, header) => {
html += '<div id="_ul">'.repeat(header.level)
html += '<div class="_ul">'.repeat(header.level)
html += link(header)
html += '</div>'.repeat(header.level)
return html
}, '<div id="_toc"><div id="_ul">') + '</div></div>'
}, '<div id="_toc">') + '</div>'

if (document.readyState === 'complete') {
mount()
Expand Down
2 changes: 1 addition & 1 deletion test/popup-options.js
Expand Up @@ -387,7 +387,7 @@ module.exports = ({popup, advanced, content}) => {

t.deepStrictEqual(
await content.evaluate(() =>
Array.from(document.querySelectorAll('#_toc #_ul a'))
Array.from(document.querySelectorAll('#_toc ._ul a'))
.map((a) => ({href: a.getAttribute('href'), text: a.innerText}))
),
[
Expand Down

0 comments on commit d1792f8

Please sign in to comment.