mirror of
https://github.com/zadam/trilium.git
synced 2025-12-28 18:24:27 +01:00
fix(icon-pack): non-BMP icons not rendering
Some checks are pending
Checks / main (push) Waiting to run
Some checks are pending
Checks / main (push) Waiting to run
This commit is contained in:
parent
035a311e4d
commit
46e5090445
@ -7,14 +7,14 @@ export function extractClassNamesFromCss(css: string, prefix: string): IconPackM
|
||||
|
||||
while ((match = regex.exec(css)) !== null) {
|
||||
let name = match[1];
|
||||
if (prefix && name.startsWith(prefix + "-")) {
|
||||
if (prefix && name.startsWith(`${prefix}-`)) {
|
||||
name = name.substring(prefix.length + 1);
|
||||
}
|
||||
|
||||
icons[match[1]] = {
|
||||
glyph: String.fromCharCode(parseInt(match[2], 16)),
|
||||
glyph: String.fromCodePoint(parseInt(match[2], 16)),
|
||||
terms: [ name ]
|
||||
}
|
||||
};
|
||||
}
|
||||
return icons;
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ export function generateCss({ manifest, fontMime, builtin, fontAttachmentId, pre
|
||||
try {
|
||||
const iconDeclarations: string[] = [];
|
||||
for (const [ key, mapping ] of Object.entries(manifest.icons)) {
|
||||
iconDeclarations.push(`.${prefix}.${key}::before { content: '\\${mapping.glyph.charCodeAt(0).toString(16)}'; }`);
|
||||
iconDeclarations.push(`.${prefix}.${key}::before { content: "${mapping.glyph}"; }`);
|
||||
}
|
||||
|
||||
const fontFamily = builtin ? fontAttachmentId : `trilium-icon-pack-${prefix}`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user