Update serve_font.js

This commit is contained in:
acalcutt 2025-01-04 11:23:35 -05:00
parent 7a81e47c09
commit 0dcf296425

View file

@ -35,7 +35,7 @@ export async function serve_font(options, allowedFonts, programOpts) {
const sanitizedFontStack = fontStackParts const sanitizedFontStack = fontStackParts
.map((font) => { .map((font) => {
const fontMatch = font?.match(/^[\w\s-]+$/); const fontMatch = font?.match(/^[\w\s-]+$/);
return fontMatch?.[0]; return fontMatch?.[0] || 'invalid';
}) })
.filter(Boolean) .filter(Boolean)
.join(','); .join(',');