Skip to content

Commit 565a2cc

Browse files
committed
YAML: Make strings greedy (partial fix for #1075)
1 parent 1a5e7a4 commit 565a2cc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

components/prism-yaml.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Prism.languages.yaml = {
3232
},
3333
'string': {
3434
pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')(?=[ \t]*($|,|]|}))/m,
35-
lookbehind: true
35+
lookbehind: true,
36+
greedy: true
3637
},
3738
'number': {
3839
pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\da-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,

components/prism-yaml.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)