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

Side by Side Diff: lib/src/prism/components/prism-handlebars.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
« no previous file with comments | « lib/src/prism/components/prism-handlebars.js ('k') | lib/src/prism/components/prism-haskell.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 !function(e){var a=/\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g;e.languages.handleba rs=e.languages.extend("markup",{handlebars:{pattern:a,inside:{delimiter:{pattern :/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(\\?.)+?\1/,number:/\b- ?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,"boolean":/\b(true|false)\b/,block:{pa ttern:/^(\s*~?\s*)[#\/]\S+/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\ [[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\w\W]+/}},punctuation:/[!"#%&' ()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/}}}),e .languages.insertBefore("handlebars","tag",{"handlebars-comment":{pattern:/\{\{! [\w\W]*?\}\}/,alias:["handlebars","comment"]}}),e.hooks.add("before-highlight",f unction(e){"handlebars"===e.language&&(e.tokenStack=[],e.backupCode=e.code,e.cod e=e.code.replace(a,function(a){return e.tokenStack.push(a),"___HANDLEBARS"+e.tok enStack.length+"___"}))}),e.hooks.add("before-insert",function(e){"handlebars"== =e.language&&(e.code=e.backupCode,delete e.backupCode)}),e.hooks.add("after-high light",function(a){if("handlebars"===a.language){for(var n,t=0;n=a.tokenStack[t] ;t++)a.highlightedCode=a.highlightedCode.replace("___HANDLEBARS"+(t+1)+"___",e.h ighlight(n,a.grammar,"handlebars"));a.element.innerHTML=a.highlightedCode}})}(Pr ism); 1 !function(e){var a=/\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g;e.languages.handleba rs=e.languages.extend("markup",{handlebars:{pattern:a,inside:{delimiter:{pattern :/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(\\?.)*?\1/,number:/\b- ?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/,"boolean":/\b(true|false)\b/,block: {pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"}, brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\w\W]+/}}, punctuation:/[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,.\/;<=>@\ [\\\]^`{|}~\s]+/}}}),e.languages.insertBefore("handlebars","tag",{"handlebars-co mment":{pattern:/\{\{![\w\W]*?\}\}/,alias:["handlebars","comment"]}}),e.hooks.ad d("before-highlight",function(e){"handlebars"===e.language&&(e.tokenStack=[],e.b ackupCode=e.code,e.code=e.code.replace(a,function(a){return e.tokenStack.push(a) ,"___HANDLEBARS"+e.tokenStack.length+"___"}))}),e.hooks.add("before-insert",func tion(e){"handlebars"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),e .hooks.add("after-highlight",function(a){if("handlebars"===a.language){for(var n ,t=0;n=a.tokenStack[t];t++)a.highlightedCode=a.highlightedCode.replace("___HANDL EBARS"+(t+1)+"___",e.highlight(n,a.grammar,"handlebars").replace(/\$/g,"$$$$")); a.element.innerHTML=a.highlightedCode}})}(Prism);
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-handlebars.js ('k') | lib/src/prism/components/prism-haskell.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698