diff --git a/components/prism-actionscript.js b/components/prism-actionscript.js index ff5804d4d3..6984531681 100644 --- a/components/prism-actionscript.js +++ b/components/prism-actionscript.js @@ -7,7 +7,7 @@ Prism.languages.actionscript['class-name'].alias = 'function'; if (Prism.languages.markup) { Prism.languages.insertBefore('actionscript', 'string', { 'xml': { - pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/, + pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\s\S])*\2)*\s*\/?>/, lookbehind: true, inside: { rest: Prism.languages.markup diff --git a/components/prism-ada.js b/components/prism-ada.js index 95ca462c5f..68bca4fc00 100644 --- a/components/prism-ada.js +++ b/components/prism-ada.js @@ -3,10 +3,10 @@ Prism.languages.ada = { 'string': /"(?:""|[^"\r\f\n])*"/i, 'number': [ { - pattern: /\b[0-9](?:_?[0-9])*#[0-9A-F](?:_?[0-9A-F])*(?:\.[0-9A-F](?:_?[0-9A-F])*)?#(?:E[+-]?[0-9](?:_?[0-9])*)?/i + pattern: /\b\d(?:_?\d)*#[0-9A-F](?:_?[0-9A-F])*(?:\.[0-9A-F](?:_?[0-9A-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i }, { - pattern: /\b[0-9](?:_?[0-9])*(?:\.[0-9](?:_?[0-9])*)?(?:E[+-]?[0-9](?:_?[0-9])*)?\b/i + pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i } ], 'attr-name': /\b'\w+/i, diff --git a/components/prism-applescript.js b/components/prism-applescript.js index 52d0aeee04..138a619cb0 100644 --- a/components/prism-applescript.js +++ b/components/prism-applescript.js @@ -1,7 +1,7 @@ Prism.languages.applescript = { 'comment': [ // Allow one level of nesting - /\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/, + /\(\*(?:\(\*[\s\S]*?\*\)|[\s\S])*?\*\)/, /--.+/, /#.+/ ], diff --git a/components/prism-aspnet.js b/components/prism-aspnet.js index 9511e453d6..692acc0826 100644 --- a/components/prism-aspnet.js +++ b/components/prism-aspnet.js @@ -15,7 +15,7 @@ Prism.languages.aspnet = Prism.languages.extend('markup', { } }); // Regexp copied from prism-markup, with a negative look-ahead added -Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i; +Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i; // match directives of attribute value foo="<% Bar %>" Prism.languages.insertBefore('inside', 'punctuation', { @@ -23,13 +23,13 @@ Prism.languages.insertBefore('inside', 'punctuation', { }, Prism.languages.aspnet.tag.inside["attr-value"]); Prism.languages.insertBefore('aspnet', 'comment', { - 'asp comment': /<%--[\w\W]*?--%>/ + 'asp comment': /<%--[\s\S]*?--%>/ }); // script runat="server" contains csharp, not javascript Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', { 'asp script': { - pattern: /()[\w\W]*?(?=<\/script>)/i, + pattern: /()[\s\S]*?(?=<\/script>)/i, lookbehind: true, inside: Prism.languages.csharp || {} } diff --git a/components/prism-bash.js b/components/prism-bash.js index d8800dc0fd..8b8a2f0987 100644 --- a/components/prism-bash.js +++ b/components/prism-bash.js @@ -3,11 +3,11 @@ variable: [ // Arithmetic Environment { - pattern: /\$?\(\([\w\W]+?\)\)/, + pattern: /\$?\(\([\s\S]+?\)\)/, inside: { // If there is a $ sign at the beginning highlight $(( and )) as variable variable: [{ - pattern: /(^\$\(\([\w\W]+)\)\)/, + pattern: /(^\$\(\([\s\S]+)\)\)/, lookbehind: true }, /^\$\(\(/, diff --git a/components/prism-clike.js b/components/prism-clike.js index c691011d34..9843e2c635 100644 --- a/components/prism-clike.js +++ b/components/prism-clike.js @@ -1,7 +1,7 @@ Prism.languages.clike = { 'comment': [ { - pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, + pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, lookbehind: true }, { diff --git a/components/prism-crystal.js b/components/prism-crystal.js index fd6fad0e57..77bc34e7de 100644 --- a/components/prism-crystal.js +++ b/components/prism-crystal.js @@ -8,7 +8,7 @@ } ], - number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-fA-F]|(?:[0-9](?:[0-9_]*[0-9])?)(?:\.[0-9_]*[0-9])?(?:[eE][+-]?[0-9_]*[0-9])?)(?:_(?:[uif](?:8|16|32|64))?)?\b/, + number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-fA-F]|(?:\d(?:[0-9_]*\d)?)(?:\.[0-9_]*\d)?(?:[eE][+-]?[0-9_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/, }); var rest = Prism.util.clone(Prism.languages.crystal); diff --git a/components/prism-css.js b/components/prism-css.js index 171c988b01..7d220d34d3 100644 --- a/components/prism-css.js +++ b/components/prism-css.js @@ -1,5 +1,5 @@ Prism.languages.css = { - 'comment': /\/\*[\w\W]*?\*\//, + 'comment': /\/\*[\s\S]*?\*\//, 'atrule': { pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i, inside: { @@ -7,10 +7,10 @@ Prism.languages.css = { // See rest below } }, - 'url': /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, + 'url': /url\((?:(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, 'selector': /[^\{\}\s][^\{\};]*?(?=\s*\{)/, 'string': { - pattern: /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/, + pattern: /("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: true }, 'property': /(\b|\B)[\w-]+(?=\s*:)/i, @@ -24,7 +24,7 @@ Prism.languages.css['atrule'].inside.rest = Prism.util.clone(Prism.languages.css if (Prism.languages.markup) { Prism.languages.insertBefore('markup', 'tag', { 'style': { - pattern: /()[\w\W]*?(?=<\/style>)/i, + pattern: /()[\s\S]*?(?=<\/style>)/i, lookbehind: true, inside: Prism.languages.css, alias: 'language-css' diff --git a/components/prism-d.js b/components/prism-d.js index 347eb082f8..e6cf742b62 100644 --- a/components/prism-d.js +++ b/components/prism-d.js @@ -38,7 +38,7 @@ Prism.languages.d.comment = [ // /+ +/ { // Allow one level of nesting - pattern: /(^|[^\\])\/\+(?:\/\+[\w\W]*?\+\/|[\w\W])*?\+\//, + pattern: /(^|[^\\])\/\+(?:\/\+[\s\S]*?\+\/|[\s\S])*?\+\//, lookbehind: true } ].concat(Prism.languages.d.comment); diff --git a/components/prism-django.js b/components/prism-django.js index 49d39f67cc..63a2e529e5 100644 --- a/components/prism-django.js +++ b/components/prism-django.js @@ -3,7 +3,7 @@ var _django_template = { 'property': { - pattern: /(?:{{|{%)[\w\W]*?(?:%}|}})/g, + pattern: /(?:{{|{%)[\s\S]*?(?:%}|}})/g, greedy: true, inside: { 'string': { @@ -20,9 +20,9 @@ var _django_template = { } }; -Prism.languages.django = Prism.languages.extend('markup', {'comment': /(?:)/}); +Prism.languages.django = Prism.languages.extend('markup', {'comment': /(?:)/}); // Updated html tag pattern to allow template tags inside html tags -Prism.languages.django.tag.pattern = /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^>=]+))?)*\s*\/?>/i; +Prism.languages.django.tag.pattern = /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^>=]+))?)*\s*\/?>/i; Prism.languages.insertBefore('django', 'entity', _django_template); Prism.languages.insertBefore('inside', 'tag', _django_template, Prism.languages.django.tag); diff --git a/components/prism-fsharp.js b/components/prism-fsharp.js index f76457605d..7b5dc181d5 100644 --- a/components/prism-fsharp.js +++ b/components/prism-fsharp.js @@ -1,7 +1,7 @@ Prism.languages.fsharp = Prism.languages.extend('clike', { 'comment': [ { - pattern: /(^|[^\\])\(\*[\w\W]*?\*\)/, + pattern: /(^|[^\\])\(\*[\s\S]*?\*\)/, lookbehind: true }, { diff --git a/components/prism-glsl.js b/components/prism-glsl.js index e9cbfacb32..9afcfe9633 100644 --- a/components/prism-glsl.js +++ b/components/prism-glsl.js @@ -1,6 +1,6 @@ Prism.languages.glsl = Prism.languages.extend('clike', { 'comment': [ - /\/\*[\w\W]*?\*\//, + /\/\*[\s\S]*?\*\//, /\/\/(?:\\(?:\r\n|[\s\S])|.)*/ ], 'number': /\b(?:0x[\da-f]+|(?:\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?)[ulf]*\b/i, diff --git a/components/prism-groovy.js b/components/prism-groovy.js index c6f749e330..fcb7bfd256 100644 --- a/components/prism-groovy.js +++ b/components/prism-groovy.js @@ -2,7 +2,7 @@ Prism.languages.groovy = Prism.languages.extend('clike', { 'keyword': /\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/, 'string': [ { - pattern: /("""|''')[\W\w]*?\1|(\$\/)(\$\/\$|[\W\w])*?\/\$/, + pattern: /("""|''')[\s\S]*?\1|(\$\/)(\$\/\$|[\s\S])*?\/\$/, greedy: true }, { diff --git a/components/prism-handlebars.js b/components/prism-handlebars.js index d6eb8e9551..72b6d142ff 100644 --- a/components/prism-handlebars.js +++ b/components/prism-handlebars.js @@ -1,6 +1,6 @@ (function(Prism) { - var handlebars_pattern = /\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g; + var handlebars_pattern = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g; Prism.languages.handlebars = Prism.languages.extend('markup', { 'handlebars': { @@ -22,7 +22,7 @@ pattern: /\[[^\]]+\]/, inside: { punctuation: /\[|\]/, - variable: /[\w\W]+/ + variable: /[\s\S]+/ } }, 'punctuation': /[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/, @@ -35,7 +35,7 @@ // surround markup Prism.languages.insertBefore('handlebars', 'tag', { 'handlebars-comment': { - pattern: /\{\{![\w\W]*?\}\}/, + pattern: /\{\{![\s\S]*?\}\}/, alias: ['handlebars','comment'] } }); diff --git a/components/prism-haskell.js b/components/prism-haskell.js index 043b763970..9c4720a8e8 100644 --- a/components/prism-haskell.js +++ b/components/prism-haskell.js @@ -1,6 +1,6 @@ Prism.languages.haskell= { 'comment': { - pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\w\W]*?-})/m, + pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\s\S]*?-})/m, lookbehind: true }, 'char': /'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, diff --git a/components/prism-http.js b/components/prism-http.js index edddb406bf..db03da64f0 100644 --- a/components/prism-http.js +++ b/components/prism-http.js @@ -9,11 +9,11 @@ Prism.languages.http = { } }, 'response-status': { - pattern: /^HTTP\/1.[01] [0-9]+.*/m, + pattern: /^HTTP\/1.[01] \d+.*/m, inside: { // Status, e.g. 200 OK property: { - pattern: /(^HTTP\/1.[01] )[0-9]+.*/i, + pattern: /(^HTTP\/1.[01] )\d+.*/i, lookbehind: true } } diff --git a/components/prism-javascript.js b/components/prism-javascript.js index 27cdf84aa8..7d17a58e7b 100644 --- a/components/prism-javascript.js +++ b/components/prism-javascript.js @@ -37,7 +37,7 @@ Prism.languages.insertBefore('javascript', 'string', { if (Prism.languages.markup) { Prism.languages.insertBefore('markup', 'tag', { 'script': { - pattern: /()[\w\W]*?(?=<\/script>)/i, + pattern: /()[\s\S]*?(?=<\/script>)/i, lookbehind: true, inside: Prism.languages.javascript, alias: 'language-javascript' diff --git a/components/prism-jsx.js b/components/prism-jsx.js index 0dd81bbdc8..b668e26dc9 100644 --- a/components/prism-jsx.js +++ b/components/prism-jsx.js @@ -3,9 +3,9 @@ var javascript = Prism.util.clone(Prism.languages.javascript); Prism.languages.jsx = Prism.languages.extend('markup', javascript); -Prism.languages.jsx.tag.pattern= /<\/?[\w\.:-]+\s*(?:\s+(?:[\w\.:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?|\{\.{3}\w+\})\s*)*\/?>/i; +Prism.languages.jsx.tag.pattern= /<\/?[\w\.:-]+\s*(?:\s+(?:[\w\.:-]+(?:=(?:("|')(\\?[\s\S])*?\1|[^\s'">=]+|(\{[\s\S]*?\})))?|\{\.{3}\w+\})\s*)*\/?>/i; -Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:('|")[\w\W]*?(\1)|[^\s>]+)/i; +Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:('|")[\s\S]*?(\1)|[^\s>]+)/i; Prism.languages.insertBefore('inside', 'attr-name', { 'spread': { diff --git a/components/prism-latex.js b/components/prism-latex.js index d736eadf4f..7c32f1f1ec 100644 --- a/components/prism-latex.js +++ b/components/prism-latex.js @@ -11,7 +11,7 @@ 'comment': /%.*/m, // the verbatim environment prints whitespace to the document 'cdata': { - pattern: /(\\begin\{((?:verbatim|lstlisting)\*?)\})([\w\W]*?)(?=\\end\{\2\})/, + pattern: /(\\begin\{((?:verbatim|lstlisting)\*?)\})([\s\S]*?)(?=\\end\{\2\})/, lookbehind: true }, /* @@ -20,12 +20,12 @@ */ 'equation': [ { - pattern: /\$(?:\\?[\w\W])*?\$|\\\((?:\\?[\w\W])*?\\\)|\\\[(?:\\?[\w\W])*?\\\]/, + pattern: /\$(?:\\?[\s\S])*?\$|\\\((?:\\?[\s\S])*?\\\)|\\\[(?:\\?[\s\S])*?\\\]/, inside: insideEqu, alias: 'string' }, { - pattern: /(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})([\w\W]*?)(?=\\end\{\2\})/, + pattern: /(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})([\s\S]*?)(?=\\end\{\2\})/, lookbehind: true, inside: insideEqu, alias: 'string' diff --git a/components/prism-less.js b/components/prism-less.js index 712488a6c8..4f3a3d5d50 100644 --- a/components/prism-less.js +++ b/components/prism-less.js @@ -8,7 +8,7 @@ Prism.languages.less = Prism.languages.extend('css', { 'comment': [ - /\/\*[\w\W]*?\*\//, + /\/\*[\s\S]*?\*\//, { pattern: /(^|[^\\])\/\/.*/, lookbehind: true diff --git a/components/prism-livescript.js b/components/prism-livescript.js index 97bee4aeb6..7a26605185 100644 --- a/components/prism-livescript.js +++ b/components/prism-livescript.js @@ -23,7 +23,7 @@ Prism.languages.livescript = { }, 'comment': [ { - pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, + pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, lookbehind: true, greedy: true }, diff --git a/components/prism-markup.js b/components/prism-markup.js index 73fe302d81..e7a65ba536 100644 --- a/components/prism-markup.js +++ b/components/prism-markup.js @@ -1,10 +1,10 @@ Prism.languages.markup = { - 'comment': //, - 'prolog': /<\?[\w\W]+?\?>/, - 'doctype': //i, - 'cdata': //i, + 'comment': //, + 'prolog': /<\?[\s\S]+?\?>/, + 'doctype': //i, + 'cdata': //i, 'tag': { - pattern: /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i, + pattern: /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i, inside: { 'tag': { pattern: /^<\/?[^\s>\/]+/i, @@ -14,7 +14,7 @@ Prism.languages.markup = { } }, 'attr-value': { - pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i, + pattern: /=(?:('|")[\s\S]*?(\1)|[^\s>]+)/i, inside: { 'punctuation': /[=>"']/ } diff --git a/components/prism-nsis.js b/components/prism-nsis.js index 7858b3467b..4c34548f09 100644 --- a/components/prism-nsis.js +++ b/components/prism-nsis.js @@ -5,7 +5,7 @@ */ Prism.languages.nsis = { 'comment': { - pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|[#;].*)/, + pattern: /(^|[^\\])(\/\*[\s\S]*?\*\/|[#;].*)/, lookbehind: true }, 'string': { diff --git a/components/prism-php.js b/components/prism-php.js index 0e7c895b43..b135fbf3f9 100644 --- a/components/prism-php.js +++ b/components/prism-php.js @@ -15,7 +15,7 @@ Prism.languages.php = Prism.languages.extend('clike', { 'keyword': /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i, 'constant': /\b[A-Z0-9_]{2,}\b/, 'comment': { - pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/, + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, lookbehind: true, greedy: true } @@ -64,7 +64,7 @@ if (Prism.languages.markup) { env.tokenStack = []; env.backupCode = env.code; - env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function(match) { + env.code = env.code.replace(/(?:<\?php|<\?)[\s\S]*?(?:\?>)/ig, function(match) { env.tokenStack.push(match); return '{{{PHP' + env.tokenStack.length + '}}}'; @@ -96,7 +96,7 @@ if (Prism.languages.markup) { // Wrap tokens in classes that are missing them Prism.hooks.add('wrap', function(env) { if (env.language === 'php' && env.type === 'markup') { - env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, "$1"); + env.content = env.content.replace(/(\{\{\{PHP\d+\}\}\})/g, "$1"); } }); @@ -106,6 +106,6 @@ if (Prism.languages.markup) { pattern: /<[^?]\/?(.*?)>/, inside: Prism.languages.markup }, - 'php': /\{\{\{PHP[0-9]+\}\}\}/ + 'php': /\{\{\{PHP\d+\}\}\}/ }); } diff --git a/components/prism-powershell.js b/components/prism-powershell.js index 6c24200516..25448895b0 100644 --- a/components/prism-powershell.js +++ b/components/prism-powershell.js @@ -1,7 +1,7 @@ Prism.languages.powershell = { 'comment': [ { - pattern: /(^|[^`])<#[\w\W]*?#>/, + pattern: /(^|[^`])<#[\s\S]*?#>/, lookbehind: true }, { @@ -11,7 +11,7 @@ Prism.languages.powershell = { ], 'string': [ { - pattern: /"(`?[\w\W])*?"/, + pattern: /"(`?[\s\S])*?"/, greedy: true, inside: { 'function': { @@ -27,7 +27,7 @@ Prism.languages.powershell = { } ], // Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices - 'namespace': /\[[a-z][\w\W]*?\]/i, + 'namespace': /\[[a-z][\s\S]*?\]/i, 'boolean': /\$(true|false)\b/i, 'variable': /\$\w+\b/i, // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example diff --git a/components/prism-pure.js b/components/prism-pure.js index cef1660d06..0af2ae7529 100644 --- a/components/prism-pure.js +++ b/components/prism-pure.js @@ -16,7 +16,7 @@ }, 'comment': [ { - pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, + pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, greedy: true, lookbehind: true }, diff --git a/components/prism-qore.js b/components/prism-qore.js index 0872fa5c4e..2fe5fa0c90 100644 --- a/components/prism-qore.js +++ b/components/prism-qore.js @@ -1,6 +1,6 @@ Prism.languages.qore = Prism.languages.extend('clike', { 'comment': { - pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|(?:\/\/|#).*)/, + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/|#).*)/, lookbehind: true }, // Overridden to allow unescaped multi-line strings diff --git a/components/prism-reason.js b/components/prism-reason.js index eb18100b94..222b75020e 100644 --- a/components/prism-reason.js +++ b/components/prism-reason.js @@ -1,6 +1,6 @@ Prism.languages.reason = Prism.languages.extend('clike', { 'comment': { - pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, + pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, lookbehind: true }, 'string': { diff --git a/components/prism-rust.js b/components/prism-rust.js index cacfddd969..68d55dfab4 100644 --- a/components/prism-rust.js +++ b/components/prism-rust.js @@ -8,7 +8,7 @@ Prism.languages.rust = { 'comment': [ { - pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, + pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, lookbehind: true }, { diff --git a/components/prism-scala.js b/components/prism-scala.js index 29738bb509..8839bfd69b 100644 --- a/components/prism-scala.js +++ b/components/prism-scala.js @@ -2,7 +2,7 @@ Prism.languages.scala = Prism.languages.extend('java', { 'keyword': /<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/, 'string': [ { - pattern: /"""[\W\w]*?"""/, + pattern: /"""[\s\S]*?"""/, greedy: true }, { diff --git a/components/prism-scheme.js b/components/prism-scheme.js index e5eade847e..487ce345e8 100644 --- a/components/prism-scheme.js +++ b/components/prism-scheme.js @@ -13,7 +13,7 @@ Prism.languages.scheme = { lookbehind : true }, 'number' : { - pattern: /(\s|\))[-+]?[0-9]*\.?[0-9]+(?:\s*[-+]\s*[0-9]*\.?[0-9]+i)?\b/, + pattern: /(\s|\))[-+]?\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?\b/, lookbehind: true }, 'boolean' : /#[tf]/, diff --git a/components/prism-scss.js b/components/prism-scss.js index a23c4ae37a..705c290d04 100644 --- a/components/prism-scss.js +++ b/components/prism-scss.js @@ -1,6 +1,6 @@ Prism.languages.scss = Prism.languages.extend('css', { 'comment': { - pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/, + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, lookbehind: true }, 'atrule': { diff --git a/components/prism-smarty.js b/components/prism-smarty.js index c013796569..6c7b2e48b8 100644 --- a/components/prism-smarty.js +++ b/components/prism-smarty.js @@ -5,7 +5,7 @@ (function(Prism) { - var smarty_pattern = /\{\*[\w\W]+?\*\}|\{[\w\W]+?\}/g; + var smarty_pattern = /\{\*[\s\S]+?\*\}|\{[\s\S]+?\}/g; var smarty_litteral_start = '{literal}'; var smarty_litteral_end = '{/literal}'; var smarty_litteral_mode = false; @@ -68,7 +68,7 @@ // surround markup Prism.languages.insertBefore('smarty', 'tag', { 'smarty-comment': { - pattern: /\{\*[\w\W]*?\*\}/, + pattern: /\{\*[\s\S]*?\*\}/, alias: ['smarty','comment'] } }); diff --git a/components/prism-sql.js b/components/prism-sql.js index 2d8e85c34e..ad720c863e 100644 --- a/components/prism-sql.js +++ b/components/prism-sql.js @@ -1,6 +1,6 @@ Prism.languages.sql= { 'comment': { - pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|(?:--|\/\/|#).*)/, + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, lookbehind: true }, 'string' : { diff --git a/components/prism-stylus.js b/components/prism-stylus.js index 6fe36f5b56..8f79f21052 100644 --- a/components/prism-stylus.js +++ b/components/prism-stylus.js @@ -38,7 +38,7 @@ Prism.languages.stylus = { 'comment': { - pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*)/, + pattern: /(^|[^\\])(\/\*[\s\S]*?\*\/|\/\/.*)/, lookbehind: true }, 'atrule-declaration': { diff --git a/components/prism-textile.js b/components/prism-textile.js index 82d8c2a0d7..c1397fa7bc 100644 --- a/components/prism-textile.js +++ b/components/prism-textile.js @@ -237,7 +237,7 @@ }; // Only allow alpha-numeric HTML tags, not XML tags - Prism.languages.textile.tag.pattern = /<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i; + Prism.languages.textile.tag.pattern = /<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i; // Allow some nesting Prism.languages.textile['phrase'].inside['inline'].inside['bold'].inside = nestedPatterns; diff --git a/components/prism-verilog.js b/components/prism-verilog.js index acf5eb05f4..9565c140a2 100644 --- a/components/prism-verilog.js +++ b/components/prism-verilog.js @@ -1,5 +1,5 @@ Prism.languages.verilog = { - 'comment': /\/\/.*|\/\*[\w\W]*?\*\//, + 'comment': /\/\/.*|\/\*[\s\S]*?\*\//, 'string': { pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: true diff --git a/components/prism-wiki.js b/components/prism-wiki.js index 4a5f128142..e047939ea7 100644 --- a/components/prism-wiki.js +++ b/components/prism-wiki.js @@ -1,6 +1,6 @@ Prism.languages.wiki = Prism.languages.extend('markup', { 'block-comment': { - pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, + pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, lookbehind: true, alias: 'comment' }, @@ -70,10 +70,10 @@ Prism.languages.wiki = Prism.languages.extend('markup', { Prism.languages.insertBefore('wiki', 'tag', { // Prevent highlighting inside , and
 tags
 	'nowiki': {
-		pattern: /<(nowiki|pre|source)\b[\w\W]*?>[\w\W]*?<\/\1>/i,
+		pattern: /<(nowiki|pre|source)\b[\s\S]*?>[\s\S]*?<\/\1>/i,
 		inside: {
 			'tag': {
-				pattern: /<(?:nowiki|pre|source)\b[\w\W]*?>|<\/(?:nowiki|pre|source)>/i,
+				pattern: /<(?:nowiki|pre|source)\b[\s\S]*?>|<\/(?:nowiki|pre|source)>/i,
 				inside: Prism.languages.markup['tag'].inside
 			}
 		}