Skip to content

Commit

Permalink
YAML: Make strings greedy (partial fix for #1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Feb 7, 2017
1 parent 1a5e7a4 commit 565a2cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/prism-yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Prism.languages.yaml = {
},
'string': {
pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')(?=[ \t]*($|,|]|}))/m,
lookbehind: true
lookbehind: true,
greedy: true
},
'number': {
pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\da-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-yaml.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 565a2cc

Please sign in to comment.