Open davidjost opened 2 years ago
I solved it by writing an 11ty filter, the ☍ is the permalink symbol:
// .eleventy.js
eleventyConfig.addFilter("removeSymbol", function(value) {
value.val = value.val.replace(/ ☍/g, "");
return value;
});
This needs to be applied in the template:
{{ content | toc | safe | removeSymbol }}
Environment
Node version:
v17.0.1
OS/version:Mac OS 11.6 Big Sur
Eleventy
Eleventy version:
0.12.1
Template engine:Nunjucks
Plugin
Plugin module version:
1.1.0
Description of the issue
PluginTOC renders everything inside the
h(n)
tag. Markdown-it generates permalinks by placing ana
tag inside theh(n)
tag.Desired output
PluginTOC renders the text content of the
h(n)
tag and ignores any other markup inside it.