FIX: Add # to empty hrefs (#43)

This commit is contained in:
Jordan Vidrine 2022-09-29 12:53:12 -05:00 committed by GitHub
parent 58a1400f55
commit d6b02afbc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -154,10 +154,10 @@ export default {
const dToc = document.createElement("div");
dToc.classList.add("d-toc-main");
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")
)}">${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");
if (existing) {
@ -286,7 +286,7 @@ export default {
li.classList.add("d-toc-item");
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
}</a>`;