diff --git a/src/importer/AlphaTexImporter.ts b/src/importer/AlphaTexImporter.ts index f1f66b8dd..7568b8e65 100644 --- a/src/importer/AlphaTexImporter.ts +++ b/src/importer/AlphaTexImporter.ts @@ -1846,7 +1846,11 @@ export class AlphaTexImporter extends ScoreImporter { master.isAnacrusis = true; this._sy = this.newSy(); } else { - if (bar.index === 0 && !this.handleStaffMeta()) { + if (bar.index === 0) { + if(!this.handleStaffMeta()) { + this.error('measure-effects', AlphaTexSymbols.String, false); + } + } else { this.error('measure-effects', AlphaTexSymbols.String, false); } } diff --git a/test/importer/AlphaTexImporter.test.ts b/test/importer/AlphaTexImporter.test.ts index 850a35d46..28f95d93f 100644 --- a/test/importer/AlphaTexImporter.test.ts +++ b/test/importer/AlphaTexImporter.test.ts @@ -903,4 +903,13 @@ describe('AlphaTexImporterTest', () => { expect(score.tracks[0].name).toEqual("🎸"); expect(score.tracks[0].staves[0].bars[0].voices[0].beats[2].lyrics![0]).toEqual("🤘"); }); + + it('does-not-hang-on-backslash', () => { + try { + parseTex('\\title Test . 3.3 \\') + fail('Parsing should fail'); + } catch (e) { + // success + } + }) });