/* * jQuery Highlight plugin * * Based on highlight v3 by Johann Burkard * http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html * * Copyright (c) 2009 Bartek Szopka * Licensed under MIT license. */ !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){t.extend({highlight:function(n,r,e,o){if(3===n.nodeType){var s=n.data.match(r);if(s){var i=document.createElement(e||"span");i.className=o||"highlight";var a=n.data.indexOf(s[1],s.index),l=n.splitText(a);l.splitText(s[1].length);var c=l.cloneNode(!0);return i.appendChild(c),l.parentNode.replaceChild(i,l),1}}else if(1===n.nodeType&&n.childNodes&&!/(script|style)/i.test(n.tagName)&&(n.tagName!==e.toUpperCase()||n.className!==o))for(var u=0;u