/*! showdown 31-05-2015 */ (function(){function a(a,b){"use strict";var d=b?"Error in "+b+" extension: ":"Error in unnamed extension",e={valid:!0,error:d};if("object"!=typeof a)return e.valid=!1,e.error=d+"it must be an object, but "+typeof a+" given",e;if(!c.helper.isString(a.type))return e.valid=!1,e.error=d+'property "type" must be a string, but '+typeof a.type+" given",e;var f=a.type=a.type.toLowerCase();if("language"===f&&(f=a.type="lang"),"html"===f&&(f=a.type="output"),"lang"!==f&&"output"!==f)return e.valid=!1,e.error=d+"type "+f+' is not recognized. Valid values: "lang" or "output"',e;if(a.filter){if("function"!=typeof a.filter)return e.valid=!1,e.error=d+'"filter" must be a function, but '+typeof a.filter+" given",e}else{if(!a.regex)return e.valid=!1,e.error=d+'extensions must define either a "regex" property or a "filter" method',e;if(c.helper.isString(a.regex)&&(a.regex=new RegExp(a.regex,"g")),!a.regex instanceof RegExp)return e.valid=!1,e.error=d+'"regex" property must either be a string or a RegExp object, but '+typeof a.regex+" given",e;if(c.helper.isUndefined(a.replace))return e.valid=!1,e.error=d+'"regex" extensions must implement a replace string or function',e}return c.helper.isUndefined(a.filter)&&c.helper.isUndefined(a.regex)?(e.valid=!1,e.error=d+"output extensions must define a filter property",e):e}function b(a,b){"use strict";var c=b.charCodeAt(0);return"~E"+c+"E"}var c={},d={},e={},f={omitExtraWLInCodeBlocks:!1,prefixHeaderId:!1},g=JSON.parse(JSON.stringify(f));c.helper={},c.extensions={},c.setOption=function(a,b){"use strict";return g[a]=b,this},c.getOption=function(a){"use strict";return g[a]},c.getOptions=function(){"use strict";return g},c.resetOptions=function(){"use strict";g=JSON.parse(JSON.stringify(f))},c.subParser=function(a,b){"use strict";if(c.helper.isString(a)){if("undefined"==typeof b){if(d.hasOwnProperty(a))return d[a];throw Error("SubParser named "+a+" not registered!")}d[a]=b}},c.extension=function(b,d){"use strict";if(!c.helper.isString(b))throw Error("Extension 'name' must be a string");if(b=c.helper.stdExtName(b),c.helper.isUndefined(d)){if(!e.hasOwnProperty(b))throw Error("Extension named "+b+" is not registered!");return e[b]}"function"==typeof d&&(d=d());var f=a(d,b);if(!f.valid)throw Error(f.error);e[b]=d},c.getAllExtensions=function(){"use strict";return e},c.removeExtension=function(a){"use strict";delete e[a]},c.resetExtensions=function(){"use strict";e={}},c.validateExtension=function(b){"use strict";var c=a(b,null);return c.valid?!0:(console.warn(c.error),!1)},c.hasOwnProperty("helper")||(c.helper={}),c.helper.isString=function(a){"use strict";return"string"==typeof a||a instanceof String},c.helper.forEach=function(a,b){"use strict";if("function"==typeof a.forEach)a.forEach(b);else for(var c=0;c-1))return a;m=""}else m=d.gUrls[l],c.helper.isUndefined(d.gTitles[l])||(n=d.gTitles[l]);m=c.helper.escapeCharacters(m,"*_",!1);var o='"};return a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,e),a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,e),a=a.replace(/(\[([^\[\]]+)\])()()()()()/g,e)}),c.subParser("autoLinks",function(a){"use strict";a=a.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'$1');var b=/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi;return a=a.replace(b,function(a,b){var d=c.subParser("unescapeSpecialChars")(b);return c.subParser("encodeEmailAddress")(d)})}),c.subParser("blockGamut",function(a,b,d){"use strict";a=c.subParser("headers")(a,b,d);var e=c.subParser("hashBlock")("
",b,d);return a=a.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,e),a=a.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,e),a=a.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,e),a=c.subParser("lists")(a,b,d),a=c.subParser("codeBlocks")(a,b,d),a=c.subParser("blockQuotes")(a,b,d),a=c.subParser("hashHTMLBlocks")(a,b,d),a=c.subParser("paragraphs")(a,b,d)}),c.subParser("blockQuotes",function(a,b,d){"use strict";return a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,e){var f=e;return f=f.replace(/^[ \t]*>[ \t]?/gm,"~0"),f=f.replace(/~0/g,""),f=f.replace(/^[ \t]+$/gm,""),f=c.subParser("blockGamut")(f,b,d),f=f.replace(/(^|\n)/g,"$1 "),f=f.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(a,b){var c=b;return c=c.replace(/^  /gm,"~0"),c=c.replace(/~0/g,"")}),c.subParser("hashBlock")("
\n"+f+"\n
",b,d)})}),c.subParser("codeBlocks",function(a,b,d){"use strict";a+="~0";var e=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g;return a=a.replace(e,function(a,e,f){var g=e,h=f,i="\n";return g=c.subParser("outdent")(g),g=c.subParser("encodeCode")(g),g=c.subParser("detab")(g),g=g.replace(/^\n+/g,""),g=g.replace(/\n+$/g,""),b.omitExtraWLInCodeBlocks&&(i=""),g="
"+g+i+"
",c.subParser("hashBlock")(g,b,d)+h}),a=a.replace(/~0/,"")}),c.subParser("codeSpans",function(a){"use strict";return a=a.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(a,b,d,e){var f=e;return f=f.replace(/^([ \t]*)/g,""),f=f.replace(/[ \t]*$/g,""),f=c.subParser("encodeCode")(f),b+""+f+""})}),c.subParser("detab",function(a){"use strict";return a=a.replace(/\t(?=\t)/g," "),a=a.replace(/\t/g,"~A~B"),a=a.replace(/~B(.+?)~A/g,function(a,b){for(var c=b,d=4-c.length%4,e=0;d>e;e++)c+=" ";return c}),a=a.replace(/~A/g," "),a=a.replace(/~B/g,"")}),c.subParser("encodeAmpsAndAngles",function(a){"use strict";return a=a.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),a=a.replace(/<(?![a-z\/?\$!])/gi,"<")}),c.subParser("encodeBackslashEscapes",function(a){"use strict";return a=a.replace(/\\(\\)/g,c.helper.escapeCharactersCallback),a=a.replace(/\\([`*_{}\[\]()>#+-.!])/g,c.helper.escapeCharactersCallback)}),c.subParser("encodeCode",function(a){"use strict";return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=c.helper.escapeCharacters(a,"*_{}[]\\",!1)}),c.subParser("encodeEmailAddress",function(a){"use strict";var b=[function(a){return"&#"+a.charCodeAt(0)+";"},function(a){return"&#x"+a.charCodeAt(0).toString(16)+";"},function(a){return a}];return a="mailto:"+a,a=a.replace(/./g,function(a){if("@"===a)a=b[Math.floor(2*Math.random())](a);else if(":"!==a){var c=Math.random();a=c>.9?b[2](a):c>.45?b[1](a):b[0](a)}return a}),a=''+a+"",a=a.replace(/">.+:/g,'">')}),c.subParser("escapeSpecialCharsWithinTagAttributes",function(a){"use strict";var b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi;return a=a.replace(b,function(a){var b=a.replace(/(.)<\/?code>(?=.)/g,"$1`");return b=c.helper.escapeCharacters(b,"\\`*_",!1)})}),c.subParser("githubCodeBlocks",function(a,b,d){"use strict";return a+="~0",a=a.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(a,e,f){var g=e,h=f,i="\n";return b.omitExtraWLInCodeBlocks&&(i=""),h=c.subParser("encodeCode")(h),h=c.subParser("detab")(h),h=h.replace(/^\n+/g,""),h=h.replace(/\n+$/g,""),h="
"+h+i+"
",c.subParser("hashBlock")(h,b,d)}),a=a.replace(/~0/,"")}),c.subParser("hashBlock",function(a,b,c){"use strict";return a=a.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(c.gHtmlBlocks.push(a)-1)+"K\n\n"}),c.subParser("hashElement",function(a,b,c){"use strict";return function(a,b){var d=b;return d=d.replace(/\n\n/g,"\n"),d=d.replace(/^\n/,""),d=d.replace(/\n+$/g,""),d="\n\n~K"+(c.gHtmlBlocks.push(d)-1)+"K\n\n"}}),c.subParser("hashHTMLBlocks",function(a,b,d){"use strict";return a=a.replace(/\n/g,"\n\n"),a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,c.subParser("hashElement")(a,b,d)),a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside|address|audio|canvas|figure|hgroup|output|video)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,c.subParser("hashElement")(a,b,d)),a=a.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,c.subParser("hashElement")(a,b,d)),a=a.replace(/(\n\n[ ]{0,3}[ \t]*(?=\n{2,}))/g,c.subParser("hashElement")(a,b,d)),a=a.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,c.subParser("hashElement")(a,b,d)),a=a.replace(/\n\n/g,"\n")}),c.subParser("headers",function(a,b,d){"use strict";function e(a){var b,e=a.replace(/[^\w]/g,"").toLowerCase();return d.hashLinkCounts[e]?b=e+"-"+d.hashLinkCounts[e]++:(b=e,d.hashLinkCounts[e]=1),f===!0&&(f="section"),c.helper.isString(f)?f+b:b}var f=b.prefixHeaderId;return a=a.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(a,f){var g=c.subParser("spanGamut")(f,b,d),h='

'+g+"

";return c.subParser("hashBlock")(h,b,d)}),a=a.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(a,f){var g=c.subParser("spanGamut")(f,b,d),h='

'+g+"

";return c.subParser("hashBlock")(h,b,d)}),a=a.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(a,f,g){var h=c.subParser("spanGamut")(g,b,d),i="'+h+"";return c.subParser("hashBlock")(i,b,d)})}),c.subParser("images",function(a,b,d){"use strict";var e=function(a,b,e,f,g,h,i,j){a=b;var k=e,l=f.toLowerCase(),m=g,n=j,o=d.gUrls,p=d.gTitles;if(n||(n=""),""===m||null===m){if((""===l||null===l)&&(l=k.toLowerCase().replace(/ ?\n/g," ")),m="#"+l,"undefined"==typeof o[l])return a;m=o[l],"undefined"!=typeof p[l]&&(n=p[l])}k=k.replace(/"/g,"""),m=c.helper.escapeCharacters(m,"*_",!1);var q=''+k+'?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,e)}),c.subParser("italicsAndBold",function(a){"use strict";return a=a.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2"),a=a.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2")}),c.subParser("lists",function(a,b,d){"use strict";var e=function(a){return d.gListLevel++,a=a.replace(/\n{2,}$/,"\n"),a+="~0",a=a.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(a,e,f,g,h){var i=c.subParser("outdent")(h,b,d);return e||i.search(/\n{2,}/)>-1?i=c.subParser("blockGamut")(i,b,d):(i=c.subParser("lists")(i,b,d),i=i.replace(/\n$/,""),i=c.subParser("spanGamut")(i,b,d)),"
  • "+i+"
  • \n"}),a=a.replace(/~0/g,""),d.gListLevel--,a};a+="~0";var f=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return d.gListLevel?a=a.replace(f,function(a,b,c){var d=b,f=c.search(/[*+-]/g)>-1?"ul":"ol";d=d.replace(/\n{2,}/g,"\n\n\n");var g=e(d);return g=g.replace(/\s+$/,""),g="<"+f+">"+g+"\n"}):(f=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,a=a.replace(f,function(a,b,c,d){var f=c.replace(/\n{2,}/g,"\n\n\n"),g=d.search(/[*+-]/g)>-1?"ul":"ol",h=e(f);return b+"<"+g+">\n"+h+"\n"})),a=a.replace(/~0/,"")}),c.subParser("outdent",function(a){"use strict";return a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,"")}),c.subParser("outputModifiers",function(a,b,d){"use strict";return c.helper.forEach(d.outputModifiers,function(b){a=c.subParser("runExtension")(b,a)}),a}),c.subParser("paragraphs",function(a,b,d){"use strict";a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");for(var e=a.split(/\n{2,}/g),f=[],g=e.length,h=0;g>h;h++){var i=e[h];i.search(/~K(\d+)K/g)>=0?f.push(i):i.search(/\S/)>=0&&(i=c.subParser("spanGamut")(i,b,d),i=i.replace(/^([ \t]*)/g,"

    "),i+="

    ",f.push(i))}for(g=f.length,h=0;g>h;h++)for(;f[h].search(/~K(\d+)K/)>=0;){var j=d.gHtmlBlocks[RegExp.$1];j=j.replace(/\$/g,"$$$$"),f[h]=f[h].replace(/~K\d+K/,j)}return f.join("\n\n")}),c.subParser("runExtension",function(a,b,c,d){"use strict";if(a.filter)b=a.filter(b,d.converter,c);else if(a.regex){var e=a.regex;!e instanceof RegExp&&(e=new RegExp(e,"g")),b=b.replace(e,a.replace)}return b}),c.subParser("spanGamut",function(a,b,d){"use strict";return a=c.subParser("codeSpans")(a,b,d),a=c.subParser("escapeSpecialCharsWithinTagAttributes")(a,b,d),a=c.subParser("encodeBackslashEscapes")(a,b,d),a=c.subParser("images")(a,b,d),a=c.subParser("anchors")(a,b,d),a=c.subParser("autoLinks")(a,b,d),a=c.subParser("encodeAmpsAndAngles")(a,b,d),a=c.subParser("italicsAndBold")(a,b,d),a=a.replace(/ +\n/g,"
    \n")}),c.subParser("stripBlankLines",function(a){"use strict";return a.replace(/^[ \t]+$/gm,"")}),c.subParser("stripLinkDefinitions",function(a,b,d){"use strict";var e=/^[ ]{0,3}\[(.+)]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|(?=~0))/gm;return a+="~0",a=a.replace(e,function(a,b,e,f,g){return b=b.toLowerCase(),d.gUrls[b]=c.subParser("encodeAmpsAndAngles")(e),f?f+g:(g&&(d.gTitles[b]=g.replace(/"/g,""")),"")}),a=a.replace(/~0/,"")}),c.subParser("unescapeSpecialChars",function(a){"use strict";return a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)})});var h=this;"undefined"!=typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd?define("showdown",function(){"use strict";return c}):h.showdown=c}).call(this); //# sourceMappingURL=showdown.min.js.map