make font regex less restrictive
This commit is contained in:
parent
5315123d96
commit
930e5719c7
1 changed files with 1 additions and 1 deletions
|
@ -260,7 +260,7 @@ export function readFile(filename) {
|
|||
*/
|
||||
async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) {
|
||||
if (!allowedFonts || (allowedFonts[name] && fallbacks)) {
|
||||
const fontMatch = name?.match(/^[\w\s-]+$/);
|
||||
const fontMatch = name?.match(/^[\p{L}\p{N} \-\.~!*\'()@&=+,#$\[\]]+$/u);
|
||||
const sanitizedName = fontMatch?.[0] || 'invalid';
|
||||
if (!name || typeof name !== 'string' || name.trim() === '' || !fontMatch) {
|
||||
console.error(
|
||||
|
|
Loading…
Reference in a new issue