From ecfcaeb1a5c577645b12e356c46186f5b02620e1 Mon Sep 17 00:00:00 2001 From: acalcutt Date: Sun, 5 Jan 2025 02:46:31 -0500 Subject: [PATCH] Revert "Update utils.js" This reverts commit 5de617dfe2a2b30e2341cf27940dbb0ec18cced5. --- src/utils.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils.js b/src/utils.js index a00862a..2e30abf 100644 --- a/src/utils.js +++ b/src/utils.js @@ -223,7 +223,10 @@ async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) { } if (!/^\d+-\d+$/.test(sRange)) { - console.error('ERROR: Invalid range: %s', sRange); + console.error( + 'ERROR: Invalid range: %s', + sanitizedRange.replace(/\n|\r/g, ''), + ); throw new Error('Invalid range'); } @@ -239,7 +242,7 @@ async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) { } catch (err) { console.error( 'ERROR: Font not found: %s, Error: %s', - filename, + filename.replace(/\n|\r/g, ''), String(err), ); if (fallbacks && Object.keys(fallbacks).length) { @@ -259,7 +262,7 @@ async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) { console.error( `ERROR: Trying to use %s as a fallback for: %s`, fallbackName, - sFontStack, + sanitizedName, ); delete fallbacks[fallbackName]; return getFontPbf(null, fontPath, fallbackName, range, fallbacks);