Skip to content

Commit

Permalink
fix: optimize file type check
Browse files Browse the repository at this point in the history
- Use a more specific regex check
- Use `test` method instead of `match`

Refs: #1224, #1225
  • Loading branch information
yinanazhou committed Jun 25, 2024
1 parent b860650 commit f222671
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NeonCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (!/<section\b[^>]*\btype="neon-neume-line"[^>]*>/.test(data)) {
data = convertToVerovio(data);
}

Expand Down

0 comments on commit f222671

Please sign in to comment.