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

Side by Side Diff: lib/src/prism/components/prism-smarty.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-smarty.js ('k') | lib/src/prism/components/prism-sql.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 t=/\{\*[\w\W]+?\*\}|\{[\w\W]+?\}/g,a="{literal}",n="{/literal}" ,o=!1;e.languages.smarty=e.languages.extend("markup",{smarty:{pattern:t,inside:{ delimiter:{pattern:/^\{|\}$/i,alias:"punctuation"},string:/(["'])(\\?.)*?\1/,num ber:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,variable:[/\$(?!\d)\w+/,/#(?!\ d)\w+#/,{pattern:/(\.|->)(?!\d)\w+/,lookbehind:!0},{pattern:/(\[)(?!\d)\w+(?=\]) /,lookbehind:!0}],"function":[{pattern:/(\|\s*)@?(?!\d)\w+/,lookbehind:!0},/^\/? (?!\d)\w+/,/(?!\d)\w+(?=\()/],"attr-name":{pattern:/\w+\s*=\s*(?:(?!\d)\w+)?/,in side:{variable:{pattern:/(=\s*)(?!\d)\w+/,lookbehind:!0},punctuation:/=/}},punct uation:/[\[\]().,=\|:`]|\->/,operator:[/[+\-*\/%]|===?|[!<>]=?|&&|\|\|/,/\bis\s+ (?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,/\b(?:eq|neq?|gt|lt|gt?e|lt?e|not|mod|o r|and)\b/],keyword:/\b(?:false|off|on|no|true|yes)\b/}}}),e.languages.insertBefo re("smarty","tag",{"smarty-comment":{pattern:/\{\*[\w\W]*?\*\}/,alias:["smarty", "comment"]}}),e.hooks.add("before-highlight",function(e){"smarty"===e.language&& (e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(t,function(t){return t===n&&(o=!1),o?t:(t===a&&(o=!0),e.tokenStack.push(t),"___SMARTY"+e.tokenStack.l ength+"___")}))}),e.hooks.add("before-insert",function(e){"smarty"===e.language& &(e.code=e.backupCode,delete e.backupCode)}),e.hooks.add("after-highlight",funct ion(t){if("smarty"===t.language){for(var a,n=0;a=t.tokenStack[n];n++)t.highlight edCode=t.highlightedCode.replace("___SMARTY"+(n+1)+"___",e.highlight(a,t.grammar ,"smarty"));t.element.innerHTML=t.highlightedCode}})}(Prism); 1 !function(e){var t=/\{\*[\w\W]+?\*\}|\{[\w\W]+?\}/g,a="{literal}",n="{/literal}" ,o=!1;e.languages.smarty=e.languages.extend("markup",{smarty:{pattern:t,inside:{ delimiter:{pattern:/^\{|\}$/i,alias:"punctuation"},string:/(["'])(?:\\?.)*?\1/,n umber:/\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee][-+]?\d+)?)\b/,variable:[/\$(?!\d)\w +/,/#(?!\d)\w+#/,{pattern:/(\.|->)(?!\d)\w+/,lookbehind:!0},{pattern:/(\[)(?!\d) \w+(?=\])/,lookbehind:!0}],"function":[{pattern:/(\|\s*)@?(?!\d)\w+/,lookbehind: !0},/^\/?(?!\d)\w+/,/(?!\d)\w+(?=\()/],"attr-name":{pattern:/\w+\s*=\s*(?:(?!\d) \w+)?/,inside:{variable:{pattern:/(=\s*)(?!\d)\w+/,lookbehind:!0},operator:/=/}} ,punctuation:[/[\[\]().,:`]|\->/],operator:[/[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,/ \bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,/\b(?:eq|neq?|gt|lt|gt?e|lt?e|no t|mod|or|and)\b/],keyword:/\b(?:false|off|on|no|true|yes)\b/}}}),e.languages.ins ertBefore("smarty","tag",{"smarty-comment":{pattern:/\{\*[\w\W]*?\*\}/,alias:["s marty","comment"]}}),e.hooks.add("before-highlight",function(e){"smarty"===e.lan guage&&(e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(t,function(t){ return t===n&&(o=!1),o?t:(t===a&&(o=!0),e.tokenStack.push(t),"___SMARTY"+e.token Stack.length+"___")}))}),e.hooks.add("before-insert",function(e){"smarty"===e.la nguage&&(e.code=e.backupCode,delete e.backupCode)}),e.hooks.add("after-highlight ",function(t){if("smarty"===t.language){for(var a,n=0;a=t.tokenStack[n];n++)t.hi ghlightedCode=t.highlightedCode.replace("___SMARTY"+(n+1)+"___",e.highlight(a,t. grammar,"smarty").replace(/\$/g,"$$$$"));t.element.innerHTML=t.highlightedCode}} )}(Prism);
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-smarty.js ('k') | lib/src/prism/components/prism-sql.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698