You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
12 KiB

5 years ago
(function(){var a=new RegExp(["^(<\\/?(a|abbr|acronym|applet|area|b|basefont|","bdo|big|button|cite|code|del|dfn|em|figcaption|","font|i|iframe|img|input|ins|kbd|label|map|","mark|meter|object|param|progress|q|ruby|rp|rt|s|","samp|script|select|small|span|strike|strong|","sub|sup|textarea|time|tt|u|var|wbr)[^>]*>|","<(br)\\s?\\/?>)$"].join(""),"i");if(!Array.indexOf){Array.prototype.indexOf=function(v){for(var u=0;u<this.length;u++){if(this[u]==v){return u}}return -1}}function m(u){return u.replace(/^\s+|\s+$/g,"")}function c(u){return u.replace(/\s+$/g,"")}function h(u){return u.replace(new RegExp("^(\\t|[ ]{1,4})","gm"),"")}function g(v,u){return v.indexOf(u)!=-1}function d(u,v){return u.replace(/<[^>]*>?/gi,function(w){return w.match(v)?w:""})}function b(u,B){var A={};for(var z=0;z<u.length;z++){A[u[z]]=u[z]}for(z=0;z<B.length;z++){A[B[z]]=B[z]}var w=[];for(var v in A){if(A.hasOwnProperty(v)){w.push(A[v])}}return w}function p(u){if(u.charAt(0)!="\x02"){u="\x02"+u}if(u.charAt(u.length-1)!="\x03"){u=u+"\x03"}return u}function k(u){if(u.charAt(0)=="\x02"){u=u.substr(1)}if(u.charAt(u.length-1)=="\x03"){u=u.substr(0,u.length-1)}return u}function t(v,u){return d(j(v,u),a)}function j(w,v){var u=v.blockGamutHookCallback(w);u=l(u);u=u.replace(/~D/g,"$$").replace(/~T/g,"~");u=v.previousPostConversion(u);return u}function r(u){return u.replace(/\\\|/g,"~I").replace(/\\:/g,"~i")}function q(u){return u.replace(/~I/g,"|").replace(/~i/g,":")}function l(u){u=u.replace(/~E(\d+)E/g,function(v,x){var w=parseInt(x);return String.fromCharCode(w)});return u}function i(u){return u.toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}Markdown.Extra=function(){this.converter=null;this.hashBlocks=[];this.footnotes={};this.usedFootnotes=[];this.attributeBlocks=false;this.googleCodePrettify=false;this.highlightJs=false;this.tableClass="";this.tabWidth=4};Markdown.Extra.init=function(y,w){var u=new Markdown.Extra();var A=[];var x=[];var z=[];var v=["unHashExtraBlocks"];w=w||{};w.extensions=w.extensions||["all"];if(g(w.extensions,"all")){w.extensions=["tables","fenced_code_gfm","def_list","attr_list","footnotes","smartypants","strikethrough","newlines"]}x.push("wrapHeaders");if(g(w.extensions,"attr_list")){A.push("hashFcbAttributeBlocks");x.push("hashHeaderAttributeBlocks");v.push("applyAttributeBlocks");u.attributeBlocks=true}if(g(w.extensions,"fenced_code_gfm")){x.push("fencedCodeBlocks");A.push("fencedCodeBlocks")}if(g(w.extensions,"tables")){x.push("tables")}if(g(w.extensions,"def_list")){x.push("definitionLists")}if(g(w.extensions,"footnotes")){A.push("stripFootnoteDefinitions");x.push("doFootnotes");v.push("printFootnotes")}if(g(w.extensions,"smartypants")){v.push("runSmartyPants")}if(g(w.extensions,"strikethrough")){z.push("strikethrough")}if(g(w.extensions,"newlines")){z.push("newlines")}y.hooks.chain("postNormalization",function(B){return u.doTransform(A,B)+"\n"});y.hooks.chain("preBlockGamut",function(C,B){u.blockGamutHookCallback=B;C=r(C);C=u.doTransform(x,C)+"\n";C=q(C);return C});y.hooks.chain("postSpanGamut",function(B){return u.doTransform(z,B)});u.previousPostConversion=y.hooks.postConversion;y.hooks.chain("postConversion",function(B){B=u.doTransform(v,B);u.hashBlocks=[];u.footnotes={};u.usedFootnotes=[];return B});if("highlighter" in w){u.googleCodePrettify=w.highlighter==="prettify";u.highlightJs=w.highlighter==="highlight"}if("table_class" in w){u.tableClass=w.table_class}u.converter=y;return u};Markdown.Extra.prototype.doTransform=function(u,w){for(var v=0;v<u.length;v++){w=this[u[v]](w)}return w};Markdown.Extra.prototype.hashExtraBlock=function(u){return"\n<p>~X"+(this.hashBlocks.push(u)-1)+"X</p>\n"};Markdown.Extra.prototype.hashExtraInline=function(u){return"~X"+(this.hashBlocks.push(u)-1)+"X"};Markdown.Extra.prototype.unHashExtraBlocks=function(w){var v=this;function u(){var x=false;w=w.replace(/(?:<p>)?~X(\d+)X(?:<\/p>)?/g,function(y,z){x=true;var A=parseInt(z,10);return v.hashBlocks[A]});if(x===true){u()}}u();return w};Markdown.Extra.prototype.wrapHeaders=fun