| OLD | NEW |
| 1 Prism.languages.yaml = { | 1 Prism.languages.yaml = { |
| 2 'scalar': { | 2 'scalar': { |
| 3 » » pattern: /([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:(\n[ \t]+)[^\r\
n]+(?:\3[^\r\n]+)*)/, | 3 » » pattern: /([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[
\t]+)[^\r\n]+(?:\3[^\r\n]+)*)/, |
| 4 lookbehind: true, | 4 lookbehind: true, |
| 5 alias: 'string' | 5 alias: 'string' |
| 6 }, | 6 }, |
| 7 » 'comment': /#[^\n]+/, | 7 » 'comment': /#.*/, |
| 8 'key': { | 8 'key': { |
| 9 » » pattern: /(\s*[:\-,[{\n?][ \t]*(![^\s]+)?[ \t]*)[^\n{[\]},#]+?(?
=\s*:\s)/, | 9 » » pattern: /(\s*[:\-,[{\r\n?][ \t]*(![^\s]+)?[ \t]*)[^\r\n{[\]},#]
+?(?=\s*:\s)/, |
| 10 lookbehind: true, | 10 lookbehind: true, |
| 11 alias: 'atrule' | 11 alias: 'atrule' |
| 12 }, | 12 }, |
| 13 'directive': { | 13 'directive': { |
| 14 » » pattern: /((^|\n)[ \t]*)%[^\n]+/, | 14 » » pattern: /(^[ \t]*)%.+/m, |
| 15 lookbehind: true, | 15 lookbehind: true, |
| 16 alias: 'important' | 16 alias: 'important' |
| 17 }, | 17 }, |
| 18 'datetime': { | 18 'datetime': { |
| 19 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[
\t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\
d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*(\n|$|,|]|}))/, | 19 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[
\t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\
d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*($|,|]|}))/m, |
| 20 lookbehind: true, | 20 lookbehind: true, |
| 21 alias: 'number' | 21 alias: 'number' |
| 22 }, | 22 }, |
| 23 'boolean': { | 23 'boolean': { |
| 24 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=\n|$
|,|]|})/i, | 24 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=$|,|
]|})/im, |
| 25 lookbehind: true, | 25 lookbehind: true, |
| 26 alias: 'important' | 26 alias: 'important' |
| 27 }, | 27 }, |
| 28 'null': { | 28 'null': { |
| 29 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=\n|$|,|]
|})/i, | 29 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=$|,|]|})
/im, |
| 30 lookbehind: true, | 30 lookbehind: true, |
| 31 alias: 'important' | 31 alias: 'important' |
| 32 }, | 32 }, |
| 33 'string': { | 33 'string': { |
| 34 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:\\.|[^"\\])*"|'(?:\\
.|[^'\\])*')(?=[ \t]*(\n|$|,|]|}))/, | 34 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:[^"\\]|\\.)*"|'(?:[^
'\\]|\\.)*')(?=[ \t]*($|,|]|}))/m, |
| 35 lookbehind: true | 35 lookbehind: true |
| 36 }, | 36 }, |
| 37 'number': { | 37 'number': { |
| 38 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\dA-Fa-f]+|0o[0
-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=\n|$|,|]|})/i, | 38 » » pattern: /([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\da-f]+|0o[0-7]
+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im, |
| 39 lookbehind: true | 39 lookbehind: true |
| 40 }, | 40 }, |
| 41 'tag': /![^\s]+/, | 41 'tag': /![^\s]+/, |
| 42 'important': /[&*][\w]+/, | 42 'important': /[&*][\w]+/, |
| 43 » 'punctuation': /([:[\]{}\-,|>?]|---|\.\.\.)/ | 43 » 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./ |
| 44 }; | 44 }; |
| OLD | NEW |