(function(){functiona(a){"use strict";if(!f.hasOwnProperty(a))throwError("Extension named "+a+" is not registered!");returnf[a]}functionb(a,b){"use strict";if("object"!=typeofb)throwError("A Showdown Extension must be an object, "+typeofb+" given");if(!d.helper.isString(b.type))throwError('When registering a showdown extension, "type" must be a string, '+typeofb.type+" given");b.type=b.type.toLowerCase(),f[a]=b}functionc(a,b){"use strict";varc=b.charCodeAt(0);return"~E"+c+"E"}vard={},e={},f={},g={omitExtraWLInCodeBlocks:!1,prefixHeaderId:!1};d.helper={},d.extensions={},d.setOption=function(a,b){"use strict";returng[a]=b,this},d.getOption=function(a){"use strict";returng[a]},d.getOptions=function(){"use strict";returng},d.subParser=function(a,b){"use strict";if(d.helper.isString(a)){if("undefined"==typeofb){if(e.hasOwnProperty(a))returne[a];throwError("SubParser named "+a+" not registered!")}e[a]=b}},d.extension=function(c,e){"use strict";if(!d.helper.isString(c))throwError("Extension 'name' must be a string");returnc=d.helper.stdExtName(c),d.helper.isUndefined(e)?a():b()},d.Converter=function(a){"use strict";functionb(a){if(!a)returna;varb={gHtmlBlocks:[],gUrls:{},gTitles:{},gListLevel:0,hashLinkCounts:{},langExtensions:h,outputModifiers:i};a=a.replace(/~/g,"~T"),a=a.replace(/\$/g,"~D"),a=a.replace(/\r\n/g,"\n"),a=a.replace(/\r/g,"\n"),a="\n\n"+a+"\n\n",a=e.detab(a,c,b),a=e.stripBlankLines(a,c,b),a=e.languageExtensions(a,c,b);for(varf=0;f<j.length;++f){varg=j[f];a=e[g](a,c,b)}returna=a.replace(/~D/g,"$$"),a=a.replace(/~T/g,"~"),d.helper.forEach(b.outputModifiers,function(b){a=d.subParser("runExtension")(b,a)}),a=e.outputModifiers(a,c,b)}a=a||{};varc={},h=[],i=[],j=["githubCodeBlocks","hashHTMLBlocks","stripLinkDefinitions","blockGamut","unescapeSpecialChars"];for(varking)g.hasOwnProperty(k)&&(c[k]=g[k]);if("object"==typeofa)for(varlina)a.hasOwnProperty(l)&&(c[l]=a[l]);varm=this;returnm.makeHtml=b,c.extensions&&d.helper.forEach(c.extensions,function(a){varb=a;if("string"==typeofa){varc=d.helper.stdExtName(a);!d.helper.isUndefined(d.extensions[c])&&d.extensions[c]?a=d.extensions[c]:d.helper.isUndefined(f[c])||(a=f[c])}if("function"!=typeofa){vare="An extension could not be loaded. It was either not found or is not a valid extension.";throw"string"==typeofb&&(e='Extension "'+b+'" could not be loaded. It was either not found or is not a valid extension.'),e}d.helper.forEach(a(m),function(a){a.type?"language"===a.type||"lang"===a.type?h.push(a):("output"===a.type||"html"===a.type)&&i.push(a):i.push(a)})}),{makeHtml:b}},d.hasOwnProperty("helper")||(d.helper={}),d.helper.isString=function(a){"use strict";return"string"==typeofa||ainstanceofString},d.helper.forEach=function(a,b){"use strict";if("function"==typeofa.forEach)a.forEach(b);elsefor(varc=0;c<a.length;c++)b(a[c],c,a)},d.helper.isArray=function(a){"use strict";returna.constructor===Array},d.helper.isUndefined=function(a){"use strict";return"undefined"==typeofa},d.helper.stdExtName=function(a){"use strict";returna.replace(/[_-]||\s/g,"").toLowerCase()},d.helper.escapeCharactersCallback=c,d.helper.escapeCharacters=function(a,b,d){"use strict";vare="(["+b.replace(/([\[\]\\])/g,"\\$1")+"])";d&&(e="\\\\"+e);varf=newRegExp(e,"g");returna=a.replace(f,c)},d.subParser("anchors",function(a,b,c){"use strict";vare=function(a,b,e,f,g,h,i,j){d.helper.isUndefined(j)&&(j=""),a=b;vark=e,l=f.toLowerCase(),m=g,n=j;if(!m)if(l||(l=k.toLowerCase().replace(/ ?\n/g," ")),m="#"+l,d.helper.isUndefined(c.gUrls[l])){if(!(a.search(/\(\s*\)$/m)>-1))returna;m=""}elsem=c.gUrls[l],d.helper.isUndefined(c.gTitles[l])||(n=c.gTitles[l]);m=d.helper.escapeCharacters(m,"*_",!1);varo='<a href="'+m+'"';return""!==n&&null!==n&&(n=n.replace(/"/g,"""),n=d.helper.escapeCharacters(n,"*_",!1),o+=' title="'+n+'"'),o+=">"+k+"</a>"};returna=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,e),a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?(?:\(.*?\).*?)?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,e),a=a.replace(/(\[([^\[\]