Skip to content

Commit 1d4b525

Browse files
committed
[yaml mode] Tweak key regexp
Issue #2695
1 parent 1d35536 commit 1d4b525

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mode/yaml/yaml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ CodeMirror.defineMode("yaml", function() {
8080
}
8181

8282
/* pairs (associative arrays) -> key */
83-
if (!state.pair && stream.match(/^\s*[^\-:{}"\[\]][^:{}"\[\]]*(?=\s*:($|\s))/i)) {
83+
if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) {
8484
state.pair = true;
8585
state.keyCol = stream.indentation();
8686
return "atom";

0 commit comments

Comments
 (0)