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

Side by Side Diff: lib/src/prism/plugins/keep-markup/prism-keep-markup.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
(Empty)
1 !function(){"undefined"!=typeof self&&self.Prism&&self.document&&document.create Range&&(Prism.hooks.add("before-highlight",function(e){var n=!1,o=0,t=[],d=funct ion(e,a){var r={};a||(r.clone=e.cloneNode(!1),r.posOpen=o,t.push(r));for(var s=0 ,p=e.childNodes.length;p>s;s++){var l=e.childNodes[s];1===l.nodeType?d(l):3===l. nodeType&&(n||(l.data=l.data.replace(/^(?:\r?\n|\r)/,""),n=!0),o+=l.data.length) }a||(r.posClose=o)};d(e.element,!0),t&&t.length&&(e.keepMarkup=t)}),Prism.hooks. add("after-highlight",function(e){if(e.keepMarkup&&e.keepMarkup.length){var n=fu nction(e,o){for(var t=0,d=e.childNodes.length;d>t;t++){var a=e.childNodes[t];if( 1===a.nodeType){if(!n(a,o))return!1}else 3===a.nodeType&&(!o.nodeStart&&o.pos+a. data.length>o.node.posOpen&&(o.nodeStart=a,o.nodeStartPos=o.node.posOpen-o.pos), o.nodeStart&&o.pos+a.data.length>=o.node.posClose&&(o.nodeEnd=a,o.nodeEndPos=o.n ode.posClose-o.pos),o.pos+=a.data.length);if(o.nodeStart&&o.nodeEnd){var r=docum ent.createRange();return r.setStart(o.nodeStart,o.nodeStartPos),r.setEnd(o.nodeE nd,o.nodeEndPos),o.node.clone.appendChild(r.extractContents()),r.insertNode(o.no de.clone),r.detach(),!1}}return!0};e.keepMarkup.forEach(function(o){n(e.element, {node:o,pos:0})})}}))}();
OLDNEW
« no previous file with comments | « lib/src/prism/plugins/keep-markup/prism-keep-markup.js ('k') | lib/src/prism/plugins/line-highlight/prism-line-highlight.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698