Skip to content

Build your personal knowledge base with Trilium Notes

make sure the headings in TOC contain text only, https://github.com/zadam/trilium-web-clipper/issues/42

zadam9114b1befb29
diff --git a/src/public/app/widgets/toc.js b/src/public/app/widgets/toc.js
index f8f7a23527..9d7105f221 100644
--- a/src/public/app/widgets/toc.js
+++ b/src/public/app/widgets/toc.js
@@ -143,7 +143,9 @@ export default class TocWidget extends CollapsibleWidget {
//
// Create the list item and set up the click callback
//
- const $li = $('<li style="cursor:pointer">' + m[2] + '</li>');
+
+ const headingText = $("<div>").html(m[2]).text();
+ const $li = $('<li style="cursor:pointer">').text(headingText);
// XXX Do this with CSS? How to inject CSS in doRender?
$li.hover(function () {
$(this).css("font-weight", "bold");