fix: inline svg icons to follow foreground color
This commit is contained in:
parent
bab803d538
commit
bcdfe98c92
1 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue