From 4ba45b65cea71493ab0f6208be33cace719fcd06 Mon Sep 17 00:00:00 2001
From: Peyman Borhani
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: '},v.Converter=function(g){"use strict";var A,C,e={},a=[],n=[],t={},I=c,r={parsed:{},raw:"",format:""};for(A in g=g||{},l)l.hasOwnProperty(A)&&(e[A]=l[A]);if("object"!=typeof g)throw Error("Converter expects the passed parameter to be an object, but "+typeof g+" was passed instead.");for(C in g)g.hasOwnProperty(C)&&(e[C]=g[C]);function o(g,A){if(A=A||null,v.helper.isString(g)){if(A=g=v.helper.stdExtName(g),v.extensions[g]){console.warn("DEPRECATION WARNING: "+g+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!");var C=v.extensions[g],I=g;if("function"==typeof C&&(C=C(new v.Converter)),v.helper.isArray(C)||(C=[C]),!(I=d(C,I)).valid)throw Error(I.error);for(var e=0;e
[^\r]+?<\/pre>)/gm,function(g,A){return A.replace(/^ /gm,"\xa80").replace(/\xa80/g,"")}),v.subParser("hashBlock")("
","gim"),g=r.converter._dispatch("hashPreCodeTags.after",g,e,r)}),v.subParser("headers",function(g,e,r){"use strict";g=r.converter._dispatch("headers.before",g,e,r);var t=isNaN(parseInt(e.headerLevelStart))?1:parseInt(e.headerLevelStart),A=e.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,C=e.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm,A=(g=(g=g.replace(A,function(g,A){var C=v.subParser("spanGamut")(A,e,r),A=e.noHeaderId?"":' id="'+a(A)+'"',A="\n"+g+"\n
",A,C)}),g=C.converter._dispatch("blockQuotes.after",g,A,C)}),v.subParser("codeBlocks",function(g,e,r){"use strict";g=r.converter._dispatch("codeBlocks.before",g,e,r);return g=(g=(g+="\xa80").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=\xa80))/g,function(g,A,C){var I="\n",A=v.subParser("outdent")(A,e,r);return A=v.subParser("encodeCode")(A,e,r),A="
",v.subParser("hashBlock")(A,e,r)+C})).replace(/\xa80/,""),g=r.converter._dispatch("codeBlocks.after",g,e,r)}),v.subParser("codeSpans",function(g,e,r){"use strict";return g=(g=void 0===(g=r.converter._dispatch("codeSpans.before",g,e,r))?"":g).replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(g,A,C,I){return I=(I=I.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),I=A+""+(A=(A=(A=v.subParser("detab")(A,e,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+(I=e.omitExtraWLInCodeBlocks?"":I)+"
"+(I=v.subParser("encodeCode")(I,e,r))+"
",I=v.subParser("hashHTMLSpans")(I,e,r)}),g=r.converter._dispatch("codeSpans.after",g,e,r)}),v.subParser("completeHTMLDocument",function(g,A,C){"use strict";if(A.completeHTMLDocument){g=C.converter._dispatch("completeHTMLDocument.before",g,A,C);var I,e="html",r="\n",t="",a='\n',n="",o="";for(I in void 0!==C.metadata.parsed.doctype&&(r="\n","html"!==(e=C.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==e||(a='')),C.metadata.parsed)if(C.metadata.parsed.hasOwnProperty(I))switch(I.toLowerCase()){case"doctype":break;case"title":t="
",I=v.subParser("hashBlock")(I,r,t),"\n\n\xa8G"+(t.ghCodeBlocks.push({text:g,codeblock:I})-1)+"G\n\n"})).replace(/\xa80/,""),t.converter._dispatch("githubCodeBlocks.after",g,r,t)):g}),v.subParser("hashBlock",function(g,A,C){"use strict";return g=(g=C.converter._dispatch("hashBlock.before",g,A,C)).replace(/(^\n+|\n+$)/g,""),g="\n\n\xa8K"+(C.gHtmlBlocks.push(g)-1)+"K\n\n",g=C.converter._dispatch("hashBlock.after",g,A,C)}),v.subParser("hashCodeTags",function(g,e,r){"use strict";g=r.converter._dispatch("hashCodeTags.before",g,e,r);return g=v.helper.replaceRecursiveRegExp(g,function(g,A,C,I){C=C+v.subParser("encodeCode")(A,e,r)+I;return"\xa8C"+(r.gHtmlSpans.push(C)-1)+"C"},""+(I=(I=(I=v.subParser("detab")(I,r,t)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+e+"
]*>","
","gim"),g=r.converter._dispatch("hashCodeTags.after",g,e,r)}),v.subParser("hashElement",function(g,A,C){"use strict";return function(g,A){return A=(A=(A=A.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),A="\n\n\xa8K"+(C.gHtmlBlocks.push(A)-1)+"K\n\n"}}),v.subParser("hashHTMLBlocks",function(g,A,e){"use strict";g=e.converter._dispatch("hashHTMLBlocks.before",g,A,e);function C(g,A,C,I){return-1!==C.search(/\bmarkdown\b/)&&(g=C+e.converter.makeHtml(A)+I),"\n\n\xa8K"+(e.gHtmlBlocks.push(g)-1)+"K\n\n"}var I=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"];A.backslashEscapesHTMLTags&&(g=g.replace(/\\<(\/?[^>]+?)>/g,function(g,A){return"<"+A+">"}));for(var r=0;r]*>","^ {0,3}
\\s*
",A,C);return g=(g=(g=g.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,I)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,I)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,I),g=C.converter._dispatch("horizontalRule.after",g,A,C)}),v.subParser("images",function(g,A,i){"use strict";function n(g,A,C,I,e,r,t,a){var n=i.gUrls,o=i.gTitles,s=i.gDimensions;if(C=C.toLowerCase(),a=a||"",-1"}return g=(g=(g=(g=(g=(g=i.converter._dispatch("images.before",g,A,i)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,function(g,A,C,I,e,r,t,a){return n(g,A,C,I=I.replace(/\s/g,""),e,r,0,a)})).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,n)).replace(/!\[([^\[\]]+)]()()()()()/g,n),g=i.converter._dispatch("images.after",g,A,i)}),v.subParser("italicsAndBold",function(g,A,C){"use strict";return g=C.converter._dispatch("italicsAndBold.before",g,A,C),g=A.literalMidWordUnderscores?(g=(g=g.replace(/\b___(\S[\s\S]*)___\b/g,function(g,A){return""+A+""})).replace(/\b__(\S[\s\S]*)__\b/g,function(g,A){return""+A+""})).replace(/\b_(\S[\s\S]*?)_\b/g,function(g,A){return""+A+""}):(g=(g=g.replace(/___(\S[\s\S]*?)___/g,function(g,A){return/\S$/.test(A)?""+A+"":g})).replace(/__(\S[\s\S]*?)__/g,function(g,A){return/\S$/.test(A)?""+A+"":g})).replace(/_([^\s_][\s\S]*?)_/g,function(g,A){return/\S$/.test(A)?""+A+"":g}),g=A.literalMidWordAsterisks?(g=(g=g.replace(/([^*]|^)\B\*\*\*(\S[\s\S]+?)\*\*\*\B(?!\*)/g,function(g,A,C){return A+""+C+""})).replace(/([^*]|^)\B\*\*(\S[\s\S]+?)\*\*\B(?!\*)/g,function(g,A,C){return A+""+C+""})).replace(/([^*]|^)\B\*(\S[\s\S]+?)\*\B(?!\*)/g,function(g,A,C){return A+""+C+""}):(g=(g=g.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(g,A){return/\S$/.test(A)?""+A+"":g})).replace(/\*\*(\S[\s\S]*?)\*\*/g,function(g,A){return/\S$/.test(A)?""+A+"":g})).replace(/\*([^\s*][\s\S]*?)\*/g,function(g,A){return/\S$/.test(A)?""+A+"":g}),g=C.converter._dispatch("italicsAndBold.after",g,A,C)}),v.subParser("lists",function(g,i,o){"use strict";function l(g,A){o.gListLevel++,g=g.replace(/\n{2,}$/,"\n");var C=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(\xa80| {0,3}([*+-]|\d+[.])[ \t]+))/gm,n=/\n[ \t]*\n(?!\xa80)/.test(g+="\xa80");return i.disableForced4SpacesIndentedSublists&&(C=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(\xa80|\2([*+-]|\d+[.])[ \t]+))/gm),g=(g=g.replace(C,function(g,A,C,I,e,r,t){t=t&&""!==t.trim();var e=v.subParser("outdent")(e,i,o),a="";return r&&i.tasklists&&(a=' class="task-list-item" style="list-style-type: none;"',e=e.replace(/^[ \t]*\[(x|X| )?]/m,function(){var g='"})),e=e.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(g){return"\xa8A"+g}),e="
]*>/.test(o)&&(s=!0)}e[t]=o}return g=(g=(g=e.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),C.converter._dispatch("paragraphs.after",g,A,C)}),v.subParser("runExtension",function(g,A,C,I){"use strict";return g.filter?A=g.filter(A,I.converter,C):g.regex&&((I=g.regex)instanceof RegExp||(I=new RegExp(I,"g")),A=A.replace(I,g.replace)),A}),v.subParser("spanGamut",function(g,A,C){"use strict";return g=C.converter._dispatch("spanGamut.before",g,A,C),g=v.subParser("codeSpans")(g,A,C),g=v.subParser("escapeSpecialCharsWithinTagAttributes")(g,A,C),g=v.subParser("encodeBackslashEscapes")(g,A,C),g=v.subParser("images")(g,A,C),g=v.subParser("anchors")(g,A,C),g=v.subParser("autoLinks")(g,A,C),g=v.subParser("simplifiedAutoLinks")(g,A,C),g=v.subParser("emoji")(g,A,C),g=v.subParser("underline")(g,A,C),g=v.subParser("italicsAndBold")(g,A,C),g=v.subParser("strikethrough")(g,A,C),g=v.subParser("ellipsis")(g,A,C),g=v.subParser("hashHTMLSpans")(g,A,C),g=v.subParser("encodeAmpsAndAngles")(g,A,C),A.simpleLineBreaks?/\n\n\xa8K/.test(g)||(g=g.replace(/\n+/g,"
\n")):g=g.replace(/ +\n/g,"
\n"),g=C.converter._dispatch("spanGamut.after",g,A,C)}),v.subParser("strikethrough",function(g,C,I){"use strict";return C.strikethrough&&(g=(g=I.converter._dispatch("strikethrough.before",g,C,I)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(g,A){return A=A,""+(A=C.simplifiedAutoLink?v.subParser("simplifiedAutoLinks")(A,C,I):A)+""}),g=I.converter._dispatch("strikethrough.after",g,C,I)),g}),v.subParser("stripLinkDefinitions",function(g,a,n){"use strict";function A(g,A,C,I,e,r,t){return A=A.toLowerCase(),C.match(/^data:.+?\/.+?;base64,/)?n.gUrls[A]=C.replace(/\s/g,""):n.gUrls[A]=v.subParser("encodeAmpsAndAngles")(C,a,n),r?r+t:(t&&(n.gTitles[A]=t.replace(/"|'/g,""")),a.parseImgDimensions&&I&&e&&(n.gDimensions[A]={width:I,height:e}),"")}return g=(g=(g=(g+="\xa80").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=\xa80)|(?=\n\[))/gm,A)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=\xa80))/gm,A)).replace(/\xa80/,"")}),v.subParser("tables",function(g,w,k){"use strict";return w.tables&&(g=(g=(g=(g=k.converter._dispatch("tables.before",g,w,k)).replace(/\\(\|)/g,v.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|\xa80)/gm,A)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|\xa80)/gm,A),g=k.converter._dispatch("tables.after",g,w,k)),g;function A(g){for(var A=g.split("\n"),C=0;C"+(e=v.subParser("spanGamut")(e,w,k))+"\n"));for(C=0;C"+v.subParser("spanGamut")(a,w,k)+"\n"));c.push(u)}for(var p=i,h=c,m="\n\n\n",_=p.length,b=0;b<_;++b)m+=p[b];for(m+=" \n\n\n",b=0;b\n";for(var f=0;f<_;++f)m+=h[b][f];m+="\n"}return m+=" \n
\n"}}),v.subParser("underline",function(g,A,C){"use strict";return A.underline&&(g=C.converter._dispatch("underline.before",g,A,C),g=(g=A.literalMidWordUnderscores?g.replace(/\b_?__(\S[\s\S]*)___?\b/g,function(g,A){return""+A+""}):g.replace(/_?__(\S[\s\S]*?)___?/g,function(g,A){return/\S$/.test(A)?""+A+"":g})).replace(/(_)/g,v.helper.escapeCharactersCallback),g=C.converter._dispatch("underline.after",g,A,C)),g}),v.subParser("unescapeSpecialChars",function(g,A,C){"use strict";return g=(g=C.converter._dispatch("unescapeSpecialChars.before",g,A,C)).replace(/\xa8E(\d+)E/g,function(g,A){A=parseInt(A);return String.fromCharCode(A)}),g=C.converter._dispatch("unescapeSpecialChars.after",g,A,C)});"function"==typeof define&&define.amd?define(function(){"use strict";return v}):"undefined"!=typeof module&&module.exports?module.exports=v:this.showdown=v}.call(this),String.prototype.includes||(String.prototype.includes=function(g,A){"use strict";if(g instanceof RegExp)throw TypeError("first argument must not be a RegExp");return-1!==this.indexOf(g,A=void 0===A?0:A)}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(g){g.hasOwnProperty("prepend")||Object.defineProperty(g,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var g=Array.prototype.slice.call(arguments),C=document.createDocumentFragment();g.forEach(function(g){var A=g instanceof Node;C.appendChild(A?g:document.createTextNode(String(g)))}),this.insertBefore(C,this.firstChild)}})}),document.addEventListener("DOMContentLoaded",function(){var g=document.createElement("style"),A='body { padding: 20px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;} ',A=(A+"blockquote { padding: 0 1em; color: #6a737d; border-left: 0.25em solid #dfe2e5;} "+"code { padding: 0.2em 0.4em; background: rgba(27,31,35,0.05); border-radius: 3px;} "+"pre > code { background: none } "+"pre { padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa; border-radius: 3px; } "+"table { border-collapse: collapse; } "+"td, th { border: 1px solid #ddd; padding: 10px 13px; } ",g.innerHTML='body { padding: 20px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;} blockquote { padding: 0 1em; color: #6a737d; border-left: 0.25em solid #dfe2e5;} code { padding: 0.2em 0.4em; background: rgba(27,31,35,0.05); border-radius: 3px;} pre > code { background: none } pre { padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa; border-radius: 3px; } table { border-collapse: collapse; } td, th { border: 1px solid #ddd; padding: 10px 13px; } ',document.head.prepend(g),document.createElement("meta")),g=(A.setAttribute("name","viewport"),A.setAttribute("content","width=device-width, initial-scale=1, shrink-to-fit=no"),document.head.appendChild(A),document.createElement("meta"));g.setAttribute("charset","UTF-8"),document.head.appendChild(g);window.navigator.userAgent.indexOf("MSIE ")?(A=document.querySelector("noscript"),(g=document.createElement("pre")).appendChild(A),C=g.textContent||g.innerText,delete A,delete g):C=document.querySelector("noscript").innerText;var C,A=new showdown.Converter({emoji:!0,underline:!0}),g=(A.setFlavor("github"),A.addExtension(function(){return[{type:"output",regex:/]+>/g,replace:function(g){var A=g.match(/"(.*?)"/)[1];return A.includes(window.location.hostname)||"/"==A[0]||"."==A[0]||"#"==A[0]?g:''}}]},"externalLink"),A.makeHtml(C));document.body.innerHTML=g,document.title=document.title||document.body.firstElementChild.innerText.trim(),setTimeout(function(){var g=window.location.hash;window.location.hash="",window.location.hash=g},100)});