[yaml mode] Fix exponential regexp

Closes https://github.com/codemirror/codemirror5/issues/7053
This commit is contained in:
Marijn Haverbeke 2023-08-09 22:54:39 +02:00
parent 817ea7be47
commit 4ea5f46558
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ CodeMirror.defineMode("yaml", function() {
}
/* pairs (associative arrays) -> key */
if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) {
if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^\s,\[\]{}#&*!|>'"%@`])[^#:]*(?=:($|\s))/)) {
state.pair = true;
state.keyCol = stream.indentation();
return "atom";