Closed
Description
Describe the issue
In the reproduction link below, try typing >
at the end of the first line to close the script tag. In the browser console you should see this error:
Uncaught TypeError: Cannot read properties of undefined (reading 'to')
at Parse.moveRangeIndex (@codemirror-language.js:2392:45)
at new Parse (@codemirror-language.js:2329:14)
at Parser.createParse (@codemirror-language.js:2206:24)
at Parser.startParse (@lezer-common.js:1730:21)
at MixedParse.startInner (@lezer-common.js:1891:97)
at MixedParse.advance (@lezer-common.js:1810:18)
at @codemirror-language.js:363:39
at ParseContext.withContext (@codemirror-language.js:398:20)
at ParseContext.work (@codemirror-language.js:351:21)
at LanguageState.apply (@codemirror-language.js:537:20)
But notice that if you delete everything from the text editor except <script></script
and then try typing the final >
, then it works fine.
So I guess it has something to do with the transition of the 'content' of the script tag (i.e. everything after <script>
) during the transition from it no longer being considered part of the script tag, since the script tag was (about to be) closed at a position before it in the document.
Thanks!
Browser and platform
Chrome, Ubuntu 22.04
Reproduction link
Metadata
Metadata
Assignees
Labels
No labels