mirror of
https://github.com/zadam/trilium.git
synced 2026-02-15 18:24:26 +01:00
chore(icon_pack): map ttf
This commit is contained in:
parent
d121de5152
commit
98de4b6dc3
@ -60,4 +60,44 @@ describe("Mapping attachments", () => {
|
||||
const attachment = determineBestFontAttachment(iconPackNote);
|
||||
expect(attachment?.mime).toStrictEqual("font/woff");
|
||||
});
|
||||
|
||||
it("handles ttf", () => {
|
||||
const iconPackNote = buildNote({
|
||||
type: "text",
|
||||
attachments: [
|
||||
{
|
||||
role: "file",
|
||||
title: "Font",
|
||||
mime: "font/ttf"
|
||||
}
|
||||
]
|
||||
});
|
||||
const attachment = determineBestFontAttachment(iconPackNote);
|
||||
expect(attachment?.mime).toStrictEqual("font/ttf");
|
||||
});
|
||||
|
||||
it("prefers woff2", () => {
|
||||
const iconPackNote = buildNote({
|
||||
type: "text",
|
||||
attachments: [
|
||||
{
|
||||
role: "file",
|
||||
title: "Font",
|
||||
mime: "font/woff"
|
||||
},
|
||||
{
|
||||
role: "file",
|
||||
title: "Font",
|
||||
mime: "font/ttf"
|
||||
},
|
||||
{
|
||||
role: "file",
|
||||
title: "Font",
|
||||
mime: "font/woff2"
|
||||
}
|
||||
]
|
||||
});
|
||||
const attachment = determineBestFontAttachment(iconPackNote);
|
||||
expect(attachment?.mime).toStrictEqual("font/woff2");
|
||||
});
|
||||
});
|
||||
|
||||
@ -4,7 +4,8 @@ import log from "./log";
|
||||
|
||||
const PREFERRED_MIME_TYPE = [
|
||||
"font/woff2",
|
||||
"font/woff"
|
||||
"font/woff",
|
||||
"font/ttf"
|
||||
];
|
||||
|
||||
export interface IconPackManifest {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user