diff --git a/components/prism-matlab.js b/components/prism-matlab.js index b75b10994f..e210edb83c 100644 --- a/components/prism-matlab.js +++ b/components/prism-matlab.js @@ -1,9 +1,6 @@ Prism.languages.matlab = { // We put string before comment, because of printf() patterns that contain "%" - 'string': { - pattern: /(^|\W)'(?:''|[^'\n])*'/, - lookbehind: true - }, + 'string': /\B'(?:''|[^'\n])*'/, 'comment': [ /%\{[\s\S]*?\}%/, /%.+/ diff --git a/components/prism-matlab.min.js b/components/prism-matlab.min.js index 4fa7d4a9f1..42dc38121f 100644 --- a/components/prism-matlab.min.js +++ b/components/prism-matlab.min.js @@ -1 +1 @@ -Prism.languages.matlab={string:{pattern:/(^|\W)'(?:''|[^'\n])*'/,lookbehind:!0},comment:[/%\{[\s\S]*?\}%/,/%.+/],number:/\b-?(?:\d*\.?\d+(?:[eE][+-]?\d+)?(?:[ij])?|[ij])\b/,keyword:/\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/,"function":/(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/}; \ No newline at end of file +Prism.languages.matlab={string:/\B'(?:''|[^'\n])*'/,comment:[/%\{[\s\S]*?\}%/,/%.+/],number:/\b-?(?:\d*\.?\d+(?:[eE][+-]?\d+)?(?:[ij])?|[ij])\b/,keyword:/\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/,"function":/(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/}; \ No newline at end of file