mirror of
https://github.com/discourse/DiscoTOC.git
synced 2026-09-16 23:42:13 -04:00
SECURITY: Render TOC items as plain text (#44)
This commit is contained in:
@@ -286,9 +286,9 @@ export default {
|
||||
li.classList.add("d-toc-item");
|
||||
li.classList.add(`d-toc-${clonedNode.tagName.toLowerCase()}`);
|
||||
|
||||
li.innerHTML = `<a href="#" data-d-toc="${clonedNode.getAttribute("id")}">${
|
||||
clonedNode.textContent
|
||||
}</a>`;
|
||||
const id = clonedNode.getAttribute("id");
|
||||
li.innerHTML = `<a href="#" data-d-toc="${id}"></a>`;
|
||||
li.querySelector("a").innerText = clonedNode.textContent.trim();
|
||||
|
||||
clonedNode.remove();
|
||||
return li;
|
||||
|
||||
Reference in New Issue
Block a user