From f222671e8cd84bfec51b50f013357a3d22f7bc53 Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Tue, 25 Jun 2024 10:55:56 -0400 Subject: [PATCH] fix: optimize file type check - Use a more specific regex check - Use `test` method instead of `match` Refs: #1224, #1225 --- src/NeonCore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NeonCore.ts b/src/NeonCore.ts index d783e9c9..090a6f64 100644 --- a/src/NeonCore.ts +++ b/src/NeonCore.ts @@ -206,7 +206,7 @@ class NeonCore { } }).then(data => { // Check if the MEI file is sb-based. If so, convert to staff-based. - if (!data.match(/.*section.*type="neon-neume-line".*/)) { + if (!/]*\btype="neon-neume-line"[^>]*>/.test(data)) { data = convertToVerovio(data); }