Compare commits

...

1 Commits

Author SHA1 Message Date
bcdfe98c92 fix: inline svg icons to follow foreground color
All checks were successful
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
2026-01-02 00:11:51 +01:00

View File

@@ -29,7 +29,11 @@ site.use(djotPlugin({
symb: (symbol: djot.Symb, renderer: djot.HTMLRenderer) => {
if (symbol.alias.startsWith("si-")) {
const iconName = symbol.alias.substring(3);
return `<img class="text-icon" src="/icons/${iconName}.svg">`;
const decoder = new TextDecoder("utf-8");
const svg = decoder.decode(
Deno.readFileSync(`./icons/${iconName}.svg`),
);
return svg;
}
return renderer.renderAstNodeDefault(symbol);
},