|
|
@@ -3,6 +3,8 @@ import { VerovioToolkit } from 'verovio/esm'; |
|
|
|
import { readFile, readdir } from 'node:fs/promises'; |
|
|
|
import { JSDOM } from 'jsdom'; |
|
|
|
import type {APIRoute, GetStaticPaths} from 'astro'; |
|
|
|
// @ts-ignore |
|
|
|
import tailwindConfig from '../../../tailwind.config.mjs'; |
|
|
|
|
|
|
|
const filter = (musicXml: string) => { |
|
|
|
const jsdom = new JSDOM(musicXml, { pretendToBeVisual: true, contentType: 'image/svg+xml' }); |
|
|
@@ -38,6 +40,9 @@ const processOutput = (xmlData: string) => { |
|
|
|
if (h.tagName.toLowerCase() === 'desc') { |
|
|
|
return; |
|
|
|
} |
|
|
|
if (h.tagName.toLowerCase() === 'style') { |
|
|
|
h.innerHTML = h.innerHTML.replace(/Times,serif/g, tailwindConfig.theme.fontFamily.body.join(',')); |
|
|
|
} |
|
|
|
if (svgElemsMain.children[0]) { |
|
|
|
svgElemsMain.insertBefore(h, svgElemsMain.children[0]); |
|
|
|
return; |
|
|
|