/*! showdown 16-01-2015 */ (function(){"use strict";function a(a){return"string"==typeof a||a instanceof String}function b(a,b){if("function"==typeof a.forEach)a.forEach(b);else{var c,d=a.length;for(c=0;d>c;c++)b(a[c],c,a)}}function c(a){return a.constructor===Array}function d(a){return"undefined"==typeof a}var e={},f={},g={omitExtraWLInCodeBlocks:!1};e.helper={},e.extensions={},e.setOption=function(a,b){return g[a]=b,this},e.subParser=function(a,b){if(e.helper.isString(a)){if("undefined"==typeof b){if(f.hasOwnProperty(a))return f[a];throw Error("SubParser named "+a+" not registered!")}f[a]=b}},e.Converter=function(a){a=a||{};var b=g,c=["detab","stripBlankLines","githubCodeBlocks","hashHTMLBlocks","stripLinkDefinitions","blockGamut","unescapeSpecialChars"];if("object"==typeof a)for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);var e=function(a){if(!a)return a;var d={gHtmlBlocks:[],gUrls:{},gTitles:{},gListLevel:0};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";for(var e=0;e-1))return a;m=""}else m=c.gUrls[l],e.helper.isUndefined(c.gTitles[l])||(n=c.gTitles[l]);m=e.helper.escapeCharacters(m,"*_");var o='"};return a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,d),a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,d),a=a.replace(/(\[([^\[\]]+)\])()()()()()/g,d)}),e.subParser("autoLinks",function(a){return a=a.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'$1'),a=a.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(a,b){var c=e.subParser("unescapeSpecialChars")(b);return e.subParser("encodeEmailAddress")(c)})}),e.subParser("blockGamut",function(a,b,c){a=e.subParser("headers")(a,b,c);var d=e.subParser("hashBlock")("
",b,c);return a=a.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,d),a=a.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,d),a=a.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,d),a=e.subParser("lists")(a,b,c),a=e.subParser("codeBlocks")(a,b,c),a=e.subParser("blockQuotes")(a,b,c),a=e.subParser("hashHTMLBlocks")(a,b,c),a=e.subParser("paragraphs")(a,b,c)}),e.subParser("blockQuotes",function(a,b,c){return a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,d){var f=d;return f=f.replace(/^[ \t]*>[ \t]?/gm,"~0"),f=f.replace(/~0/g,""),f=f.replace(/^[ \t]+$/gm,""),f=e.subParser("blockGamut")(f,b,c),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,"")}),e.subParser("hashBlock")("
\n"+f+"\n
",b,c)})}),e.subParser("codeBlocks",function(a,b,c){return a+="~0",a=a.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(a,d,f){var g=d,h=f;return g=e.subParser("outdent")(g),g=e.subParser("encodeCode")(g),g=e.subParser("detab")(g),g=g.replace(/^\n+/g,""),g=g.replace(/\n+$/g,""),g="
"+g+"\n
",e.subParser("hashBlock")(g,b,c)+h}),a=a.replace(/~0/,"")}),e.subParser("codeSpans",function(a){return a=a.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(a,b,c,d){var f=d;return f=f.replace(/^([ \t]*)/g,""),f=f.replace(/[ \t]*$/g,""),f=e.subParser("encodeCode")(f),b+""+f+""})}),e.subParser("detab",function(a){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,"")}),e.subParser("encodeAmpsAndAngles",function(a){return a=a.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),a=a.replace(/<(?![a-z\/?\$!])/gi,"<")}),e.subParser("encodeBackslashEscapes",function(a){return a=a.replace(/\\(\\)/g,e.helper.escapeCharactersCallback),a=a.replace(/\\([`*_{}\[\]()>#+-.!])/g,e.helper.escapeCharactersCallback)}),e.subParser("encodeCode",function(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=e.helper.escapeCharacters(a,"*_{}[]\\",!1)}),e.subParser("encodeEmailAddress",function(a){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,'">')}),e.subParser("escapeSpecialCharsWithinTagAttributes",function(a){var b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi;return a=a.replace(b,function(a){var b=a.replace(/(.)<\/?code>(?=.)/g,"$1`");return b=e.helper.escapeCharacters(b,"\\`*_")})}),e.subParser("githubCodeBlocks",function(a,b,c){return a+="~0",a=a.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(a,d,f){var g=d,h=f,i="\n";return b.omitExtraWLInCodeBlocks&&(i=""),h=e.subParser("encodeCode")(h),h=e.subParser("detab")(h),h=h.replace(/^\n+/g,""),h=h.replace(/\n+$/g,""),h="
"+h+i+"
",e.subParser("hashBlock")(h,b,c)}),a=a.replace(/~0/,"")}),e.subParser("hashBlock",function(a,b,c){return a=a.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(c.gHtmlBlocks.push(a)-1)+"K\n\n"}),e.subParser("hashElement",function(a,b,c){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"}}),e.subParser("hashHTMLBlocks",function(a,b,c){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,e.subParser("hashElement")(a,b,c)),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)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,e.subParser("hashElement")(a,b,c)),a=a.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,e.subParser("hashElement")(a,b,c)),a=a.replace(/(\n\n[ ]{0,3}[ \t]*(?=\n{2,}))/g,e.subParser("hashElement")(a,b,c)),a=a.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,e.subParser("hashElement")(a,b,c)),a=a.replace(/\n\n/g,"\n")}),e.subParser("headers",function(a,b,c){function d(a){return a.replace(/[^\w]/g,"").toLowerCase()}return a=a.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(a,f){return e.subParser("hashBlock")('

'+e.subParser("spanGamut")(f,b,c)+"

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

'+e.subParser("spanGamut")(f,b,c)+"

",b,c)}),a=a.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(a,f,g){var h=e.subParser("spanGamut")(g,b,c),i="'+h+"";return e.subParser("hashBlock")(i,b,c)})}),e.subParser("images",function(a,b,c){var d=function(a,b,d,f,g,h,j,k){a=b;var l=d,m=f.toLowerCase(),n=g,o=k,p=c.gUrls,q=c.gTitles;if(o||(o=""),""===n||null===n){if((""===m||null===m)&&(m=l.toLowerCase().replace(/ ?\n/g," ")),n="#"+m,"undefined"==typeof p[m])return a;n=p[m],"undefined"!=typeof q[m]&&(o=q[m])}l=l.replace(/"/g,"""),n=e.helper.escapeCharacters(n,"*_");var r=''+l+'?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,d)}),e.subParser("italicsAndBold",function(a){return a=a.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2"),a=a.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2")}),e.subParser("lists",function(a,b,c){var d=function(a){return c.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,d,f,g,h){var i=e.subParser("outdent")(h,b,c);return d||i.search(/\n{2,}/)>-1?i=e.subParser("blockGamut")(i,b,c):(i=e.subParser("lists")(i,b,c),i=i.replace(/\n$/,""),i=e.subParser("spanGamut")(i,b,c)),"
  • "+i+"
  • \n"}),a=a.replace(/~0/g,""),c.gListLevel--,a};a+="~0";var f=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return c.gListLevel?a=a.replace(f,function(a,b,c){var e=b,f=c.search(/[*+-]/g)>-1?"ul":"ol";e=e.replace(/\n{2,}/g,"\n\n\n");var g=d(e);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,e){var f=c.replace(/\n{2,}/g,"\n\n\n"),g=e.search(/[*+-]/g)>-1?"ul":"ol",h=d(f);return b+"<"+g+">\n"+h+"\n"})),a=a.replace(/~0/,"")}),e.subParser("outdent",function(a){return a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,"")}),e.subParser("paragraphs",function(a,b,c){a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");for(var d=a.split(/\n{2,}/g),f=[],g=d.length,h=0;g>h;h++){var i=d[h];i.search(/~K(\d+)K/g)>=0?f.push(i):i.search(/\S/)>=0&&(i=e.subParser("spanGamut")(i,b,c),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=c.gHtmlBlocks[RegExp.$1];j=j.replace(/\$/g,"$$$$"),f[h]=f[h].replace(/~K\d+K/,j)}return f.join("\n\n")}),e.subParser("spanGamut",function(a,b,c){return a=e.subParser("codeSpans")(a,b,c),a=e.subParser("escapeSpecialCharsWithinTagAttributes")(a,b,c),a=e.subParser("encodeBackslashEscapes")(a,b,c),a=e.subParser("images")(a,b,c),a=e.subParser("anchors")(a,b,c),a=e.subParser("autoLinks")(a,b,c),a=e.subParser("encodeAmpsAndAngles")(a,b,c),a=e.subParser("italicsAndBold")(a,b,c),a=a.replace(/ +\n/g,"
    \n")}),e.subParser("stripBlankLines",function(a){return a.replace(/^[ \t]+$/gm,"")}),e.subParser("stripLinkDefinitions",function(a,b,c){return a+="~0",a=a.replace(/^[ ]{0,3}\[(.+)]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|(?=~0))/gm,function(a,b,d,f,g){return b=b.toLowerCase(),c.gUrls[b]=e.subParser("encodeAmpsAndAngles")(d),f?f+g:(g&&(c.gTitles[b]=g.replace(/"/g,""")),"")}),a=a.replace(/~0/,"")}),e.subParser("unescapeSpecialChars",function(a){return a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)})});var j=this;"undefined"!=typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define("showdown",function(){return e}):j.showdown=e}).call(this); //# sourceMappingURL=showdown.min.js.map