Fix issue with font-family detection (#157)

This commit is contained in:
José Valim 2021-04-12 18:31:10 +02:00 committed by GitHub
parent c6f9c54f31
commit e1bab06168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,7 +68,8 @@ monaco.editor.defineTheme("custom", {
// Without this selecting text with whitespace shrinks the whitespace.
document.fonts.addEventListener("loadingdone", (event) => {
const jetBrainsMonoLoaded = event.fontfaces.some(
(fontFace) => fontFace.family === "JetBrains Mono"
// font-family may be either "JetBrains Mono" or "\"JetBrains Mono\""
(fontFace) => fontFace.family.includes("JetBrains Mono")
);
if (jetBrainsMonoLoaded) {