showdown.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
  2. return typeof e;
  3. } : function(e) {
  4. return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  5. };
  6. function getDefaultOpts(e) {
  7. var r = {
  8. omitExtraWLInCodeBlocks: {
  9. defaultValue: !1,
  10. describe: "Omit the default extra whiteline added to code blocks",
  11. type: "boolean"
  12. },
  13. noHeaderId: {
  14. defaultValue: !1,
  15. describe: "Turn on/off generated header id",
  16. type: "boolean"
  17. },
  18. prefixHeaderId: {
  19. defaultValue: !1,
  20. describe: "Specify a prefix to generated header ids",
  21. type: "string"
  22. },
  23. headerLevelStart: {
  24. defaultValue: !1,
  25. describe: "The header blocks level start",
  26. type: "integer"
  27. },
  28. parseImgDimensions: {
  29. defaultValue: !1,
  30. describe: "Turn on/off image dimension parsing",
  31. type: "boolean"
  32. },
  33. simplifiedAutoLink: {
  34. defaultValue: !1,
  35. describe: "Turn on/off GFM autolink style",
  36. type: "boolean"
  37. },
  38. literalMidWordUnderscores: {
  39. defaultValue: !1,
  40. describe: "Parse midword underscores as literal underscores",
  41. type: "boolean"
  42. },
  43. strikethrough: {
  44. defaultValue: !1,
  45. describe: "Turn on/off strikethrough support",
  46. type: "boolean"
  47. },
  48. tables: {
  49. defaultValue: !1,
  50. describe: "Turn on/off tables support",
  51. type: "boolean"
  52. },
  53. tablesHeaderId: {
  54. defaultValue: !1,
  55. describe: "Add an id to table headers",
  56. type: "boolean"
  57. },
  58. ghCodeBlocks: {
  59. defaultValue: !0,
  60. describe: "Turn on/off GFM fenced code blocks support",
  61. type: "boolean"
  62. },
  63. tasklists: {
  64. defaultValue: !1,
  65. describe: "Turn on/off GFM tasklist support",
  66. type: "boolean"
  67. },
  68. smoothLivePreview: {
  69. defaultValue: !1,
  70. describe: "Prevents weird effects in live previews due to incomplete input",
  71. type: "boolean"
  72. },
  73. smartIndentationFix: {
  74. defaultValue: !1,
  75. description: "Tries to smartly fix identation in es6 strings",
  76. type: "boolean"
  77. }
  78. };
  79. if (!1 === e) return JSON.parse(JSON.stringify(r));
  80. var n = {};
  81. for (var t in r) r.hasOwnProperty(t) && (n[t] = r[t].defaultValue);
  82. return n;
  83. }
  84. var showdown = {}, parsers = {}, extensions = {}, globalOptions = getDefaultOpts(!0), flavor = {
  85. github: {
  86. omitExtraWLInCodeBlocks: !0,
  87. prefixHeaderId: "user-content-",
  88. simplifiedAutoLink: !0,
  89. literalMidWordUnderscores: !0,
  90. strikethrough: !0,
  91. tables: !0,
  92. tablesHeaderId: !0,
  93. ghCodeBlocks: !0,
  94. tasklists: !0
  95. },
  96. vanilla: getDefaultOpts(!0)
  97. };
  98. function validate(e, r) {
  99. var n = r ? "Error in " + r + " extension->" : "Error in unnamed extension", t = {
  100. valid: !0,
  101. error: ""
  102. };
  103. showdown.helper.isArray(e) || (e = [ e ]);
  104. for (var o = 0; o < e.length; ++o) {
  105. var s = n + " sub-extension " + o + ": ", a = e[o];
  106. if ("object" !== (void 0 === a ? "undefined" : _typeof(a))) return t.valid = !1,
  107. t.error = s + "must be an object, but " + (void 0 === a ? "undefined" : _typeof(a)) + " given",
  108. t;
  109. if (!showdown.helper.isString(a.type)) return t.valid = !1, t.error = s + 'property "type" must be a string, but ' + _typeof(a.type) + " given",
  110. t;
  111. var i = a.type = a.type.toLowerCase();
  112. if ("language" === i && (i = a.type = "lang"), "html" === i && (i = a.type = "output"),
  113. "lang" !== i && "output" !== i && "listener" !== i) return t.valid = !1, t.error = s + "type " + i + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"',
  114. t;
  115. if ("listener" === i) {
  116. if (showdown.helper.isUndefined(a.listeners)) return t.valid = !1, t.error = s + '. Extensions of type "listener" must have a property called "listeners"',
  117. t;
  118. } else if (showdown.helper.isUndefined(a.filter) && showdown.helper.isUndefined(a.regex)) return t.valid = !1,
  119. t.error = s + i + ' extensions must define either a "regex" property or a "filter" method',
  120. t;
  121. if (a.listeners) {
  122. if ("object" !== _typeof(a.listeners)) return t.valid = !1, t.error = s + '"listeners" property must be an object but ' + _typeof(a.listeners) + " given",
  123. t;
  124. for (var l in a.listeners) if (a.listeners.hasOwnProperty(l) && "function" != typeof a.listeners[l]) return t.valid = !1,
  125. t.error = s + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + l + " must be a function but " + _typeof(a.listeners[l]) + " given",
  126. t;
  127. }
  128. if (a.filter) {
  129. if ("function" != typeof a.filter) return t.valid = !1, t.error = s + '"filter" must be a function, but ' + _typeof(a.filter) + " given",
  130. t;
  131. } else if (a.regex) {
  132. if (showdown.helper.isString(a.regex) && (a.regex = new RegExp(a.regex, "g")), !a.regex instanceof RegExp) return t.valid = !1,
  133. t.error = s + '"regex" property must either be a string or a RegExp object, but ' + _typeof(a.regex) + " given",
  134. t;
  135. if (showdown.helper.isUndefined(a.replace)) return t.valid = !1, t.error = s + '"regex" extensions must implement a replace string or function',
  136. t;
  137. }
  138. }
  139. return t;
  140. }
  141. function escapeCharactersCallback(e, r) {
  142. return "~E" + r.charCodeAt(0) + "E";
  143. }
  144. showdown.helper = {}, showdown.extensions = {}, showdown.setOption = function(e, r) {
  145. return globalOptions[e] = r, this;
  146. }, showdown.getOption = function(e) {
  147. return globalOptions[e];
  148. }, showdown.getOptions = function() {
  149. return globalOptions;
  150. }, showdown.resetOptions = function() {
  151. globalOptions = getDefaultOpts(!0);
  152. }, showdown.setFlavor = function(e) {
  153. if (flavor.hasOwnProperty(e)) {
  154. var r = flavor[e];
  155. for (var n in r) r.hasOwnProperty(n) && (globalOptions[n] = r[n]);
  156. }
  157. }, showdown.getDefaultOptions = function(e) {
  158. return getDefaultOpts(e);
  159. }, showdown.subParser = function(e, r) {
  160. if (showdown.helper.isString(e)) {
  161. if (void 0 === r) {
  162. if (parsers.hasOwnProperty(e)) return parsers[e];
  163. throw Error("SubParser named " + e + " not registered!");
  164. }
  165. parsers[e] = r;
  166. }
  167. }, showdown.extension = function(e, r) {
  168. if (!showdown.helper.isString(e)) throw Error("Extension 'name' must be a string");
  169. if (e = showdown.helper.stdExtName(e), showdown.helper.isUndefined(r)) {
  170. if (!extensions.hasOwnProperty(e)) throw Error("Extension named " + e + " is not registered!");
  171. return extensions[e];
  172. }
  173. "function" == typeof r && (r = r()), showdown.helper.isArray(r) || (r = [ r ]);
  174. var n = validate(r, e);
  175. if (!n.valid) throw Error(n.error);
  176. extensions[e] = r;
  177. }, showdown.getAllExtensions = function() {
  178. return extensions;
  179. }, showdown.removeExtension = function(e) {
  180. delete extensions[e];
  181. }, showdown.resetExtensions = function() {
  182. extensions = {};
  183. }, showdown.validateExtension = function(e) {
  184. var r = validate(e, null);
  185. return !!r.valid || (console.warn(r.error), !1);
  186. }, showdown.hasOwnProperty("helper") || (showdown.helper = {}), showdown.helper.isString = function(e) {
  187. return "string" == typeof e || e instanceof String;
  188. }, showdown.helper.isFunction = function(e) {
  189. return e && "[object Function]" === {}.toString.call(e);
  190. }, showdown.helper.forEach = function(e, r) {
  191. if ("function" == typeof e.forEach) e.forEach(r); else for (var n = 0; n < e.length; n++) r(e[n], n, e);
  192. }, showdown.helper.isArray = function(e) {
  193. return e.constructor === Array;
  194. }, showdown.helper.isUndefined = function(e) {
  195. return void 0 === e;
  196. }, showdown.helper.stdExtName = function(e) {
  197. return e.replace(/[_-]||\s/g, "").toLowerCase();
  198. }, showdown.helper.escapeCharactersCallback = escapeCharactersCallback, showdown.helper.escapeCharacters = function(e, r, n) {
  199. var t = "([" + r.replace(/([\[\]\\])/g, "\\$1") + "])";
  200. n && (t = "\\\\" + t);
  201. var o = new RegExp(t, "g");
  202. return e = e.replace(o, escapeCharactersCallback);
  203. };
  204. var rgxFindMatchPos = function(e, r, n, t) {
  205. var o, s, a, i, l, c = t || "", h = -1 < c.indexOf("g"), d = new RegExp(r + "|" + n, "g" + c.replace(/g/g, "")), u = new RegExp(r, c.replace(/g/g, "")), p = [];
  206. do {
  207. for (o = 0; a = d.exec(e); ) if (u.test(a[0])) o++ || (i = (s = d.lastIndex) - a[0].length); else if (o && !--o) {
  208. l = a.index + a[0].length;
  209. var w = {
  210. left: {
  211. start: i,
  212. end: s
  213. },
  214. match: {
  215. start: s,
  216. end: a.index
  217. },
  218. right: {
  219. start: a.index,
  220. end: l
  221. },
  222. wholeMatch: {
  223. start: i,
  224. end: l
  225. }
  226. };
  227. if (p.push(w), !h) return p;
  228. }
  229. } while (o && (d.lastIndex = s));
  230. return p;
  231. };
  232. showdown.helper.matchRecursiveRegExp = function(e, r, n, t) {
  233. for (var o = rgxFindMatchPos(e, r, n, t), s = [], a = 0; a < o.length; ++a) s.push([ e.slice(o[a].wholeMatch.start, o[a].wholeMatch.end), e.slice(o[a].match.start, o[a].match.end), e.slice(o[a].left.start, o[a].left.end), e.slice(o[a].right.start, o[a].right.end) ]);
  234. return s;
  235. }, showdown.helper.replaceRecursiveRegExp = function(e, r, n, t, o) {
  236. if (!showdown.helper.isFunction(r)) {
  237. var s = r;
  238. r = function() {
  239. return s;
  240. };
  241. }
  242. var a = rgxFindMatchPos(e, n, t, o), i = e, l = a.length;
  243. if (0 < l) {
  244. var c = [];
  245. 0 !== a[0].wholeMatch.start && c.push(e.slice(0, a[0].wholeMatch.start));
  246. for (var h = 0; h < l; ++h) c.push(r(e.slice(a[h].wholeMatch.start, a[h].wholeMatch.end), e.slice(a[h].match.start, a[h].match.end), e.slice(a[h].left.start, a[h].left.end), e.slice(a[h].right.start, a[h].right.end))),
  247. h < l - 1 && c.push(e.slice(a[h].wholeMatch.end, a[h + 1].wholeMatch.start));
  248. a[l - 1].wholeMatch.end < e.length && c.push(e.slice(a[l - 1].wholeMatch.end)),
  249. i = c.join("");
  250. }
  251. return i;
  252. }, showdown.helper.isUndefined(console) && (console = {
  253. warn: function(e) {
  254. alert(e);
  255. },
  256. log: function(e) {
  257. alert(e);
  258. },
  259. error: function(e) {
  260. throw e;
  261. }
  262. }), showdown.Converter = function(n) {
  263. var s = {}, a = [], i = [], l = {};
  264. function t(e, r) {
  265. if (r = r || null, showdown.helper.isString(e)) {
  266. if (r = e = showdown.helper.stdExtName(e), showdown.extensions[e]) return console.warn("DEPRECATION WARNING: " + e + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),
  267. void function(e, r) {
  268. "function" == typeof e && (e = e(new showdown.Converter()));
  269. showdown.helper.isArray(e) || (e = [ e ]);
  270. var n = validate(e, r);
  271. if (!n.valid) throw Error(n.error);
  272. for (var t = 0; t < e.length; ++t) switch (e[t].type) {
  273. case "lang":
  274. a.push(e[t]);
  275. break;
  276. case "output":
  277. i.push(e[t]);
  278. break;
  279. default:
  280. throw Error("Extension loader error: Type unrecognized!!!");
  281. }
  282. }(showdown.extensions[e], e);
  283. if (showdown.helper.isUndefined(extensions[e])) throw Error('Extension "' + e + '" could not be loaded. It was either not found or is not a valid extension.');
  284. e = extensions[e];
  285. }
  286. "function" == typeof e && (e = e()), showdown.helper.isArray(e) || (e = [ e ]);
  287. var n = validate(e, r);
  288. if (!n.valid) throw Error(n.error);
  289. for (var t = 0; t < e.length; ++t) {
  290. switch (e[t].type) {
  291. case "lang":
  292. a.push(e[t]);
  293. break;
  294. case "output":
  295. i.push(e[t]);
  296. }
  297. if (e[t].hasOwnProperty(l)) for (var o in e[t].listeners) e[t].listeners.hasOwnProperty(o) && c(o, e[t].listeners[o]);
  298. }
  299. }
  300. function c(e, r) {
  301. if (!showdown.helper.isString(e)) throw Error("Invalid argument in converter.listen() method: name must be a string, but " + (void 0 === e ? "undefined" : _typeof(e)) + " given");
  302. if ("function" != typeof r) throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + (void 0 === r ? "undefined" : _typeof(r)) + " given");
  303. l.hasOwnProperty(e) || (l[e] = []), l[e].push(r);
  304. }
  305. !function() {
  306. for (var e in n = n || {}, globalOptions) globalOptions.hasOwnProperty(e) && (s[e] = globalOptions[e]);
  307. {
  308. if ("object" !== (void 0 === n ? "undefined" : _typeof(n))) throw Error("Converter expects the passed parameter to be an object, but " + (void 0 === n ? "undefined" : _typeof(n)) + " was passed instead.");
  309. for (var r in n) n.hasOwnProperty(r) && (s[r] = n[r]);
  310. }
  311. s.extensions && showdown.helper.forEach(s.extensions, t);
  312. }(), this._dispatch = function(e, r, n, t) {
  313. if (l.hasOwnProperty(e)) for (var o = 0; o < l[e].length; ++o) {
  314. var s = l[e][o](e, r, this, n, t);
  315. s && void 0 !== s && (r = s);
  316. }
  317. return r;
  318. }, this.listen = function(e, r) {
  319. return c(e, r), this;
  320. }, this.makeHtml = function(r) {
  321. if (!r) return r;
  322. var e, n, t, o = {
  323. gHtmlBlocks: [],
  324. gHtmlMdBlocks: [],
  325. gHtmlSpans: [],
  326. gUrls: {},
  327. gTitles: {},
  328. gDimensions: {},
  329. gListLevel: 0,
  330. hashLinkCounts: {},
  331. langExtensions: a,
  332. outputModifiers: i,
  333. converter: this,
  334. ghCodeBlocks: []
  335. };
  336. return r = (r = (r = (r = r.replace(/~/g, "~T")).replace(/\$/g, "~D")).replace(/\r\n/g, "\n")).replace(/\r/g, "\n"),
  337. s.smartIndentationFix && (n = (e = r).match(/^\s*/)[0].length, t = new RegExp("^\\s{0," + n + "}", "gm"),
  338. r = e.replace(t, "")), r = r, r = showdown.subParser("detab")(r, s, o), r = showdown.subParser("stripBlankLines")(r, s, o),
  339. showdown.helper.forEach(a, function(e) {
  340. r = showdown.subParser("runExtension")(e, r, s, o);
  341. }), r = showdown.subParser("hashPreCodeTags")(r, s, o), r = showdown.subParser("githubCodeBlocks")(r, s, o),
  342. r = showdown.subParser("hashHTMLBlocks")(r, s, o), r = showdown.subParser("hashHTMLSpans")(r, s, o),
  343. r = showdown.subParser("stripLinkDefinitions")(r, s, o), r = showdown.subParser("blockGamut")(r, s, o),
  344. r = showdown.subParser("unhashHTMLSpans")(r, s, o), r = (r = (r = showdown.subParser("unescapeSpecialChars")(r, s, o)).replace(/~D/g, "$$")).replace(/~T/g, "~"),
  345. showdown.helper.forEach(i, function(e) {
  346. r = showdown.subParser("runExtension")(e, r, s, o);
  347. }), r;
  348. }, this.setOption = function(e, r) {
  349. s[e] = r;
  350. }, this.getOption = function(e) {
  351. return s[e];
  352. }, this.getOptions = function() {
  353. return s;
  354. }, this.addExtension = function(e, r) {
  355. t(e, r = r || null);
  356. }, this.useExtension = function(e) {
  357. t(e);
  358. }, this.setFlavor = function(e) {
  359. if (flavor.hasOwnProperty(e)) {
  360. var r = flavor[e];
  361. for (var n in r) r.hasOwnProperty(n) && (s[n] = r[n]);
  362. }
  363. }, this.removeExtension = function(e) {
  364. showdown.helper.isArray(e) || (e = [ e ]);
  365. for (var r = 0; r < e.length; ++r) {
  366. for (var n = e[r], t = 0; t < a.length; ++t) a[t] === n && a[t].splice(t, 1);
  367. for (;0 < i.length; ++t) i[0] === n && i[0].splice(t, 1);
  368. }
  369. }, this.getAllExtensions = function() {
  370. return {
  371. language: a,
  372. output: i
  373. };
  374. };
  375. }, showdown.subParser("anchors", function(e, r, p) {
  376. var n = function(e, r, n, t, o, s, a, i) {
  377. showdown.helper.isUndefined(i) && (i = ""), e = r;
  378. var l = n, c = t.toLowerCase(), h = o, d = i;
  379. if (!h) if (c || (c = l.toLowerCase().replace(/ ?\n/g, " ")), h = "#" + c, showdown.helper.isUndefined(p.gUrls[c])) {
  380. if (!(-1 < e.search(/\(\s*\)$/m))) return e;
  381. h = "";
  382. } else h = p.gUrls[c], showdown.helper.isUndefined(p.gTitles[c]) || (d = p.gTitles[c]);
  383. var u = '<a href="' + (h = showdown.helper.escapeCharacters(h, "*_", !1)) + '"';
  384. return "" !== d && null !== d && (d = d.replace(/"/g, "&quot;"), u += ' title="' + (d = showdown.helper.escapeCharacters(d, "*_", !1)) + '"'),
  385. u += ">" + l + "</a>";
  386. };
  387. return e = (e = (e = (e = p.converter._dispatch("anchors.before", e, r, p)).replace(/(\[((?:\[[^\]]*]|[^\[\]])*)][ ]?(?:\n[ ]*)?\[(.*?)])()()()()/g, n)).replace(/(\[((?:\[[^\]]*]|[^\[\]])*)]\([ \t]*()<?(.*?(?:\(.*?\).*?)?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, n)).replace(/(\[([^\[\]]+)])()()()()()/g, n),
  388. e = p.converter._dispatch("anchors.after", e, r, p);
  389. }), showdown.subParser("autoLinks", function(e, r, n) {
  390. function t(e, r) {
  391. var n = r;
  392. return /^www\./i.test(r) && (r = r.replace(/^www\./i, "http://www.")), '<a href="' + r + '">' + n + "</a>";
  393. }
  394. function o(e, r) {
  395. var n = showdown.subParser("unescapeSpecialChars")(r);
  396. return showdown.subParser("encodeEmailAddress")(n);
  397. }
  398. return e = (e = (e = n.converter._dispatch("autoLinks.before", e, r, n)).replace(/<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)>/gi, t)).replace(/<(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, o),
  399. r.simplifiedAutoLink && (e = (e = e.replace(/\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+)(?=\s|$)(?!["<>])/gi, t)).replace(/(?:^|[ \n\t])([A-Za-z0-9!#$%&'*+-/=?^_`\{|}~\.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?:$|[ \n\t])/gi, o)),
  400. e = n.converter._dispatch("autoLinks.after", e, r, n);
  401. }), showdown.subParser("blockGamut", function(e, r, n) {
  402. e = n.converter._dispatch("blockGamut.before", e, r, n), e = showdown.subParser("blockQuotes")(e, r, n),
  403. e = showdown.subParser("headers")(e, r, n);
  404. var t = showdown.subParser("hashBlock")("<hr />", r, n);
  405. return e = (e = (e = e.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm, t)).replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm, t)).replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, t),
  406. e = showdown.subParser("lists")(e, r, n), e = showdown.subParser("codeBlocks")(e, r, n),
  407. e = showdown.subParser("tables")(e, r, n), e = showdown.subParser("hashHTMLBlocks")(e, r, n),
  408. e = showdown.subParser("paragraphs")(e, r, n), e = n.converter._dispatch("blockGamut.after", e, r, n);
  409. }), showdown.subParser("blockQuotes", function(e, t, o) {
  410. return e = (e = o.converter._dispatch("blockQuotes.before", e, t, o)).replace(/((^[ \t]{0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm, function(e, r) {
  411. var n = r;
  412. return n = (n = (n = n.replace(/^[ \t]*>[ \t]?/gm, "~0")).replace(/~0/g, "")).replace(/^[ \t]+$/gm, ""),
  413. n = showdown.subParser("githubCodeBlocks")(n, t, o), n = (n = (n = showdown.subParser("blockGamut")(n, t, o)).replace(/(^|\n)/g, "$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(e, r) {
  414. var n = r;
  415. return n = (n = n.replace(/^ /gm, "~0")).replace(/~0/g, "");
  416. }), showdown.subParser("hashBlock")("<blockquote>\n" + n + "\n</blockquote>", t, o);
  417. }), e = o.converter._dispatch("blockQuotes.after", e, t, o);
  418. }), showdown.subParser("codeBlocks", function(e, a, i) {
  419. e = i.converter._dispatch("codeBlocks.before", e, a, i);
  420. return e = (e = (e += "~0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g, function(e, r, n) {
  421. var t = r, o = n, s = "\n";
  422. return t = showdown.subParser("outdent")(t), t = showdown.subParser("encodeCode")(t),
  423. t = (t = (t = showdown.subParser("detab")(t)).replace(/^\n+/g, "")).replace(/\n+$/g, ""),
  424. a.omitExtraWLInCodeBlocks && (s = ""), t = "<pre><code>" + t + s + "</code></pre>",
  425. showdown.subParser("hashBlock")(t, a, i) + o;
  426. })).replace(/~0/, ""), e = i.converter._dispatch("codeBlocks.after", e, a, i);
  427. }), showdown.subParser("codeSpans", function(e, r, n) {
  428. return void 0 === (e = n.converter._dispatch("codeSpans.before", e, r, n)) && (e = ""),
  429. e = e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(e, r, n, t) {
  430. var o = t;
  431. return o = (o = o.replace(/^([ \t]*)/g, "")).replace(/[ \t]*$/g, ""), r + "<code>" + (o = showdown.subParser("encodeCode")(o)) + "</code>";
  432. }), e = n.converter._dispatch("codeSpans.after", e, r, n);
  433. }), showdown.subParser("detab", function(e) {
  434. return e = (e = (e = (e = (e = e.replace(/\t(?=\t)/g, " ")).replace(/\t/g, "~A~B")).replace(/~B(.+?)~A/g, function(e, r) {
  435. for (var n = r, t = 4 - n.length % 4, o = 0; o < t; o++) n += " ";
  436. return n;
  437. })).replace(/~A/g, " ")).replace(/~B/g, "");
  438. }), showdown.subParser("encodeAmpsAndAngles", function(e) {
  439. return e = (e = e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;")).replace(/<(?![a-z\/?\$!])/gi, "&lt;");
  440. }), showdown.subParser("encodeBackslashEscapes", function(e) {
  441. return e = (e = e.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+-.!])/g, showdown.helper.escapeCharactersCallback);
  442. }), showdown.subParser("encodeCode", function(e) {
  443. return e = (e = (e = e.replace(/&/g, "&amp;")).replace(/</g, "&lt;")).replace(/>/g, "&gt;"),
  444. e = showdown.helper.escapeCharacters(e, "*_{}[]\\", !1);
  445. }), showdown.subParser("encodeEmailAddress", function(e) {
  446. var n = [ function(e) {
  447. return "&#" + e.charCodeAt(0) + ";";
  448. }, function(e) {
  449. return "&#x" + e.charCodeAt(0).toString(16) + ";";
  450. }, function(e) {
  451. return e;
  452. } ];
  453. return e = (e = '<a href="' + (e = (e = "mailto:" + e).replace(/./g, function(e) {
  454. if ("@" === e) e = n[Math.floor(2 * Math.random())](e); else if (":" !== e) {
  455. var r = Math.random();
  456. e = .9 < r ? n[2](e) : .45 < r ? n[1](e) : n[0](e);
  457. }
  458. return e;
  459. })) + '">' + e + "</a>").replace(/">.+:/g, '">');
  460. }), showdown.subParser("escapeSpecialCharsWithinTagAttributes", function(e) {
  461. return e = e.replace(/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi, function(e) {
  462. var r = e.replace(/(.)<\/?code>(?=.)/g, "$1`");
  463. return r = showdown.helper.escapeCharacters(r, "\\`*_", !1);
  464. });
  465. }), showdown.subParser("githubCodeBlocks", function(e, o, s) {
  466. return o.ghCodeBlocks ? (e = s.converter._dispatch("githubCodeBlocks.before", e, o, s),
  467. e = (e = (e += "~0").replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g, function(e, r, n) {
  468. var t = o.omitExtraWLInCodeBlocks ? "" : "\n";
  469. return n = showdown.subParser("encodeCode")(n), n = "<pre><code" + (r ? ' class="' + r + " language-" + r + '"' : "") + ">" + (n = (n = (n = showdown.subParser("detab")(n)).replace(/^\n+/g, "")).replace(/\n+$/g, "")) + t + "</code></pre>",
  470. n = showdown.subParser("hashBlock")(n, o, s), "\n\n~G" + (s.ghCodeBlocks.push({
  471. text: e,
  472. codeblock: n
  473. }) - 1) + "G\n\n";
  474. })).replace(/~0/, ""), s.converter._dispatch("githubCodeBlocks.after", e, o, s)) : e;
  475. }), showdown.subParser("hashBlock", function(e, r, n) {
  476. return e = e.replace(/(^\n+|\n+$)/g, ""), "\n\n~K" + (n.gHtmlBlocks.push(e) - 1) + "K\n\n";
  477. }), showdown.subParser("hashElement", function(e, r, t) {
  478. return function(e, r) {
  479. var n = r;
  480. return n = (n = (n = n.replace(/\n\n/g, "\n")).replace(/^\n/, "")).replace(/\n+$/g, ""),
  481. n = "\n\n~K" + (t.gHtmlBlocks.push(n) - 1) + "K\n\n";
  482. };
  483. }), showdown.subParser("hashHTMLBlocks", function(e, r, s) {
  484. for (var n = [ "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" ], t = function(e, r, n, t) {
  485. var o = e;
  486. return -1 !== n.search(/\bmarkdown\b/) && (o = n + s.converter.makeHtml(r) + t),
  487. "\n\n~K" + (s.gHtmlBlocks.push(o) - 1) + "K\n\n";
  488. }, o = 0; o < n.length; ++o) e = showdown.helper.replaceRecursiveRegExp(e, t, "^(?: |\\t){0,3}<" + n[o] + "\\b[^>]*>", "</" + n[o] + ">", "gim");
  489. return e = (e = (e = e.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, showdown.subParser("hashElement")(e, r, s))).replace(/(<!--[\s\S]*?-->)/g, showdown.subParser("hashElement")(e, r, s))).replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, showdown.subParser("hashElement")(e, r, s));
  490. }), showdown.subParser("hashHTMLSpans", function(e, r, n) {
  491. for (var t = showdown.helper.matchRecursiveRegExp(e, "<code\\b[^>]*>", "</code>", "gi"), o = 0; o < t.length; ++o) e = e.replace(t[o][0], "~L" + (n.gHtmlSpans.push(t[o][0]) - 1) + "L");
  492. return e;
  493. }), showdown.subParser("unhashHTMLSpans", function(e, r, n) {
  494. for (var t = 0; t < n.gHtmlSpans.length; ++t) e = e.replace("~L" + t + "L", n.gHtmlSpans[t]);
  495. return e;
  496. }), showdown.subParser("hashPreCodeTags", function(e, r, s) {
  497. return e = showdown.helper.replaceRecursiveRegExp(e, function(e, r, n, t) {
  498. var o = n + showdown.subParser("encodeCode")(r) + t;
  499. return "\n\n~G" + (s.ghCodeBlocks.push({
  500. text: e,
  501. codeblock: o
  502. }) - 1) + "G\n\n";
  503. }, "^(?: |\\t){0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>", "^(?: |\\t){0,3}</code>\\s*</pre>", "gim");
  504. }), showdown.subParser("headers", function(e, i, l) {
  505. e = l.converter._dispatch("headers.before", e, i, l);
  506. var t = i.prefixHeaderId, c = isNaN(parseInt(i.headerLevelStart)) ? 1 : parseInt(i.headerLevelStart), r = i.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, n = i.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
  507. function h(e) {
  508. var r, n = e.replace(/[^\w]/g, "").toLowerCase();
  509. return l.hashLinkCounts[n] ? r = n + "-" + l.hashLinkCounts[n]++ : (r = n, l.hashLinkCounts[n] = 1),
  510. !0 === t && (t = "section"), showdown.helper.isString(t) ? t + r : r;
  511. }
  512. return e = (e = (e = e.replace(r, function(e, r) {
  513. var n = showdown.subParser("spanGamut")(r, i, l), t = i.noHeaderId ? "" : ' id="' + h(r) + '"', o = "<h" + c + t + ">" + n + "</h" + c + ">";
  514. return showdown.subParser("hashBlock")(o, i, l);
  515. })).replace(n, function(e, r) {
  516. var n = showdown.subParser("spanGamut")(r, i, l), t = i.noHeaderId ? "" : ' id="' + h(r) + '"', o = c + 1, s = "<h" + o + t + ">" + n + "</h" + o + ">";
  517. return showdown.subParser("hashBlock")(s, i, l);
  518. })).replace(/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm, function(e, r, n) {
  519. var t = showdown.subParser("spanGamut")(n, i, l), o = i.noHeaderId ? "" : ' id="' + h(n) + '"', s = c - 1 + r.length, a = "<h" + s + o + ">" + t + "</h" + s + ">";
  520. return showdown.subParser("hashBlock")(a, i, l);
  521. }), e = l.converter._dispatch("headers.after", e, i, l);
  522. }), showdown.subParser("images", function(e, r, u) {
  523. function n(e, r, n, t, o, s, a, i) {
  524. var l = u.gUrls, c = u.gTitles, h = u.gDimensions;
  525. if (n = n.toLowerCase(), i || (i = ""), "" === t || null === t) {
  526. if ("" !== n && null !== n || (n = r.toLowerCase().replace(/ ?\n/g, " ")), t = "#" + n,
  527. showdown.helper.isUndefined(l[n])) return e;
  528. t = l[n], showdown.helper.isUndefined(c[n]) || (i = c[n]), showdown.helper.isUndefined(h[n]) || (o = h[n].width,
  529. s = h[n].height);
  530. }
  531. r = r.replace(/"/g, "&quot;"), r = showdown.helper.escapeCharacters(r, "*_", !1);
  532. var d = '<img src="' + (t = showdown.helper.escapeCharacters(t, "*_", !1)) + '" alt="' + r + '"';
  533. return i && (i = i.replace(/"/g, "&quot;"), d += ' title="' + (i = showdown.helper.escapeCharacters(i, "*_", !1)) + '"'),
  534. o && s && (d += ' width="' + (o = "*" === o ? "auto" : o) + '"', d += ' height="' + (s = "*" === s ? "auto" : s) + '"'),
  535. d += " />";
  536. }
  537. return e = (e = (e = u.converter._dispatch("images.before", e, r, u)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[(.*?)]()()()()()/g, n)).replace(/!\[(.*?)]\s?\([ \t]*()<?(\S+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(['"])(.*?)\6[ \t]*)?\)/g, n),
  538. e = u.converter._dispatch("images.after", e, r, u);
  539. }), showdown.subParser("italicsAndBold", function(e, r, n) {
  540. return e = n.converter._dispatch("italicsAndBold.before", e, r, n), e = r.literalMidWordUnderscores ? (e = (e = (e = e.replace(/(^|\s|>|\b)__(?=\S)([\s\S]+?)__(?=\b|<|\s|$)/gm, "$1<strong>$2</strong>")).replace(/(^|\s|>|\b)_(?=\S)([\s\S]+?)_(?=\b|<|\s|$)/gm, "$1<em>$2</em>")).replace(/(\*\*)(?=\S)([^\r]*?\S[*]*)\1/g, "<strong>$2</strong>")).replace(/(\*)(?=\S)([^\r]*?\S)\1/g, "<em>$2</em>") : (e = e.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, "<strong>$2</strong>")).replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, "<em>$2</em>"),
  541. e = n.converter._dispatch("italicsAndBold.after", e, r, n);
  542. }), showdown.subParser("lists", function(e, h, d) {
  543. function i(e, r) {
  544. d.gListLevel++, e = e.replace(/\n{2,}$/, "\n");
  545. var c = /\n[ \t]*\n(?!~0)/.test(e += "~0");
  546. return e = (e = e.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm, function(e, r, n, t, o, s, a) {
  547. a = a && "" !== a.trim();
  548. var i = showdown.subParser("outdent")(o, h, d), l = "";
  549. return s && h.tasklists && (l = ' class="task-list-item" style="list-style-type: none;"',
  550. i = i.replace(/^[ \t]*\[(x|X| )?]/m, function() {
  551. var e = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
  552. return a && (e += " checked"), e += ">";
  553. })), r || -1 < i.search(/\n{2,}/) ? (i = showdown.subParser("githubCodeBlocks")(i, h, d),
  554. i = showdown.subParser("blockGamut")(i, h, d)) : (i = (i = showdown.subParser("lists")(i, h, d)).replace(/\n$/, ""),
  555. i = c ? showdown.subParser("paragraphs")(i, h, d) : showdown.subParser("spanGamut")(i, h, d)),
  556. i = "\n<li" + l + ">" + i + "</li>\n";
  557. })).replace(/~0/g, ""), d.gListLevel--, r && (e = e.replace(/\s+$/, "")), e;
  558. }
  559. function o(e, t, o) {
  560. var s = "ul" === t ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm, r = [], a = "";
  561. if (-1 !== e.search(s)) {
  562. !function e(r) {
  563. var n = r.search(s);
  564. -1 !== n ? (a += "\n\n<" + t + ">" + i(r.slice(0, n), !!o) + "</" + t + ">\n\n",
  565. s = "ul" === (t = "ul" === t ? "ol" : "ul") ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm,
  566. e(r.slice(n))) : a += "\n\n<" + t + ">" + i(r, !!o) + "</" + t + ">\n\n";
  567. }(e);
  568. for (var n = 0; n < r.length; ++n) ;
  569. } else a = "\n\n<" + t + ">" + i(e, !!o) + "</" + t + ">\n\n";
  570. return a;
  571. }
  572. e = d.converter._dispatch("lists.before", e, h, d), e += "~0";
  573. var r = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
  574. return d.gListLevel ? e = e.replace(r, function(e, r, n) {
  575. return o(r, -1 < n.search(/[*+-]/g) ? "ul" : "ol", !0);
  576. }) : (r = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
  577. e = e.replace(r, function(e, r, n, t) {
  578. return o(n, -1 < t.search(/[*+-]/g) ? "ul" : "ol");
  579. })), e = e.replace(/~0/, ""), e = d.converter._dispatch("lists.after", e, h, d);
  580. }), showdown.subParser("outdent", function(e) {
  581. return e = (e = e.replace(/^(\t|[ ]{1,4})/gm, "~0")).replace(/~0/g, "");
  582. }), showdown.subParser("paragraphs", function(e, r, n) {
  583. for (var t = (e = (e = (e = n.converter._dispatch("paragraphs.before", e, r, n)).replace(/^\n+/g, "")).replace(/\n+$/g, "")).split(/\n{2,}/g), o = [], s = t.length, a = 0; a < s; a++) {
  584. var i = t[a];
  585. 0 <= i.search(/~(K|G)(\d+)\1/g) || (i = (i = showdown.subParser("spanGamut")(i, r, n)).replace(/^([ \t]*)/g, "<p>"),
  586. i += "</p>"), o.push(i);
  587. }
  588. for (s = o.length, a = 0; a < s; a++) {
  589. for (var l = "", c = o[a], h = !1; 0 <= c.search(/~(K|G)(\d+)\1/); ) {
  590. var d = RegExp.$1, u = RegExp.$2;
  591. l = (l = "K" === d ? n.gHtmlBlocks[u] : h ? showdown.subParser("encodeCode")(n.ghCodeBlocks[u].text) : n.ghCodeBlocks[u].codeblock).replace(/\$/g, "$$$$"),
  592. c = c.replace(/(\n\n)?~(K|G)\d+\2(\n\n)?/, l), /^<pre\b[^>]*>\s*<code\b[^>]*>/.test(c) && (h = !0);
  593. }
  594. o[a] = c;
  595. }
  596. return e = (e = (e = o.join("\n\n")).replace(/^\n+/g, "")).replace(/\n+$/g, ""),
  597. n.converter._dispatch("paragraphs.after", e, r, n);
  598. }), showdown.subParser("runExtension", function(e, r, n, t) {
  599. if (e.filter) r = e.filter(r, t.converter, n); else if (e.regex) {
  600. var o = e.regex;
  601. !o instanceof RegExp && (o = new RegExp(o, "g")), r = r.replace(o, e.replace);
  602. }
  603. return r;
  604. }), showdown.subParser("spanGamut", function(e, r, n) {
  605. return e = n.converter._dispatch("spanGamut.before", e, r, n), e = showdown.subParser("codeSpans")(e, r, n),
  606. e = showdown.subParser("escapeSpecialCharsWithinTagAttributes")(e, r, n), e = showdown.subParser("encodeBackslashEscapes")(e, r, n),
  607. e = showdown.subParser("images")(e, r, n), e = showdown.subParser("anchors")(e, r, n),
  608. e = showdown.subParser("autoLinks")(e, r, n), e = showdown.subParser("encodeAmpsAndAngles")(e, r, n),
  609. e = showdown.subParser("italicsAndBold")(e, r, n), e = (e = showdown.subParser("strikethrough")(e, r, n)).replace(/ +\n/g, " <br />\n"),
  610. e = n.converter._dispatch("spanGamut.after", e, r, n);
  611. }), showdown.subParser("strikethrough", function(e, r, n) {
  612. return r.strikethrough && (e = (e = n.converter._dispatch("strikethrough.before", e, r, n)).replace(/(?:~T){2}([\s\S]+?)(?:~T){2}/g, "<del>$1</del>"),
  613. e = n.converter._dispatch("strikethrough.after", e, r, n)), e;
  614. }), showdown.subParser("stripBlankLines", function(e) {
  615. return e.replace(/^[ \t]+$/gm, "");
  616. }), showdown.subParser("stripLinkDefinitions", function(e, i, l) {
  617. return e = (e = (e += "~0").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+|(?=~0))/gm, function(e, r, n, t, o, s, a) {
  618. return r = r.toLowerCase(), l.gUrls[r] = showdown.subParser("encodeAmpsAndAngles")(n),
  619. s ? s + a : (a && (l.gTitles[r] = a.replace(/"|'/g, "&quot;")), i.parseImgDimensions && t && o && (l.gDimensions[r] = {
  620. width: t,
  621. height: o
  622. }), "");
  623. })).replace(/~0/, "");
  624. }), showdown.subParser("tables", function(e, g, b) {
  625. if (!g.tables) return e;
  626. return e = (e = b.converter._dispatch("tables.before", e, g, b)).replace(/^[ \t]{0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[\s\S]+?(?:\n\n|~0)/gm, function(e) {
  627. var r, n = e.split("\n");
  628. for (r = 0; r < n.length; ++r) /^[ \t]{0,3}\|/.test(n[r]) && (n[r] = n[r].replace(/^[ \t]{0,3}\|/, "")),
  629. /\|[ \t]*$/.test(n[r]) && (n[r] = n[r].replace(/\|[ \t]*$/, ""));
  630. var t, o, s, a, i, l = n[0].split("|").map(function(e) {
  631. return e.trim();
  632. }), c = n[1].split("|").map(function(e) {
  633. return e.trim();
  634. }), h = [], d = [], u = [], p = [];
  635. for (n.shift(), n.shift(), r = 0; r < n.length; ++r) "" !== n[r].trim() && h.push(n[r].split("|").map(function(e) {
  636. return e.trim();
  637. }));
  638. if (l.length < c.length) return e;
  639. for (r = 0; r < c.length; ++r) u.push((t = c[r], /^:[ \t]*--*$/.test(t) ? ' style="text-align:left;"' : /^--*[ \t]*:[ \t]*$/.test(t) ? ' style="text-align:right;"' : /^:[ \t]*--*[ \t]*:$/.test(t) ? ' style="text-align:center;"' : ""));
  640. for (r = 0; r < l.length; ++r) showdown.helper.isUndefined(u[r]) && (u[r] = ""),
  641. d.push((o = l[r], s = u[r], a = void 0, a = "", o = o.trim(), g.tableHeaderId && (a = ' id="' + o.replace(/ /g, "_").toLowerCase() + '"'),
  642. "<th" + a + s + ">" + (o = showdown.subParser("spanGamut")(o, g, b)) + "</th>\n"));
  643. for (r = 0; r < h.length; ++r) {
  644. for (var w = [], f = 0; f < d.length; ++f) showdown.helper.isUndefined(h[r][f]),
  645. w.push((i = h[r][f], "<td" + u[f] + ">" + showdown.subParser("spanGamut")(i, g, b) + "</td>\n"));
  646. p.push(w);
  647. }
  648. return function(e, r) {
  649. for (var n = "<table>\n<thead>\n<tr>\n", t = e.length, o = 0; o < t; ++o) n += e[o];
  650. for (n += "</tr>\n</thead>\n<tbody>\n", o = 0; o < r.length; ++o) {
  651. n += "<tr>\n";
  652. for (var s = 0; s < t; ++s) n += r[o][s];
  653. n += "</tr>\n";
  654. }
  655. return n += "</tbody>\n</table>\n";
  656. }(d, p);
  657. }), e = b.converter._dispatch("tables.after", e, g, b);
  658. }), showdown.subParser("unescapeSpecialChars", function(e) {
  659. return e = e.replace(/~E(\d+)E/g, function(e, r) {
  660. var n = parseInt(r);
  661. return String.fromCharCode(n);
  662. });
  663. }), module.exports = showdown;