Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: lib/src/prism/components/prism-php.min.js

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 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|funct ion|include|include_once|global|if|new|return|static|switch|use|require|require_ once|var|while|abstract|interface|public|implements|private|protected|parent|thr ow|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]*?\*\/| (^|[^:])(\/\/).*?(\r?\n|$))/,lookbehind:!0}}),Prism.languages.insertBefore("php" ,"class-name",{"shell-comment":{pattern:/(^|[^\\])#.*?(\r?\n|$)/,lookbehind:!0,a lias:"comment"}}),Prism.languages.insertBefore("php","keyword",{delimiter:/(\?>| <\?php|<\?)/i,variable:/(\$\w+)\b/i,"package":{pattern:/(\\|namespace\s+|use\s+) [\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),Prism.languages.insertBefore ("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),Prism.language s.markup&&(Prism.hooks.add("before-highlight",function(e){"php"===e.language&&(e .tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(/(?:<\?php|<\?)[\w\W]*? (?:\?>)/gi,function(n){return e.tokenStack.push(n),"{{{PHP"+e.tokenStack.length+ "}}}"}))}),Prism.hooks.add("before-insert",function(e){"php"===e.language&&(e.co de=e.backupCode,delete e.backupCode)}),Prism.hooks.add("after-highlight",functio n(e){if("php"===e.language){for(var n,a=0;n=e.tokenStack[a];a++)e.highlightedCod e=e.highlightedCode.replace("{{{PHP"+(a+1)+"}}}",Prism.highlight(n,e.grammar,"ph p"));e.element.innerHTML=e.highlightedCode}}),Prism.hooks.add("wrap",function(e) {"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP [0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),Prism.languages.insertBe fore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:Prism.languages.ma rkup},php:/\{\{\{PHP[0-9]+\}\}\}/})); 1 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|funct ion|include|include_once|global|if|new|return|static|switch|use|require|require_ once|var|while|abstract|interface|public|implements|private|protected|parent|thr ow|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]*?\*\ /|\/\/.*)/,lookbehind:!0}}),Prism.languages.insertBefore("php","class-name",{"sh ell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),Prism.lang uages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+ \b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{ punctuation:/\\/}}}),Prism.languages.insertBefore("php","operator",{property:{pa ttern:/(->)[\w]+/,lookbehind:!0}}),Prism.languages.markup&&(Prism.hooks.add("bef ore-highlight",function(e){"php"===e.language&&(e.tokenStack=[],e.backupCode=e.c ode,e.code=e.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(a){return e .tokenStack.push(a),"{{{PHP"+e.tokenStack.length+"}}}"}))}),Prism.hooks.add("bef ore-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backup Code)}),Prism.hooks.add("after-highlight",function(e){if("php"===e.language){for (var a,n=0;a=e.tokenStack[n];n++)e.highlightedCode=e.highlightedCode.replace("{{ {PHP"+(n+1)+"}}}",Prism.highlight(a,e.grammar,"php").replace(/\$/g,"$$$$"));e.el ement.innerHTML=e.highlightedCode}}),Prism.hooks.add("wrap",function(e){"php"=== e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\ }\})/g,'<span class="token php">$1</span>'))}),Prism.languages.insertBefore("php ","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:Prism.languages.markup},php :/\{\{\{PHP[0-9]+\}\}\}/}));
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-php-extras.min.js ('k') | lib/src/prism/components/prism-powershell.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698