FIX: Add # to empty hrefs (#43)
This commit is contained in:
parent
58a1400f55
commit
d6b02afbc2
|
@ -154,10 +154,10 @@ export default {
|
||||||
const dToc = document.createElement("div");
|
const dToc = document.createElement("div");
|
||||||
dToc.classList.add("d-toc-main");
|
dToc.classList.add("d-toc-main");
|
||||||
dToc.innerHTML = `<div class="d-toc-icons">
|
dToc.innerHTML = `<div class="d-toc-icons">
|
||||||
<a href="" class="scroll-to-bottom" title="${I18n.t(
|
<a href="#" class="scroll-to-bottom" title="${I18n.t(
|
||||||
themePrefix("post_bottom_tooltip")
|
themePrefix("post_bottom_tooltip")
|
||||||
)}">${iconHTML("downward")}</a>
|
)}">${iconHTML("downward")}</a>
|
||||||
<a href="" class="d-toc-close">${iconHTML("times")}</a></div>`;
|
<a href="#" class="d-toc-close">${iconHTML("times")}</a></div>`;
|
||||||
|
|
||||||
const existing = document.querySelector(".d-toc-wrapper .d-toc-main");
|
const existing = document.querySelector(".d-toc-wrapper .d-toc-main");
|
||||||
if (existing) {
|
if (existing) {
|
||||||
|
@ -286,7 +286,7 @@ export default {
|
||||||
li.classList.add("d-toc-item");
|
li.classList.add("d-toc-item");
|
||||||
li.classList.add(`d-toc-${clonedNode.tagName.toLowerCase()}`);
|
li.classList.add(`d-toc-${clonedNode.tagName.toLowerCase()}`);
|
||||||
|
|
||||||
li.innerHTML = `<a data-d-toc="${clonedNode.getAttribute("id")}">${
|
li.innerHTML = `<a href="#" data-d-toc="${clonedNode.getAttribute("id")}">${
|
||||||
clonedNode.textContent
|
clonedNode.textContent
|
||||||
}</a>`;
|
}</a>`;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue