showdown-2.0.0.js 106 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447
  1. /*! showdown v 2.0.0 - 15-02-2022 */ ! function() {
  2. function a(e) {
  3. "use strict";
  4. var r = {
  5. omitExtraWLInCodeBlocks: {
  6. defaultValue: !1,
  7. describe: "Omit the default extra whiteline added to code blocks",
  8. type: "boolean"
  9. },
  10. noHeaderId: {
  11. defaultValue: !1,
  12. describe: "Turn on/off generated header id",
  13. type: "boolean"
  14. },
  15. prefixHeaderId: {
  16. defaultValue: !1,
  17. describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",
  18. type: "string"
  19. },
  20. rawPrefixHeaderId: {
  21. defaultValue: !1,
  22. describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
  23. type: "boolean"
  24. },
  25. ghCompatibleHeaderId: {
  26. defaultValue: !1,
  27. describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",
  28. type: "boolean"
  29. },
  30. rawHeaderId: {
  31. defaultValue: !1,
  32. describe: "Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",
  33. type: "boolean"
  34. },
  35. headerLevelStart: {
  36. defaultValue: !1,
  37. describe: "The header blocks level start",
  38. type: "integer"
  39. },
  40. parseImgDimensions: {
  41. defaultValue: !1,
  42. describe: "Turn on/off image dimension parsing",
  43. type: "boolean"
  44. },
  45. simplifiedAutoLink: {
  46. defaultValue: !1,
  47. describe: "Turn on/off GFM autolink style",
  48. type: "boolean"
  49. },
  50. excludeTrailingPunctuationFromURLs: {
  51. defaultValue: !1,
  52. describe: "Excludes trailing punctuation from links generated with autoLinking",
  53. type: "boolean"
  54. },
  55. literalMidWordUnderscores: {
  56. defaultValue: !1,
  57. describe: "Parse midword underscores as literal underscores",
  58. type: "boolean"
  59. },
  60. literalMidWordAsterisks: {
  61. defaultValue: !1,
  62. describe: "Parse midword asterisks as literal asterisks",
  63. type: "boolean"
  64. },
  65. strikethrough: {
  66. defaultValue: !1,
  67. describe: "Turn on/off strikethrough support",
  68. type: "boolean"
  69. },
  70. tables: {
  71. defaultValue: !1,
  72. describe: "Turn on/off tables support",
  73. type: "boolean"
  74. },
  75. tablesHeaderId: {
  76. defaultValue: !1,
  77. describe: "Add an id to table headers",
  78. type: "boolean"
  79. },
  80. ghCodeBlocks: {
  81. defaultValue: !0,
  82. describe: "Turn on/off GFM fenced code blocks support",
  83. type: "boolean"
  84. },
  85. tasklists: {
  86. defaultValue: !1,
  87. describe: "Turn on/off GFM tasklist support",
  88. type: "boolean"
  89. },
  90. smoothLivePreview: {
  91. defaultValue: !1,
  92. describe: "Prevents weird effects in live previews due to incomplete input",
  93. type: "boolean"
  94. },
  95. smartIndentationFix: {
  96. defaultValue: !1,
  97. description: "Tries to smartly fix indentation in es6 strings",
  98. type: "boolean"
  99. },
  100. disableForced4SpacesIndentedSublists: {
  101. defaultValue: !1,
  102. description: "Disables the requirement of indenting nested sublists by 4 spaces",
  103. type: "boolean"
  104. },
  105. simpleLineBreaks: {
  106. defaultValue: !1,
  107. description: "Parses simple line breaks as <br> (GFM Style)",
  108. type: "boolean"
  109. },
  110. requireSpaceBeforeHeadingText: {
  111. defaultValue: !1,
  112. description: "Makes adding a space between `#` and the header text mandatory (GFM Style)",
  113. type: "boolean"
  114. },
  115. ghMentions: {
  116. defaultValue: !1,
  117. description: "Enables github @mentions",
  118. type: "boolean"
  119. },
  120. ghMentionsLink: {
  121. defaultValue: "https://github.com/{u}",
  122. description: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",
  123. type: "string"
  124. },
  125. encodeEmails: {
  126. defaultValue: !0,
  127. description: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",
  128. type: "boolean"
  129. },
  130. openLinksInNewWindow: {
  131. defaultValue: !1,
  132. description: "Open all links in new windows",
  133. type: "boolean"
  134. },
  135. backslashEscapesHTMLTags: {
  136. defaultValue: !1,
  137. description: "Support for HTML Tag escaping. ex: <div>foo</div>",
  138. type: "boolean"
  139. },
  140. emoji: {
  141. defaultValue: !1,
  142. description: "Enable emoji support. Ex: `this is a :smile: emoji`",
  143. type: "boolean"
  144. },
  145. underline: {
  146. defaultValue: !1,
  147. description: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",
  148. type: "boolean"
  149. },
  150. ellipsis: {
  151. defaultValue: !0,
  152. description: "Replaces three dots with the ellipsis unicode character",
  153. type: "boolean"
  154. },
  155. completeHTMLDocument: {
  156. defaultValue: !1,
  157. description: "Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",
  158. type: "boolean"
  159. },
  160. metadata: {
  161. defaultValue: !1,
  162. description: "Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",
  163. type: "boolean"
  164. },
  165. splitAdjacentBlockquotes: {
  166. defaultValue: !1,
  167. description: "Split adjacent blockquote blocks",
  168. type: "boolean"
  169. }
  170. };
  171. if (!1 === e) return JSON.parse(JSON.stringify(r));
  172. var t, a = {};
  173. for (t in r) r.hasOwnProperty(t) && (a[t] = r[t].defaultValue);
  174. return a
  175. }
  176. var x = {},
  177. t = {},
  178. d = {},
  179. p = a(!0),
  180. h = "vanilla",
  181. _ = {
  182. github: {
  183. omitExtraWLInCodeBlocks: !0,
  184. simplifiedAutoLink: !0,
  185. excludeTrailingPunctuationFromURLs: !0,
  186. literalMidWordUnderscores: !0,
  187. strikethrough: !0,
  188. tables: !0,
  189. tablesHeaderId: !0,
  190. ghCodeBlocks: !0,
  191. tasklists: !0,
  192. disableForced4SpacesIndentedSublists: !0,
  193. simpleLineBreaks: !0,
  194. requireSpaceBeforeHeadingText: !0,
  195. ghCompatibleHeaderId: !0,
  196. ghMentions: !0,
  197. backslashEscapesHTMLTags: !0,
  198. emoji: !0,
  199. splitAdjacentBlockquotes: !0
  200. },
  201. original: {
  202. noHeaderId: !0,
  203. ghCodeBlocks: !1
  204. },
  205. ghost: {
  206. omitExtraWLInCodeBlocks: !0,
  207. parseImgDimensions: !0,
  208. simplifiedAutoLink: !0,
  209. excludeTrailingPunctuationFromURLs: !0,
  210. literalMidWordUnderscores: !0,
  211. strikethrough: !0,
  212. tables: !0,
  213. tablesHeaderId: !0,
  214. ghCodeBlocks: !0,
  215. tasklists: !0,
  216. smoothLivePreview: !0,
  217. simpleLineBreaks: !0,
  218. requireSpaceBeforeHeadingText: !0,
  219. ghMentions: !1,
  220. encodeEmails: !0
  221. },
  222. vanilla: a(!0),
  223. allOn: function() {
  224. "use strict";
  225. var e, r = a(!0),
  226. t = {};
  227. for (e in r) r.hasOwnProperty(e) && (t[e] = !0);
  228. return t
  229. }()
  230. };
  231. function g(e, r) {
  232. "use strict";
  233. var t = r ? "Error in " + r + " extension->" : "Error in unnamed extension",
  234. a = {
  235. valid: !0,
  236. error: ""
  237. };
  238. x.helper.isArray(e) || (e = [e]);
  239. for (var n = 0; n < e.length; ++n) {
  240. var s = t + " sub-extension " + n + ": ",
  241. o = e[n];
  242. if ("object" != typeof o) return a.valid = !1, a.error = s + "must be an object, but " + typeof o + " given", a;
  243. if (!x.helper.isString(o.type)) return a.valid = !1, a.error = s + 'property "type" must be a string, but ' + typeof o.type + " given", a;
  244. var i = o.type = o.type.toLowerCase();
  245. if ("lang" !== (i = "html" === (i = "language" === i ? o.type = "lang" : i) ? o.type = "output" : i) && "output" !== i && "listener" !== i) return a.valid = !1, a.error = s + "type " + i + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"', a;
  246. if ("listener" === i) {
  247. if (x.helper.isUndefined(o.listeners)) return a.valid = !1, a.error = s + '. Extensions of type "listener" must have a property called "listeners"', a
  248. } else if (x.helper.isUndefined(o.filter) && x.helper.isUndefined(o.regex)) return a.valid = !1, a.error = s + i + ' extensions must define either a "regex" property or a "filter" method', a;
  249. if (o.listeners) {
  250. if ("object" != typeof o.listeners) return a.valid = !1, a.error = s + '"listeners" property must be an object but ' + typeof o.listeners + " given", a;
  251. for (var l in o.listeners)
  252. if (o.listeners.hasOwnProperty(l) && "function" != typeof o.listeners[l]) return a.valid = !1, a.error = s + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + l + " must be a function but " + typeof o.listeners[l] + " given", a
  253. }
  254. if (o.filter) {
  255. if ("function" != typeof o.filter) return a.valid = !1, a.error = s + '"filter" must be a function, but ' + typeof o.filter + " given", a
  256. } else if (o.regex) {
  257. if (x.helper.isString(o.regex) && (o.regex = new RegExp(o.regex, "g")), !(o.regex instanceof RegExp)) return a.valid = !1, a.error = s + '"regex" property must either be a string or a RegExp object, but ' + typeof o.regex + " given", a;
  258. if (x.helper.isUndefined(o.replace)) return a.valid = !1, a.error = s + '"regex" extensions must implement a replace string or function', a
  259. }
  260. }
  261. return a
  262. }
  263. function n(e, r) {
  264. "use strict";
  265. return "¨E" + r.charCodeAt(0) + "E"
  266. }
  267. x.helper = {}, x.extensions = {}, x.setOption = function(e, r) {
  268. "use strict";
  269. return p[e] = r, this
  270. }, x.getOption = function(e) {
  271. "use strict";
  272. return p[e]
  273. }, x.getOptions = function() {
  274. "use strict";
  275. return p
  276. }, x.resetOptions = function() {
  277. "use strict";
  278. p = a(!0)
  279. }, x.setFlavor = function(e) {
  280. "use strict";
  281. if (!_.hasOwnProperty(e)) throw Error(e + " flavor was not found");
  282. x.resetOptions();
  283. var r, t = _[e];
  284. for (r in h = e, t) t.hasOwnProperty(r) && (p[r] = t[r])
  285. }, x.getFlavor = function() {
  286. "use strict";
  287. return h
  288. }, x.getFlavorOptions = function(e) {
  289. "use strict";
  290. if (_.hasOwnProperty(e)) return _[e]
  291. }, x.getDefaultOptions = a, x.subParser = function(e, r) {
  292. "use strict";
  293. if (x.helper.isString(e)) {
  294. if (void 0 === r) {
  295. if (t.hasOwnProperty(e)) return t[e];
  296. throw Error("SubParser named " + e + " not registered!")
  297. }
  298. t[e] = r
  299. }
  300. }, x.extension = function(e, r) {
  301. "use strict";
  302. if (!x.helper.isString(e)) throw Error("Extension 'name' must be a string");
  303. if (e = x.helper.stdExtName(e), x.helper.isUndefined(r)) {
  304. if (!d.hasOwnProperty(e)) throw Error("Extension named " + e + " is not registered!");
  305. return d[e]
  306. }
  307. "function" == typeof r && (r = r());
  308. var t = g(r = x.helper.isArray(r) ? r : [r], e);
  309. if (!t.valid) throw Error(t.error);
  310. d[e] = r
  311. }, x.getAllExtensions = function() {
  312. "use strict";
  313. return d
  314. }, x.removeExtension = function(e) {
  315. "use strict";
  316. delete d[e]
  317. }, x.resetExtensions = function() {
  318. "use strict";
  319. d = {}
  320. }, x.validateExtension = function(e) {
  321. "use strict";
  322. e = g(e, null);
  323. return !!e.valid || (console.warn(e.error), !1)
  324. }, x.hasOwnProperty("helper") || (x.helper = {}), x.helper.isString = function(e) {
  325. "use strict";
  326. return "string" == typeof e || e instanceof String
  327. }, x.helper.isFunction = function(e) {
  328. "use strict";
  329. return e && "[object Function]" === {}.toString.call(e)
  330. }, x.helper.isArray = function(e) {
  331. "use strict";
  332. return Array.isArray(e)
  333. }, x.helper.isUndefined = function(e) {
  334. "use strict";
  335. return void 0 === e
  336. }, x.helper.forEach = function(e, r) {
  337. "use strict";
  338. if (x.helper.isUndefined(e)) throw new Error("obj param is required");
  339. if (x.helper.isUndefined(r)) throw new Error("callback param is required");
  340. if (!x.helper.isFunction(r)) throw new Error("callback param must be a function/closure");
  341. if ("function" == typeof e.forEach) e.forEach(r);
  342. else if (x.helper.isArray(e))
  343. for (var t = 0; t < e.length; t++) r(e[t], t, e);
  344. else {
  345. if ("object" != typeof e) throw new Error("obj does not seem to be an array or an iterable object");
  346. for (var a in e) e.hasOwnProperty(a) && r(e[a], a, e)
  347. }
  348. }, x.helper.stdExtName = function(e) {
  349. "use strict";
  350. return e.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase()
  351. }, x.helper.escapeCharactersCallback = n, x.helper.escapeCharacters = function(e, r, t) {
  352. "use strict";
  353. r = "([" + r.replace(/([\[\]\\])/g, "\\$1") + "])", t && (r = "\\\\" + r), t = new RegExp(r, "g");
  354. return e = e.replace(t, n)
  355. }, x.helper.unescapeHTMLEntities = function(e) {
  356. "use strict";
  357. return e.replace(/&quot;/g, '"').replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&")
  358. };
  359. function u(e, r, u, t) {
  360. "use strict";
  361. var a, n, s, d = -1 < (t = t || "").indexOf("g"),
  362. o = new RegExp(r + "|" + u, "g" + t.replace(/g/g, "")),
  363. p = new RegExp(r, t.replace(/g/g, "")),
  364. i = [];
  365. do {
  366. for (a = 0; c = o.exec(e);)
  367. if (p.test(c[0])) a++ || (s = (n = o.lastIndex) - c[0].length);
  368. else if (a && !--a) {
  369. var l = c.index + c[0].length,
  370. c = {
  371. left: {
  372. start: s,
  373. end: n
  374. },
  375. match: {
  376. start: n,
  377. end: c.index
  378. },
  379. right: {
  380. start: c.index,
  381. end: l
  382. },
  383. wholeMatch: {
  384. start: s,
  385. end: l
  386. }
  387. };
  388. if (i.push(c), !d) return i
  389. }
  390. } while (a && (o.lastIndex = n));
  391. return i
  392. }
  393. function s(u) {
  394. "use strict";
  395. return function(e, r, t, a, c, n, s) {
  396. var o = t = t.replace(x.helper.regexes.asteriskDashAndColon, x.helper.escapeCharactersCallback),
  397. i = "",
  398. l = "",
  399. r = r || "",
  400. s = s || "";
  401. return /^www\./i.test(t) && (t = t.replace(/^www\./i, "http://www.")), u.excludeTrailingPunctuationFromURLs && n && (i = n), r + '<a href="' + t + '"' + (l = u.openLinksInNewWindow ? ' rel="noopener noreferrer" target="¨E95Eblank"' : l) + ">" + o + "</a>" + i + s
  402. }
  403. }
  404. function o(n, s) {
  405. "use strict";
  406. return function(e, r, t) {
  407. var a = "mailto:";
  408. return r = r || "", t = x.subParser("unescapeSpecialChars")(t, n, s), n.encodeEmails ? (a = x.helper.encodeEmailAddress(a + t), t = x.helper.encodeEmailAddress(t)) : a += t, r + '<a href="' + a + '">' + t + "</a>"
  409. }
  410. }
  411. x.helper.matchRecursiveRegExp = function(e, r, t, a) {
  412. "use strict";
  413. for (var n = u(e, r, t, a), s = [], o = 0; o < n.length; ++o) s.push([e.slice(n[o].wholeMatch.start, n[o].wholeMatch.end), e.slice(n[o].match.start, n[o].match.end), e.slice(n[o].left.start, n[o].left.end), e.slice(n[o].right.start, n[o].right.end)]);
  414. return s
  415. }, x.helper.replaceRecursiveRegExp = function(e, r, t, a, n) {
  416. "use strict";
  417. x.helper.isFunction(r) || (s = r, r = function() {
  418. return s
  419. });
  420. var s, o = u(e, t, a, n),
  421. t = e,
  422. i = o.length;
  423. if (0 < i) {
  424. var l = [];
  425. 0 !== o[0].wholeMatch.start && l.push(e.slice(0, o[0].wholeMatch.start));
  426. for (var c = 0; c < i; ++c) l.push(r(e.slice(o[c].wholeMatch.start, o[c].wholeMatch.end), e.slice(o[c].match.start, o[c].match.end), e.slice(o[c].left.start, o[c].left.end), e.slice(o[c].right.start, o[c].right.end))), c < i - 1 && l.push(e.slice(o[c].wholeMatch.end, o[c + 1].wholeMatch.start));
  427. o[i - 1].wholeMatch.end < e.length && l.push(e.slice(o[i - 1].wholeMatch.end)), t = l.join("")
  428. }
  429. return t
  430. }, x.helper.regexIndexOf = function(e, r, t) {
  431. "use strict";
  432. if (!x.helper.isString(e)) throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
  433. if (r instanceof RegExp == !1) throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";
  434. e = e.substring(t || 0).search(r);
  435. return 0 <= e ? e + (t || 0) : e
  436. }, x.helper.splitAtIndex = function(e, r) {
  437. "use strict";
  438. if (!x.helper.isString(e)) throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
  439. return [e.substring(0, r), e.substring(r)]
  440. }, x.helper.encodeEmailAddress = function(e) {
  441. "use strict";
  442. var t = [function(e) {
  443. return "&#" + e.charCodeAt(0) + ";"
  444. }, function(e) {
  445. return "&#x" + e.charCodeAt(0).toString(16) + ";"
  446. }, function(e) {
  447. return e
  448. }];
  449. return e = e.replace(/./g, function(e) {
  450. var r;
  451. return e = "@" === e ? t[Math.floor(2 * Math.random())](e) : .9 < (r = Math.random()) ? t[2](e) : .45 < r ? t[1](e) : t[0](e)
  452. })
  453. }, x.helper.padEnd = function(e, r, t) {
  454. "use strict";
  455. return r >>= 0, t = String(t || " "), e.length > r ? String(e) : ((r -= e.length) > t.length && (t += t.repeat(r / t.length)), String(e) + t.slice(0, r))
  456. }, "undefined" == typeof console && (console = {
  457. warn: function(e) {
  458. "use strict";
  459. alert(e)
  460. },
  461. log: function(e) {
  462. "use strict";
  463. alert(e)
  464. },
  465. error: function(e) {
  466. "use strict";
  467. throw e
  468. }
  469. }), x.helper.regexes = {
  470. asteriskDashAndColon: /([*_:~])/g
  471. }, x.helper.emojis = {
  472. "+1": "👍",
  473. "-1": "👎",
  474. 100: "💯",
  475. 1234: "🔢",
  476. "1st_place_medal": "🥇",
  477. "2nd_place_medal": "🥈",
  478. "3rd_place_medal": "🥉",
  479. "8ball": "🎱",
  480. a: "🅰️",
  481. ab: "🆎",
  482. abc: "🔤",
  483. abcd: "🔡",
  484. accept: "🉑",
  485. aerial_tramway: "🚡",
  486. airplane: "✈️",
  487. alarm_clock: "⏰",
  488. alembic: "⚗️",
  489. alien: "👽",
  490. ambulance: "🚑",
  491. amphora: "🏺",
  492. anchor: "⚓️",
  493. angel: "👼",
  494. anger: "💢",
  495. angry: "😠",
  496. anguished: "😧",
  497. ant: "🐜",
  498. apple: "🍎",
  499. aquarius: "♒️",
  500. aries: "♈️",
  501. arrow_backward: "◀️",
  502. arrow_double_down: "⏬",
  503. arrow_double_up: "⏫",
  504. arrow_down: "⬇️",
  505. arrow_down_small: "🔽",
  506. arrow_forward: "▶️",
  507. arrow_heading_down: "⤵️",
  508. arrow_heading_up: "⤴️",
  509. arrow_left: "⬅️",
  510. arrow_lower_left: "↙️",
  511. arrow_lower_right: "↘️",
  512. arrow_right: "➡️",
  513. arrow_right_hook: "↪️",
  514. arrow_up: "⬆️",
  515. arrow_up_down: "↕️",
  516. arrow_up_small: "🔼",
  517. arrow_upper_left: "↖️",
  518. arrow_upper_right: "↗️",
  519. arrows_clockwise: "🔃",
  520. arrows_counterclockwise: "🔄",
  521. art: "🎨",
  522. articulated_lorry: "🚛",
  523. artificial_satellite: "🛰",
  524. astonished: "😲",
  525. athletic_shoe: "👟",
  526. atm: "🏧",
  527. atom_symbol: "⚛️",
  528. avocado: "🥑",
  529. b: "🅱️",
  530. baby: "👶",
  531. baby_bottle: "🍼",
  532. baby_chick: "🐤",
  533. baby_symbol: "🚼",
  534. back: "🔙",
  535. bacon: "🥓",
  536. badminton: "🏸",
  537. baggage_claim: "🛄",
  538. baguette_bread: "🥖",
  539. balance_scale: "⚖️",
  540. balloon: "🎈",
  541. ballot_box: "🗳",
  542. ballot_box_with_check: "☑️",
  543. bamboo: "🎍",
  544. banana: "🍌",
  545. bangbang: "‼️",
  546. bank: "🏦",
  547. bar_chart: "📊",
  548. barber: "💈",
  549. baseball: "⚾️",
  550. basketball: "🏀",
  551. basketball_man: "⛹️",
  552. basketball_woman: "⛹️&zwj;♀️",
  553. bat: "🦇",
  554. bath: "🛀",
  555. bathtub: "🛁",
  556. battery: "🔋",
  557. beach_umbrella: "🏖",
  558. bear: "🐻",
  559. bed: "🛏",
  560. bee: "🐝",
  561. beer: "🍺",
  562. beers: "🍻",
  563. beetle: "🐞",
  564. beginner: "🔰",
  565. bell: "🔔",
  566. bellhop_bell: "🛎",
  567. bento: "🍱",
  568. biking_man: "🚴",
  569. bike: "🚲",
  570. biking_woman: "🚴&zwj;♀️",
  571. bikini: "👙",
  572. biohazard: "☣️",
  573. bird: "🐦",
  574. birthday: "🎂",
  575. black_circle: "⚫️",
  576. black_flag: "🏴",
  577. black_heart: "🖤",
  578. black_joker: "🃏",
  579. black_large_square: "⬛️",
  580. black_medium_small_square: "◾️",
  581. black_medium_square: "◼️",
  582. black_nib: "✒️",
  583. black_small_square: "▪️",
  584. black_square_button: "🔲",
  585. blonde_man: "👱",
  586. blonde_woman: "👱&zwj;♀️",
  587. blossom: "🌼",
  588. blowfish: "🐡",
  589. blue_book: "📘",
  590. blue_car: "🚙",
  591. blue_heart: "💙",
  592. blush: "😊",
  593. boar: "🐗",
  594. boat: "⛵️",
  595. bomb: "💣",
  596. book: "📖",
  597. bookmark: "🔖",
  598. bookmark_tabs: "📑",
  599. books: "📚",
  600. boom: "💥",
  601. boot: "👢",
  602. bouquet: "💐",
  603. bowing_man: "🙇",
  604. bow_and_arrow: "🏹",
  605. bowing_woman: "🙇&zwj;♀️",
  606. bowling: "🎳",
  607. boxing_glove: "🥊",
  608. boy: "👦",
  609. bread: "🍞",
  610. bride_with_veil: "👰",
  611. bridge_at_night: "🌉",
  612. briefcase: "💼",
  613. broken_heart: "💔",
  614. bug: "🐛",
  615. building_construction: "🏗",
  616. bulb: "💡",
  617. bullettrain_front: "🚅",
  618. bullettrain_side: "🚄",
  619. burrito: "🌯",
  620. bus: "🚌",
  621. business_suit_levitating: "🕴",
  622. busstop: "🚏",
  623. bust_in_silhouette: "👤",
  624. busts_in_silhouette: "👥",
  625. butterfly: "🦋",
  626. cactus: "🌵",
  627. cake: "🍰",
  628. calendar: "📆",
  629. call_me_hand: "🤙",
  630. calling: "📲",
  631. camel: "🐫",
  632. camera: "📷",
  633. camera_flash: "📸",
  634. camping: "🏕",
  635. cancer: "♋️",
  636. candle: "🕯",
  637. candy: "🍬",
  638. canoe: "🛶",
  639. capital_abcd: "🔠",
  640. capricorn: "♑️",
  641. car: "🚗",
  642. card_file_box: "🗃",
  643. card_index: "📇",
  644. card_index_dividers: "🗂",
  645. carousel_horse: "🎠",
  646. carrot: "🥕",
  647. cat: "🐱",
  648. cat2: "🐈",
  649. cd: "💿",
  650. chains: "⛓",
  651. champagne: "🍾",
  652. chart: "💹",
  653. chart_with_downwards_trend: "📉",
  654. chart_with_upwards_trend: "📈",
  655. checkered_flag: "🏁",
  656. cheese: "🧀",
  657. cherries: "🍒",
  658. cherry_blossom: "🌸",
  659. chestnut: "🌰",
  660. chicken: "🐔",
  661. children_crossing: "🚸",
  662. chipmunk: "🐿",
  663. chocolate_bar: "🍫",
  664. christmas_tree: "🎄",
  665. church: "⛪️",
  666. cinema: "🎦",
  667. circus_tent: "🎪",
  668. city_sunrise: "🌇",
  669. city_sunset: "🌆",
  670. cityscape: "🏙",
  671. cl: "🆑",
  672. clamp: "🗜",
  673. clap: "👏",
  674. clapper: "🎬",
  675. classical_building: "🏛",
  676. clinking_glasses: "🥂",
  677. clipboard: "📋",
  678. clock1: "🕐",
  679. clock10: "🕙",
  680. clock1030: "🕥",
  681. clock11: "🕚",
  682. clock1130: "🕦",
  683. clock12: "🕛",
  684. clock1230: "🕧",
  685. clock130: "🕜",
  686. clock2: "🕑",
  687. clock230: "🕝",
  688. clock3: "🕒",
  689. clock330: "🕞",
  690. clock4: "🕓",
  691. clock430: "🕟",
  692. clock5: "🕔",
  693. clock530: "🕠",
  694. clock6: "🕕",
  695. clock630: "🕡",
  696. clock7: "🕖",
  697. clock730: "🕢",
  698. clock8: "🕗",
  699. clock830: "🕣",
  700. clock9: "🕘",
  701. clock930: "🕤",
  702. closed_book: "📕",
  703. closed_lock_with_key: "🔐",
  704. closed_umbrella: "🌂",
  705. cloud: "☁️",
  706. cloud_with_lightning: "🌩",
  707. cloud_with_lightning_and_rain: "⛈",
  708. cloud_with_rain: "🌧",
  709. cloud_with_snow: "🌨",
  710. clown_face: "🤡",
  711. clubs: "♣️",
  712. cocktail: "🍸",
  713. coffee: "☕️",
  714. coffin: "⚰️",
  715. cold_sweat: "😰",
  716. comet: "☄️",
  717. computer: "💻",
  718. computer_mouse: "🖱",
  719. confetti_ball: "🎊",
  720. confounded: "😖",
  721. confused: "😕",
  722. congratulations: "㊗️",
  723. construction: "🚧",
  724. construction_worker_man: "👷",
  725. construction_worker_woman: "👷&zwj;♀️",
  726. control_knobs: "🎛",
  727. convenience_store: "🏪",
  728. cookie: "🍪",
  729. cool: "🆒",
  730. policeman: "👮",
  731. copyright: "©️",
  732. corn: "🌽",
  733. couch_and_lamp: "🛋",
  734. couple: "👫",
  735. couple_with_heart_woman_man: "💑",
  736. couple_with_heart_man_man: "👨&zwj;❤️&zwj;👨",
  737. couple_with_heart_woman_woman: "👩&zwj;❤️&zwj;👩",
  738. couplekiss_man_man: "👨&zwj;❤️&zwj;💋&zwj;👨",
  739. couplekiss_man_woman: "💏",
  740. couplekiss_woman_woman: "👩&zwj;❤️&zwj;💋&zwj;👩",
  741. cow: "🐮",
  742. cow2: "🐄",
  743. cowboy_hat_face: "🤠",
  744. crab: "🦀",
  745. crayon: "🖍",
  746. credit_card: "💳",
  747. crescent_moon: "🌙",
  748. cricket: "🏏",
  749. crocodile: "🐊",
  750. croissant: "🥐",
  751. crossed_fingers: "🤞",
  752. crossed_flags: "🎌",
  753. crossed_swords: "⚔️",
  754. crown: "👑",
  755. cry: "😢",
  756. crying_cat_face: "😿",
  757. crystal_ball: "🔮",
  758. cucumber: "🥒",
  759. cupid: "💘",
  760. curly_loop: "➰",
  761. currency_exchange: "💱",
  762. curry: "🍛",
  763. custard: "🍮",
  764. customs: "🛃",
  765. cyclone: "🌀",
  766. dagger: "🗡",
  767. dancer: "💃",
  768. dancing_women: "👯",
  769. dancing_men: "👯&zwj;♂️",
  770. dango: "🍡",
  771. dark_sunglasses: "🕶",
  772. dart: "🎯",
  773. dash: "💨",
  774. date: "📅",
  775. deciduous_tree: "🌳",
  776. deer: "🦌",
  777. department_store: "🏬",
  778. derelict_house: "🏚",
  779. desert: "🏜",
  780. desert_island: "🏝",
  781. desktop_computer: "🖥",
  782. male_detective: "🕵️",
  783. diamond_shape_with_a_dot_inside: "💠",
  784. diamonds: "♦️",
  785. disappointed: "😞",
  786. disappointed_relieved: "😥",
  787. dizzy: "💫",
  788. dizzy_face: "😵",
  789. do_not_litter: "🚯",
  790. dog: "🐶",
  791. dog2: "🐕",
  792. dollar: "💵",
  793. dolls: "🎎",
  794. dolphin: "🐬",
  795. door: "🚪",
  796. doughnut: "🍩",
  797. dove: "🕊",
  798. dragon: "🐉",
  799. dragon_face: "🐲",
  800. dress: "👗",
  801. dromedary_camel: "🐪",
  802. drooling_face: "🤤",
  803. droplet: "💧",
  804. drum: "🥁",
  805. duck: "🦆",
  806. dvd: "📀",
  807. "e-mail": "📧",
  808. eagle: "🦅",
  809. ear: "👂",
  810. ear_of_rice: "🌾",
  811. earth_africa: "🌍",
  812. earth_americas: "🌎",
  813. earth_asia: "🌏",
  814. egg: "🥚",
  815. eggplant: "🍆",
  816. eight_pointed_black_star: "✴️",
  817. eight_spoked_asterisk: "✳️",
  818. electric_plug: "🔌",
  819. elephant: "🐘",
  820. email: "✉️",
  821. end: "🔚",
  822. envelope_with_arrow: "📩",
  823. euro: "💶",
  824. european_castle: "🏰",
  825. european_post_office: "🏤",
  826. evergreen_tree: "🌲",
  827. exclamation: "❗️",
  828. expressionless: "😑",
  829. eye: "👁",
  830. eye_speech_bubble: "👁&zwj;🗨",
  831. eyeglasses: "👓",
  832. eyes: "👀",
  833. face_with_head_bandage: "🤕",
  834. face_with_thermometer: "🤒",
  835. fist_oncoming: "👊",
  836. factory: "🏭",
  837. fallen_leaf: "🍂",
  838. family_man_woman_boy: "👪",
  839. family_man_boy: "👨&zwj;👦",
  840. family_man_boy_boy: "👨&zwj;👦&zwj;👦",
  841. family_man_girl: "👨&zwj;👧",
  842. family_man_girl_boy: "👨&zwj;👧&zwj;👦",
  843. family_man_girl_girl: "👨&zwj;👧&zwj;👧",
  844. family_man_man_boy: "👨&zwj;👨&zwj;👦",
  845. family_man_man_boy_boy: "👨&zwj;👨&zwj;👦&zwj;👦",
  846. family_man_man_girl: "👨&zwj;👨&zwj;👧",
  847. family_man_man_girl_boy: "👨&zwj;👨&zwj;👧&zwj;👦",
  848. family_man_man_girl_girl: "👨&zwj;👨&zwj;👧&zwj;👧",
  849. family_man_woman_boy_boy: "👨&zwj;👩&zwj;👦&zwj;👦",
  850. family_man_woman_girl: "👨&zwj;👩&zwj;👧",
  851. family_man_woman_girl_boy: "👨&zwj;👩&zwj;👧&zwj;👦",
  852. family_man_woman_girl_girl: "👨&zwj;👩&zwj;👧&zwj;👧",
  853. family_woman_boy: "👩&zwj;👦",
  854. family_woman_boy_boy: "👩&zwj;👦&zwj;👦",
  855. family_woman_girl: "👩&zwj;👧",
  856. family_woman_girl_boy: "👩&zwj;👧&zwj;👦",
  857. family_woman_girl_girl: "👩&zwj;👧&zwj;👧",
  858. family_woman_woman_boy: "👩&zwj;👩&zwj;👦",
  859. family_woman_woman_boy_boy: "👩&zwj;👩&zwj;👦&zwj;👦",
  860. family_woman_woman_girl: "👩&zwj;👩&zwj;👧",
  861. family_woman_woman_girl_boy: "👩&zwj;👩&zwj;👧&zwj;👦",
  862. family_woman_woman_girl_girl: "👩&zwj;👩&zwj;👧&zwj;👧",
  863. fast_forward: "⏩",
  864. fax: "📠",
  865. fearful: "😨",
  866. feet: "🐾",
  867. female_detective: "🕵️&zwj;♀️",
  868. ferris_wheel: "🎡",
  869. ferry: "⛴",
  870. field_hockey: "🏑",
  871. file_cabinet: "🗄",
  872. file_folder: "📁",
  873. film_projector: "📽",
  874. film_strip: "🎞",
  875. fire: "🔥",
  876. fire_engine: "🚒",
  877. fireworks: "🎆",
  878. first_quarter_moon: "🌓",
  879. first_quarter_moon_with_face: "🌛",
  880. fish: "🐟",
  881. fish_cake: "🍥",
  882. fishing_pole_and_fish: "🎣",
  883. fist_raised: "✊",
  884. fist_left: "🤛",
  885. fist_right: "🤜",
  886. flags: "🎏",
  887. flashlight: "🔦",
  888. fleur_de_lis: "⚜️",
  889. flight_arrival: "🛬",
  890. flight_departure: "🛫",
  891. floppy_disk: "💾",
  892. flower_playing_cards: "🎴",
  893. flushed: "😳",
  894. fog: "🌫",
  895. foggy: "🌁",
  896. football: "🏈",
  897. footprints: "👣",
  898. fork_and_knife: "🍴",
  899. fountain: "⛲️",
  900. fountain_pen: "🖋",
  901. four_leaf_clover: "🍀",
  902. fox_face: "🦊",
  903. framed_picture: "🖼",
  904. free: "🆓",
  905. fried_egg: "🍳",
  906. fried_shrimp: "🍤",
  907. fries: "🍟",
  908. frog: "🐸",
  909. frowning: "😦",
  910. frowning_face: "☹️",
  911. frowning_man: "🙍&zwj;♂️",
  912. frowning_woman: "🙍",
  913. middle_finger: "🖕",
  914. fuelpump: "⛽️",
  915. full_moon: "🌕",
  916. full_moon_with_face: "🌝",
  917. funeral_urn: "⚱️",
  918. game_die: "🎲",
  919. gear: "⚙️",
  920. gem: "💎",
  921. gemini: "♊️",
  922. ghost: "👻",
  923. gift: "🎁",
  924. gift_heart: "💝",
  925. girl: "👧",
  926. globe_with_meridians: "🌐",
  927. goal_net: "🥅",
  928. goat: "🐐",
  929. golf: "⛳️",
  930. golfing_man: "🏌️",
  931. golfing_woman: "🏌️&zwj;♀️",
  932. gorilla: "🦍",
  933. grapes: "🍇",
  934. green_apple: "🍏",
  935. green_book: "📗",
  936. green_heart: "💚",
  937. green_salad: "🥗",
  938. grey_exclamation: "❕",
  939. grey_question: "❔",
  940. grimacing: "😬",
  941. grin: "😁",
  942. grinning: "😀",
  943. guardsman: "💂",
  944. guardswoman: "💂&zwj;♀️",
  945. guitar: "🎸",
  946. gun: "🔫",
  947. haircut_woman: "💇",
  948. haircut_man: "💇&zwj;♂️",
  949. hamburger: "🍔",
  950. hammer: "🔨",
  951. hammer_and_pick: "⚒",
  952. hammer_and_wrench: "🛠",
  953. hamster: "🐹",
  954. hand: "✋",
  955. handbag: "👜",
  956. handshake: "🤝",
  957. hankey: "💩",
  958. hatched_chick: "🐥",
  959. hatching_chick: "🐣",
  960. headphones: "🎧",
  961. hear_no_evil: "🙉",
  962. heart: "❤️",
  963. heart_decoration: "💟",
  964. heart_eyes: "😍",
  965. heart_eyes_cat: "😻",
  966. heartbeat: "💓",
  967. heartpulse: "💗",
  968. hearts: "♥️",
  969. heavy_check_mark: "✔️",
  970. heavy_division_sign: "➗",
  971. heavy_dollar_sign: "💲",
  972. heavy_heart_exclamation: "❣️",
  973. heavy_minus_sign: "➖",
  974. heavy_multiplication_x: "✖️",
  975. heavy_plus_sign: "➕",
  976. helicopter: "🚁",
  977. herb: "🌿",
  978. hibiscus: "🌺",
  979. high_brightness: "🔆",
  980. high_heel: "👠",
  981. hocho: "🔪",
  982. hole: "🕳",
  983. honey_pot: "🍯",
  984. horse: "🐴",
  985. horse_racing: "🏇",
  986. hospital: "🏥",
  987. hot_pepper: "🌶",
  988. hotdog: "🌭",
  989. hotel: "🏨",
  990. hotsprings: "♨️",
  991. hourglass: "⌛️",
  992. hourglass_flowing_sand: "⏳",
  993. house: "🏠",
  994. house_with_garden: "🏡",
  995. houses: "🏘",
  996. hugs: "🤗",
  997. hushed: "😯",
  998. ice_cream: "🍨",
  999. ice_hockey: "🏒",
  1000. ice_skate: "⛸",
  1001. icecream: "🍦",
  1002. id: "🆔",
  1003. ideograph_advantage: "🉐",
  1004. imp: "👿",
  1005. inbox_tray: "📥",
  1006. incoming_envelope: "📨",
  1007. tipping_hand_woman: "💁",
  1008. information_source: "ℹ️",
  1009. innocent: "😇",
  1010. interrobang: "⁉️",
  1011. iphone: "📱",
  1012. izakaya_lantern: "🏮",
  1013. jack_o_lantern: "🎃",
  1014. japan: "🗾",
  1015. japanese_castle: "🏯",
  1016. japanese_goblin: "👺",
  1017. japanese_ogre: "👹",
  1018. jeans: "👖",
  1019. joy: "😂",
  1020. joy_cat: "😹",
  1021. joystick: "🕹",
  1022. kaaba: "🕋",
  1023. key: "🔑",
  1024. keyboard: "⌨️",
  1025. keycap_ten: "🔟",
  1026. kick_scooter: "🛴",
  1027. kimono: "👘",
  1028. kiss: "💋",
  1029. kissing: "😗",
  1030. kissing_cat: "😽",
  1031. kissing_closed_eyes: "😚",
  1032. kissing_heart: "😘",
  1033. kissing_smiling_eyes: "😙",
  1034. kiwi_fruit: "🥝",
  1035. koala: "🐨",
  1036. koko: "🈁",
  1037. label: "🏷",
  1038. large_blue_circle: "🔵",
  1039. large_blue_diamond: "🔷",
  1040. large_orange_diamond: "🔶",
  1041. last_quarter_moon: "🌗",
  1042. last_quarter_moon_with_face: "🌜",
  1043. latin_cross: "✝️",
  1044. laughing: "😆",
  1045. leaves: "🍃",
  1046. ledger: "📒",
  1047. left_luggage: "🛅",
  1048. left_right_arrow: "↔️",
  1049. leftwards_arrow_with_hook: "↩️",
  1050. lemon: "🍋",
  1051. leo: "♌️",
  1052. leopard: "🐆",
  1053. level_slider: "🎚",
  1054. libra: "♎️",
  1055. light_rail: "🚈",
  1056. link: "🔗",
  1057. lion: "🦁",
  1058. lips: "👄",
  1059. lipstick: "💄",
  1060. lizard: "🦎",
  1061. lock: "🔒",
  1062. lock_with_ink_pen: "🔏",
  1063. lollipop: "🍭",
  1064. loop: "➿",
  1065. loud_sound: "🔊",
  1066. loudspeaker: "📢",
  1067. love_hotel: "🏩",
  1068. love_letter: "💌",
  1069. low_brightness: "🔅",
  1070. lying_face: "🤥",
  1071. m: "Ⓜ️",
  1072. mag: "🔍",
  1073. mag_right: "🔎",
  1074. mahjong: "🀄️",
  1075. mailbox: "📫",
  1076. mailbox_closed: "📪",
  1077. mailbox_with_mail: "📬",
  1078. mailbox_with_no_mail: "📭",
  1079. man: "👨",
  1080. man_artist: "👨&zwj;🎨",
  1081. man_astronaut: "👨&zwj;🚀",
  1082. man_cartwheeling: "🤸&zwj;♂️",
  1083. man_cook: "👨&zwj;🍳",
  1084. man_dancing: "🕺",
  1085. man_facepalming: "🤦&zwj;♂️",
  1086. man_factory_worker: "👨&zwj;🏭",
  1087. man_farmer: "👨&zwj;🌾",
  1088. man_firefighter: "👨&zwj;🚒",
  1089. man_health_worker: "👨&zwj;⚕️",
  1090. man_in_tuxedo: "🤵",
  1091. man_judge: "👨&zwj;⚖️",
  1092. man_juggling: "🤹&zwj;♂️",
  1093. man_mechanic: "👨&zwj;🔧",
  1094. man_office_worker: "👨&zwj;💼",
  1095. man_pilot: "👨&zwj;✈️",
  1096. man_playing_handball: "🤾&zwj;♂️",
  1097. man_playing_water_polo: "🤽&zwj;♂️",
  1098. man_scientist: "👨&zwj;🔬",
  1099. man_shrugging: "🤷&zwj;♂️",
  1100. man_singer: "👨&zwj;🎤",
  1101. man_student: "👨&zwj;🎓",
  1102. man_teacher: "👨&zwj;🏫",
  1103. man_technologist: "👨&zwj;💻",
  1104. man_with_gua_pi_mao: "👲",
  1105. man_with_turban: "👳",
  1106. tangerine: "🍊",
  1107. mans_shoe: "👞",
  1108. mantelpiece_clock: "🕰",
  1109. maple_leaf: "🍁",
  1110. martial_arts_uniform: "🥋",
  1111. mask: "😷",
  1112. massage_woman: "💆",
  1113. massage_man: "💆&zwj;♂️",
  1114. meat_on_bone: "🍖",
  1115. medal_military: "🎖",
  1116. medal_sports: "🏅",
  1117. mega: "📣",
  1118. melon: "🍈",
  1119. memo: "📝",
  1120. men_wrestling: "🤼&zwj;♂️",
  1121. menorah: "🕎",
  1122. mens: "🚹",
  1123. metal: "🤘",
  1124. metro: "🚇",
  1125. microphone: "🎤",
  1126. microscope: "🔬",
  1127. milk_glass: "🥛",
  1128. milky_way: "🌌",
  1129. minibus: "🚐",
  1130. minidisc: "💽",
  1131. mobile_phone_off: "📴",
  1132. money_mouth_face: "🤑",
  1133. money_with_wings: "💸",
  1134. moneybag: "💰",
  1135. monkey: "🐒",
  1136. monkey_face: "🐵",
  1137. monorail: "🚝",
  1138. moon: "🌔",
  1139. mortar_board: "🎓",
  1140. mosque: "🕌",
  1141. motor_boat: "🛥",
  1142. motor_scooter: "🛵",
  1143. motorcycle: "🏍",
  1144. motorway: "🛣",
  1145. mount_fuji: "🗻",
  1146. mountain: "⛰",
  1147. mountain_biking_man: "🚵",
  1148. mountain_biking_woman: "🚵&zwj;♀️",
  1149. mountain_cableway: "🚠",
  1150. mountain_railway: "🚞",
  1151. mountain_snow: "🏔",
  1152. mouse: "🐭",
  1153. mouse2: "🐁",
  1154. movie_camera: "🎥",
  1155. moyai: "🗿",
  1156. mrs_claus: "🤶",
  1157. muscle: "💪",
  1158. mushroom: "🍄",
  1159. musical_keyboard: "🎹",
  1160. musical_note: "🎵",
  1161. musical_score: "🎼",
  1162. mute: "🔇",
  1163. nail_care: "💅",
  1164. name_badge: "📛",
  1165. national_park: "🏞",
  1166. nauseated_face: "🤢",
  1167. necktie: "👔",
  1168. negative_squared_cross_mark: "❎",
  1169. nerd_face: "🤓",
  1170. neutral_face: "😐",
  1171. new: "🆕",
  1172. new_moon: "🌑",
  1173. new_moon_with_face: "🌚",
  1174. newspaper: "📰",
  1175. newspaper_roll: "🗞",
  1176. next_track_button: "⏭",
  1177. ng: "🆖",
  1178. no_good_man: "🙅&zwj;♂️",
  1179. no_good_woman: "🙅",
  1180. night_with_stars: "🌃",
  1181. no_bell: "🔕",
  1182. no_bicycles: "🚳",
  1183. no_entry: "⛔️",
  1184. no_entry_sign: "🚫",
  1185. no_mobile_phones: "📵",
  1186. no_mouth: "😶",
  1187. no_pedestrians: "🚷",
  1188. no_smoking: "🚭",
  1189. "non-potable_water": "🚱",
  1190. nose: "👃",
  1191. notebook: "📓",
  1192. notebook_with_decorative_cover: "📔",
  1193. notes: "🎶",
  1194. nut_and_bolt: "🔩",
  1195. o: "⭕️",
  1196. o2: "🅾️",
  1197. ocean: "🌊",
  1198. octopus: "🐙",
  1199. oden: "🍢",
  1200. office: "🏢",
  1201. oil_drum: "🛢",
  1202. ok: "🆗",
  1203. ok_hand: "👌",
  1204. ok_man: "🙆&zwj;♂️",
  1205. ok_woman: "🙆",
  1206. old_key: "🗝",
  1207. older_man: "👴",
  1208. older_woman: "👵",
  1209. om: "🕉",
  1210. on: "🔛",
  1211. oncoming_automobile: "🚘",
  1212. oncoming_bus: "🚍",
  1213. oncoming_police_car: "🚔",
  1214. oncoming_taxi: "🚖",
  1215. open_file_folder: "📂",
  1216. open_hands: "👐",
  1217. open_mouth: "😮",
  1218. open_umbrella: "☂️",
  1219. ophiuchus: "⛎",
  1220. orange_book: "📙",
  1221. orthodox_cross: "☦️",
  1222. outbox_tray: "📤",
  1223. owl: "🦉",
  1224. ox: "🐂",
  1225. package: "📦",
  1226. page_facing_up: "📄",
  1227. page_with_curl: "📃",
  1228. pager: "📟",
  1229. paintbrush: "🖌",
  1230. palm_tree: "🌴",
  1231. pancakes: "🥞",
  1232. panda_face: "🐼",
  1233. paperclip: "📎",
  1234. paperclips: "🖇",
  1235. parasol_on_ground: "⛱",
  1236. parking: "🅿️",
  1237. part_alternation_mark: "〽️",
  1238. partly_sunny: "⛅️",
  1239. passenger_ship: "🛳",
  1240. passport_control: "🛂",
  1241. pause_button: "⏸",
  1242. peace_symbol: "☮️",
  1243. peach: "🍑",
  1244. peanuts: "🥜",
  1245. pear: "🍐",
  1246. pen: "🖊",
  1247. pencil2: "✏️",
  1248. penguin: "🐧",
  1249. pensive: "😔",
  1250. performing_arts: "🎭",
  1251. persevere: "😣",
  1252. person_fencing: "🤺",
  1253. pouting_woman: "🙎",
  1254. phone: "☎️",
  1255. pick: "⛏",
  1256. pig: "🐷",
  1257. pig2: "🐖",
  1258. pig_nose: "🐽",
  1259. pill: "💊",
  1260. pineapple: "🍍",
  1261. ping_pong: "🏓",
  1262. pisces: "♓️",
  1263. pizza: "🍕",
  1264. place_of_worship: "🛐",
  1265. plate_with_cutlery: "🍽",
  1266. play_or_pause_button: "⏯",
  1267. point_down: "👇",
  1268. point_left: "👈",
  1269. point_right: "👉",
  1270. point_up: "☝️",
  1271. point_up_2: "👆",
  1272. police_car: "🚓",
  1273. policewoman: "👮&zwj;♀️",
  1274. poodle: "🐩",
  1275. popcorn: "🍿",
  1276. post_office: "🏣",
  1277. postal_horn: "📯",
  1278. postbox: "📮",
  1279. potable_water: "🚰",
  1280. potato: "🥔",
  1281. pouch: "👝",
  1282. poultry_leg: "🍗",
  1283. pound: "💷",
  1284. rage: "😡",
  1285. pouting_cat: "😾",
  1286. pouting_man: "🙎&zwj;♂️",
  1287. pray: "🙏",
  1288. prayer_beads: "📿",
  1289. pregnant_woman: "🤰",
  1290. previous_track_button: "⏮",
  1291. prince: "🤴",
  1292. princess: "👸",
  1293. printer: "🖨",
  1294. purple_heart: "💜",
  1295. purse: "👛",
  1296. pushpin: "📌",
  1297. put_litter_in_its_place: "🚮",
  1298. question: "❓",
  1299. rabbit: "🐰",
  1300. rabbit2: "🐇",
  1301. racehorse: "🐎",
  1302. racing_car: "🏎",
  1303. radio: "📻",
  1304. radio_button: "🔘",
  1305. radioactive: "☢️",
  1306. railway_car: "🚃",
  1307. railway_track: "🛤",
  1308. rainbow: "🌈",
  1309. rainbow_flag: "🏳️&zwj;🌈",
  1310. raised_back_of_hand: "🤚",
  1311. raised_hand_with_fingers_splayed: "🖐",
  1312. raised_hands: "🙌",
  1313. raising_hand_woman: "🙋",
  1314. raising_hand_man: "🙋&zwj;♂️",
  1315. ram: "🐏",
  1316. ramen: "🍜",
  1317. rat: "🐀",
  1318. record_button: "⏺",
  1319. recycle: "♻️",
  1320. red_circle: "🔴",
  1321. registered: "®️",
  1322. relaxed: "☺️",
  1323. relieved: "😌",
  1324. reminder_ribbon: "🎗",
  1325. repeat: "🔁",
  1326. repeat_one: "🔂",
  1327. rescue_worker_helmet: "⛑",
  1328. restroom: "🚻",
  1329. revolving_hearts: "💞",
  1330. rewind: "⏪",
  1331. rhinoceros: "🦏",
  1332. ribbon: "🎀",
  1333. rice: "🍚",
  1334. rice_ball: "🍙",
  1335. rice_cracker: "🍘",
  1336. rice_scene: "🎑",
  1337. right_anger_bubble: "🗯",
  1338. ring: "💍",
  1339. robot: "🤖",
  1340. rocket: "🚀",
  1341. rofl: "🤣",
  1342. roll_eyes: "🙄",
  1343. roller_coaster: "🎢",
  1344. rooster: "🐓",
  1345. rose: "🌹",
  1346. rosette: "🏵",
  1347. rotating_light: "🚨",
  1348. round_pushpin: "📍",
  1349. rowing_man: "🚣",
  1350. rowing_woman: "🚣&zwj;♀️",
  1351. rugby_football: "🏉",
  1352. running_man: "🏃",
  1353. running_shirt_with_sash: "🎽",
  1354. running_woman: "🏃&zwj;♀️",
  1355. sa: "🈂️",
  1356. sagittarius: "♐️",
  1357. sake: "🍶",
  1358. sandal: "👡",
  1359. santa: "🎅",
  1360. satellite: "📡",
  1361. saxophone: "🎷",
  1362. school: "🏫",
  1363. school_satchel: "🎒",
  1364. scissors: "✂️",
  1365. scorpion: "🦂",
  1366. scorpius: "♏️",
  1367. scream: "😱",
  1368. scream_cat: "🙀",
  1369. scroll: "📜",
  1370. seat: "💺",
  1371. secret: "㊙️",
  1372. see_no_evil: "🙈",
  1373. seedling: "🌱",
  1374. selfie: "🤳",
  1375. shallow_pan_of_food: "🥘",
  1376. shamrock: "☘️",
  1377. shark: "🦈",
  1378. shaved_ice: "🍧",
  1379. sheep: "🐑",
  1380. shell: "🐚",
  1381. shield: "🛡",
  1382. shinto_shrine: "⛩",
  1383. ship: "🚢",
  1384. shirt: "👕",
  1385. shopping: "🛍",
  1386. shopping_cart: "🛒",
  1387. shower: "🚿",
  1388. shrimp: "🦐",
  1389. signal_strength: "📶",
  1390. six_pointed_star: "🔯",
  1391. ski: "🎿",
  1392. skier: "⛷",
  1393. skull: "💀",
  1394. skull_and_crossbones: "☠️",
  1395. sleeping: "😴",
  1396. sleeping_bed: "🛌",
  1397. sleepy: "😪",
  1398. slightly_frowning_face: "🙁",
  1399. slightly_smiling_face: "🙂",
  1400. slot_machine: "🎰",
  1401. small_airplane: "🛩",
  1402. small_blue_diamond: "🔹",
  1403. small_orange_diamond: "🔸",
  1404. small_red_triangle: "🔺",
  1405. small_red_triangle_down: "🔻",
  1406. smile: "😄",
  1407. smile_cat: "😸",
  1408. smiley: "😃",
  1409. smiley_cat: "😺",
  1410. smiling_imp: "😈",
  1411. smirk: "😏",
  1412. smirk_cat: "😼",
  1413. smoking: "🚬",
  1414. snail: "🐌",
  1415. snake: "🐍",
  1416. sneezing_face: "🤧",
  1417. snowboarder: "🏂",
  1418. snowflake: "❄️",
  1419. snowman: "⛄️",
  1420. snowman_with_snow: "☃️",
  1421. sob: "😭",
  1422. soccer: "⚽️",
  1423. soon: "🔜",
  1424. sos: "🆘",
  1425. sound: "🔉",
  1426. space_invader: "👾",
  1427. spades: "♠️",
  1428. spaghetti: "🍝",
  1429. sparkle: "❇️",
  1430. sparkler: "🎇",
  1431. sparkles: "✨",
  1432. sparkling_heart: "💖",
  1433. speak_no_evil: "🙊",
  1434. speaker: "🔈",
  1435. speaking_head: "🗣",
  1436. speech_balloon: "💬",
  1437. speedboat: "🚤",
  1438. spider: "🕷",
  1439. spider_web: "🕸",
  1440. spiral_calendar: "🗓",
  1441. spiral_notepad: "🗒",
  1442. spoon: "🥄",
  1443. squid: "🦑",
  1444. stadium: "🏟",
  1445. star: "⭐️",
  1446. star2: "🌟",
  1447. star_and_crescent: "☪️",
  1448. star_of_david: "✡️",
  1449. stars: "🌠",
  1450. station: "🚉",
  1451. statue_of_liberty: "🗽",
  1452. steam_locomotive: "🚂",
  1453. stew: "🍲",
  1454. stop_button: "⏹",
  1455. stop_sign: "🛑",
  1456. stopwatch: "⏱",
  1457. straight_ruler: "📏",
  1458. strawberry: "🍓",
  1459. stuck_out_tongue: "😛",
  1460. stuck_out_tongue_closed_eyes: "😝",
  1461. stuck_out_tongue_winking_eye: "😜",
  1462. studio_microphone: "🎙",
  1463. stuffed_flatbread: "🥙",
  1464. sun_behind_large_cloud: "🌥",
  1465. sun_behind_rain_cloud: "🌦",
  1466. sun_behind_small_cloud: "🌤",
  1467. sun_with_face: "🌞",
  1468. sunflower: "🌻",
  1469. sunglasses: "😎",
  1470. sunny: "☀️",
  1471. sunrise: "🌅",
  1472. sunrise_over_mountains: "🌄",
  1473. surfing_man: "🏄",
  1474. surfing_woman: "🏄&zwj;♀️",
  1475. sushi: "🍣",
  1476. suspension_railway: "🚟",
  1477. sweat: "😓",
  1478. sweat_drops: "💦",
  1479. sweat_smile: "😅",
  1480. sweet_potato: "🍠",
  1481. swimming_man: "🏊",
  1482. swimming_woman: "🏊&zwj;♀️",
  1483. symbols: "🔣",
  1484. synagogue: "🕍",
  1485. syringe: "💉",
  1486. taco: "🌮",
  1487. tada: "🎉",
  1488. tanabata_tree: "🎋",
  1489. taurus: "♉️",
  1490. taxi: "🚕",
  1491. tea: "🍵",
  1492. telephone_receiver: "📞",
  1493. telescope: "🔭",
  1494. tennis: "🎾",
  1495. tent: "⛺️",
  1496. thermometer: "🌡",
  1497. thinking: "🤔",
  1498. thought_balloon: "💭",
  1499. ticket: "🎫",
  1500. tickets: "🎟",
  1501. tiger: "🐯",
  1502. tiger2: "🐅",
  1503. timer_clock: "⏲",
  1504. tipping_hand_man: "💁&zwj;♂️",
  1505. tired_face: "😫",
  1506. tm: "™️",
  1507. toilet: "🚽",
  1508. tokyo_tower: "🗼",
  1509. tomato: "🍅",
  1510. tongue: "👅",
  1511. top: "🔝",
  1512. tophat: "🎩",
  1513. tornado: "🌪",
  1514. trackball: "🖲",
  1515. tractor: "🚜",
  1516. traffic_light: "🚥",
  1517. train: "🚋",
  1518. train2: "🚆",
  1519. tram: "🚊",
  1520. triangular_flag_on_post: "🚩",
  1521. triangular_ruler: "📐",
  1522. trident: "🔱",
  1523. triumph: "😤",
  1524. trolleybus: "🚎",
  1525. trophy: "🏆",
  1526. tropical_drink: "🍹",
  1527. tropical_fish: "🐠",
  1528. truck: "🚚",
  1529. trumpet: "🎺",
  1530. tulip: "🌷",
  1531. tumbler_glass: "🥃",
  1532. turkey: "🦃",
  1533. turtle: "🐢",
  1534. tv: "📺",
  1535. twisted_rightwards_arrows: "🔀",
  1536. two_hearts: "💕",
  1537. two_men_holding_hands: "👬",
  1538. two_women_holding_hands: "👭",
  1539. u5272: "🈹",
  1540. u5408: "🈴",
  1541. u55b6: "🈺",
  1542. u6307: "🈯️",
  1543. u6708: "🈷️",
  1544. u6709: "🈶",
  1545. u6e80: "🈵",
  1546. u7121: "🈚️",
  1547. u7533: "🈸",
  1548. u7981: "🈲",
  1549. u7a7a: "🈳",
  1550. umbrella: "☔️",
  1551. unamused: "😒",
  1552. underage: "🔞",
  1553. unicorn: "🦄",
  1554. unlock: "🔓",
  1555. up: "🆙",
  1556. upside_down_face: "🙃",
  1557. v: "✌️",
  1558. vertical_traffic_light: "🚦",
  1559. vhs: "📼",
  1560. vibration_mode: "📳",
  1561. video_camera: "📹",
  1562. video_game: "🎮",
  1563. violin: "🎻",
  1564. virgo: "♍️",
  1565. volcano: "🌋",
  1566. volleyball: "🏐",
  1567. vs: "🆚",
  1568. vulcan_salute: "🖖",
  1569. walking_man: "🚶",
  1570. walking_woman: "🚶&zwj;♀️",
  1571. waning_crescent_moon: "🌘",
  1572. waning_gibbous_moon: "🌖",
  1573. warning: "⚠️",
  1574. wastebasket: "🗑",
  1575. watch: "⌚️",
  1576. water_buffalo: "🐃",
  1577. watermelon: "🍉",
  1578. wave: "👋",
  1579. wavy_dash: "〰️",
  1580. waxing_crescent_moon: "🌒",
  1581. wc: "🚾",
  1582. weary: "😩",
  1583. wedding: "💒",
  1584. weight_lifting_man: "🏋️",
  1585. weight_lifting_woman: "🏋️&zwj;♀️",
  1586. whale: "🐳",
  1587. whale2: "🐋",
  1588. wheel_of_dharma: "☸️",
  1589. wheelchair: "♿️",
  1590. white_check_mark: "✅",
  1591. white_circle: "⚪️",
  1592. white_flag: "🏳️",
  1593. white_flower: "💮",
  1594. white_large_square: "⬜️",
  1595. white_medium_small_square: "◽️",
  1596. white_medium_square: "◻️",
  1597. white_small_square: "▫️",
  1598. white_square_button: "🔳",
  1599. wilted_flower: "🥀",
  1600. wind_chime: "🎐",
  1601. wind_face: "🌬",
  1602. wine_glass: "🍷",
  1603. wink: "😉",
  1604. wolf: "🐺",
  1605. woman: "👩",
  1606. woman_artist: "👩&zwj;🎨",
  1607. woman_astronaut: "👩&zwj;🚀",
  1608. woman_cartwheeling: "🤸&zwj;♀️",
  1609. woman_cook: "👩&zwj;🍳",
  1610. woman_facepalming: "🤦&zwj;♀️",
  1611. woman_factory_worker: "👩&zwj;🏭",
  1612. woman_farmer: "👩&zwj;🌾",
  1613. woman_firefighter: "👩&zwj;🚒",
  1614. woman_health_worker: "👩&zwj;⚕️",
  1615. woman_judge: "👩&zwj;⚖️",
  1616. woman_juggling: "🤹&zwj;♀️",
  1617. woman_mechanic: "👩&zwj;🔧",
  1618. woman_office_worker: "👩&zwj;💼",
  1619. woman_pilot: "👩&zwj;✈️",
  1620. woman_playing_handball: "🤾&zwj;♀️",
  1621. woman_playing_water_polo: "🤽&zwj;♀️",
  1622. woman_scientist: "👩&zwj;🔬",
  1623. woman_shrugging: "🤷&zwj;♀️",
  1624. woman_singer: "👩&zwj;🎤",
  1625. woman_student: "👩&zwj;🎓",
  1626. woman_teacher: "👩&zwj;🏫",
  1627. woman_technologist: "👩&zwj;💻",
  1628. woman_with_turban: "👳&zwj;♀️",
  1629. womans_clothes: "👚",
  1630. womans_hat: "👒",
  1631. women_wrestling: "🤼&zwj;♀️",
  1632. womens: "🚺",
  1633. world_map: "🗺",
  1634. worried: "😟",
  1635. wrench: "🔧",
  1636. writing_hand: "✍️",
  1637. x: "❌",
  1638. yellow_heart: "💛",
  1639. yen: "💴",
  1640. yin_yang: "☯️",
  1641. yum: "😋",
  1642. zap: "⚡️",
  1643. zipper_mouth_face: "🤐",
  1644. zzz: "💤",
  1645. octocat: '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
  1646. showdown: "<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"
  1647. }, x.Converter = function(e) {
  1648. "use strict";
  1649. var r, t, n = {},
  1650. i = [],
  1651. l = [],
  1652. o = {},
  1653. a = h,
  1654. s = {
  1655. parsed: {},
  1656. raw: "",
  1657. format: ""
  1658. };
  1659. for (r in e = e || {}, p) p.hasOwnProperty(r) && (n[r] = p[r]);
  1660. if ("object" != typeof e) throw Error("Converter expects the passed parameter to be an object, but " + typeof e + " was passed instead.");
  1661. for (t in e) e.hasOwnProperty(t) && (n[t] = e[t]);
  1662. function c(e, r) {
  1663. if (r = r || null, x.helper.isString(e)) {
  1664. if (r = e = x.helper.stdExtName(e), x.extensions[e]) {
  1665. 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!");
  1666. var t = x.extensions[e],
  1667. a = e;
  1668. if ("function" == typeof t && (t = t(new x.Converter)), x.helper.isArray(t) || (t = [t]), !(a = g(t, a)).valid) throw Error(a.error);
  1669. for (var n = 0; n < t.length; ++n) switch (t[n].type) {
  1670. case "lang":
  1671. i.push(t[n]);
  1672. break;
  1673. case "output":
  1674. l.push(t[n]);
  1675. break;
  1676. default:
  1677. throw Error("Extension loader error: Type unrecognized!!!")
  1678. }
  1679. return
  1680. }
  1681. if (x.helper.isUndefined(d[e])) throw Error('Extension "' + e + '" could not be loaded. It was either not found or is not a valid extension.');
  1682. e = d[e]
  1683. }
  1684. "function" == typeof e && (e = e());
  1685. a = g(e = x.helper.isArray(e) ? e : [e], r);
  1686. if (!a.valid) throw Error(a.error);
  1687. for (var s = 0; s < e.length; ++s) {
  1688. switch (e[s].type) {
  1689. case "lang":
  1690. i.push(e[s]);
  1691. break;
  1692. case "output":
  1693. l.push(e[s])
  1694. }
  1695. if (e[s].hasOwnProperty("listeners"))
  1696. for (var o in e[s].listeners) e[s].listeners.hasOwnProperty(o) && u(o, e[s].listeners[o])
  1697. }
  1698. }
  1699. function u(e, r) {
  1700. if (!x.helper.isString(e)) throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof e + " given");
  1701. if ("function" != typeof r) throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof r + " given");
  1702. o.hasOwnProperty(e) || (o[e] = []), o[e].push(r)
  1703. }
  1704. n.extensions && x.helper.forEach(n.extensions, c), this._dispatch = function(e, r, t, a) {
  1705. if (o.hasOwnProperty(e))
  1706. for (var n = 0; n < o[e].length; ++n) {
  1707. var s = o[e][n](e, r, this, t, a);
  1708. s && void 0 !== s && (r = s)
  1709. }
  1710. return r
  1711. }, this.listen = function(e, r) {
  1712. return u(e, r), this
  1713. }, this.makeHtml = function(r) {
  1714. if (!r) return r;
  1715. var e, t, a = {
  1716. gHtmlBlocks: [],
  1717. gHtmlMdBlocks: [],
  1718. gHtmlSpans: [],
  1719. gUrls: {},
  1720. gTitles: {},
  1721. gDimensions: {},
  1722. gListLevel: 0,
  1723. hashLinkCounts: {},
  1724. langExtensions: i,
  1725. outputModifiers: l,
  1726. converter: this,
  1727. ghCodeBlocks: [],
  1728. metadata: {
  1729. parsed: {},
  1730. raw: "",
  1731. format: ""
  1732. }
  1733. };
  1734. return r = (r = (r = (r = (r = r.replace(/¨/g, "¨T")).replace(/\$/g, "¨D")).replace(/\r\n/g, "\n")).replace(/\r/g, "\n")).replace(/\u00A0/g, "&nbsp;"), n.smartIndentationFix && (t = (e = r).match(/^\s*/)[0].length, t = new RegExp("^\\s{0," + t + "}", "gm"), r = e.replace(t, "")), r = "\n\n" + r + "\n\n", r = (r = x.subParser("detab")(r, n, a)).replace(/^[ \t]+$/gm, ""), x.helper.forEach(i, function(e) {
  1735. r = x.subParser("runExtension")(e, r, n, a)
  1736. }), r = x.subParser("metadata")(r, n, a), r = x.subParser("hashPreCodeTags")(r, n, a), r = x.subParser("githubCodeBlocks")(r, n, a), r = x.subParser("hashHTMLBlocks")(r, n, a), r = x.subParser("hashCodeTags")(r, n, a), r = x.subParser("stripLinkDefinitions")(r, n, a), r = x.subParser("blockGamut")(r, n, a), r = x.subParser("unhashHTMLSpans")(r, n, a), r = (r = (r = x.subParser("unescapeSpecialChars")(r, n, a)).replace(/¨D/g, "$$")).replace(/¨T/g, "¨"), r = x.subParser("completeHTMLDocument")(r, n, a), x.helper.forEach(l, function(e) {
  1737. r = x.subParser("runExtension")(e, r, n, a)
  1738. }), s = a.metadata, r
  1739. }, this.makeMarkdown = this.makeMd = function(e, r) {
  1740. if (e = (e = (e = e.replace(/\r\n/g, "\n")).replace(/\r/g, "\n")).replace(/>[ \t]+</, ">¨NBSP;<"), !r) {
  1741. if (!window || !window.document) throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");
  1742. r = window.document
  1743. }
  1744. for (var r = r.createElement("div"), t = (r.innerHTML = e, {
  1745. preList: function(e) {
  1746. for (var r = e.querySelectorAll("pre"), t = [], a = 0; a < r.length; ++a)
  1747. if (1 === r[a].childElementCount && "code" === r[a].firstChild.tagName.toLowerCase()) {
  1748. var n = r[a].firstChild.innerHTML.trim(),
  1749. s = r[a].firstChild.getAttribute("data-language") || "";
  1750. if ("" === s)
  1751. for (var o = r[a].firstChild.className.split(" "), i = 0; i < o.length; ++i) {
  1752. var l = o[i].match(/^language-(.+)$/);
  1753. if (null !== l) {
  1754. s = l[1];
  1755. break
  1756. }
  1757. }
  1758. n = x.helper.unescapeHTMLEntities(n), t.push(n), r[a].outerHTML = '<precode language="' + s + '" precodenum="' + a.toString() + '"></precode>'
  1759. } else t.push(r[a].innerHTML), r[a].innerHTML = "", r[a].setAttribute("prenum", a.toString());
  1760. return t
  1761. }(r)
  1762. }), a = (! function e(r) {
  1763. for (var t = 0; t < r.childNodes.length; ++t) {
  1764. var a = r.childNodes[t];
  1765. 3 === a.nodeType ? /\S/.test(a.nodeValue) || /^[ ]+$/.test(a.nodeValue) ? (a.nodeValue = a.nodeValue.split("\n").join(" "), a.nodeValue = a.nodeValue.replace(/(\s)+/g, "$1")) : (r.removeChild(a), --t) : 1 === a.nodeType && e(a)
  1766. }
  1767. }(r), r.childNodes), n = "", s = 0; s < a.length; s++) n += x.subParser("makeMarkdown.node")(a[s], t);
  1768. return n
  1769. }, this.setOption = function(e, r) {
  1770. n[e] = r
  1771. }, this.getOption = function(e) {
  1772. return n[e]
  1773. }, this.getOptions = function() {
  1774. return n
  1775. }, this.addExtension = function(e, r) {
  1776. c(e, r = r || null)
  1777. }, this.useExtension = function(e) {
  1778. c(e)
  1779. }, this.setFlavor = function(e) {
  1780. if (!_.hasOwnProperty(e)) throw Error(e + " flavor was not found");
  1781. var r, t = _[e];
  1782. for (r in a = e, t) t.hasOwnProperty(r) && (n[r] = t[r])
  1783. }, this.getFlavor = function() {
  1784. return a
  1785. }, this.removeExtension = function(e) {
  1786. x.helper.isArray(e) || (e = [e]);
  1787. for (var r = 0; r < e.length; ++r) {
  1788. for (var t = e[r], a = 0; a < i.length; ++a) i[a] === t && i.splice(a, 1);
  1789. for (var n = 0; n < l.length; ++n) l[n] === t && l.splice(n, 1)
  1790. }
  1791. }, this.getAllExtensions = function() {
  1792. return {
  1793. language: i,
  1794. output: l
  1795. }
  1796. }, this.getMetadata = function(e) {
  1797. return e ? s.raw : s.parsed
  1798. }, this.getMetadataFormat = function() {
  1799. return s.format
  1800. }, this._setMetadataPair = function(e, r) {
  1801. s.parsed[e] = r
  1802. }, this._setMetadataFormat = function(e) {
  1803. s.format = e
  1804. }, this._setMetadataRaw = function(e) {
  1805. s.raw = e
  1806. }
  1807. }, x.subParser("anchors", function(e, i, l) {
  1808. "use strict";
  1809. function r(e, r, t, a, n, s, o) {
  1810. if (x.helper.isUndefined(o) && (o = ""), t = t.toLowerCase(), -1 < e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)) a = "";
  1811. else if (!a) {
  1812. if (a = "#" + (t = t || r.toLowerCase().replace(/ ?\n/g, " ")), x.helper.isUndefined(l.gUrls[t])) return e;
  1813. a = l.gUrls[t], x.helper.isUndefined(l.gTitles[t]) || (o = l.gTitles[t])
  1814. }
  1815. return e = '<a href="' + (a = a.replace(x.helper.regexes.asteriskDashAndColon, x.helper.escapeCharactersCallback)) + '"', "" !== o && null !== o && (e += ' title="' + (o = (o = o.replace(/"/g, "&quot;")).replace(x.helper.regexes.asteriskDashAndColon, x.helper.escapeCharactersCallback)) + '"'), i.openLinksInNewWindow && !/^#/.test(a) && (e += ' rel="noopener noreferrer" target="¨E95Eblank"'), e += ">" + r + "</a>"
  1816. }
  1817. return e = (e = (e = (e = (e = l.converter._dispatch("anchors.before", e, i, l)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, r)).replace(/\[([^\[\]]+)]()()()()()/g, r), i.ghMentions && (e = e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim, function(e, r, t, a, n) {
  1818. if ("\\" === t) return r + a;
  1819. if (!x.helper.isString(i.ghMentionsLink)) throw new Error("ghMentionsLink option must be a string");
  1820. t = "";
  1821. return r + '<a href="' + i.ghMentionsLink.replace(/\{u}/g, n) + '"' + (t = i.openLinksInNewWindow ? ' rel="noopener noreferrer" target="¨E95Eblank"' : t) + ">" + a + "</a>"
  1822. })), e = l.converter._dispatch("anchors.after", e, i, l)
  1823. });
  1824. var i = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
  1825. l = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
  1826. c = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
  1827. m = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,
  1828. f = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi;
  1829. x.subParser("autoLinks", function(e, r, t) {
  1830. "use strict";
  1831. return e = (e = (e = t.converter._dispatch("autoLinks.before", e, r, t)).replace(c, s(r))).replace(f, o(r, t)), e = t.converter._dispatch("autoLinks.after", e, r, t)
  1832. }), x.subParser("simplifiedAutoLinks", function(e, r, t) {
  1833. "use strict";
  1834. return r.simplifiedAutoLink ? (e = t.converter._dispatch("simplifiedAutoLinks.before", e, r, t), e = (e = r.excludeTrailingPunctuationFromURLs ? e.replace(l, s(r)) : e.replace(i, s(r))).replace(m, o(r, t)), t.converter._dispatch("simplifiedAutoLinks.after", e, r, t)) : e
  1835. }), x.subParser("blockGamut", function(e, r, t) {
  1836. "use strict";
  1837. return e = t.converter._dispatch("blockGamut.before", e, r, t), e = x.subParser("blockQuotes")(e, r, t), e = x.subParser("headers")(e, r, t), e = x.subParser("horizontalRule")(e, r, t), e = x.subParser("lists")(e, r, t), e = x.subParser("codeBlocks")(e, r, t), e = x.subParser("tables")(e, r, t), e = x.subParser("hashHTMLBlocks")(e, r, t), e = x.subParser("paragraphs")(e, r, t), e = t.converter._dispatch("blockGamut.after", e, r, t)
  1838. }), x.subParser("blockQuotes", function(e, r, t) {
  1839. "use strict";
  1840. e = t.converter._dispatch("blockQuotes.before", e, r, t);
  1841. var a = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
  1842. return r.splitAdjacentBlockquotes && (a = /^ {0,3}>[\s\S]*?(?:\n\n)/gm), e = (e += "\n\n").replace(a, function(e) {
  1843. return e = (e = (e = e.replace(/^[ \t]*>[ \t]?/gm, "")).replace(/¨0/g, "")).replace(/^[ \t]+$/gm, ""), e = x.subParser("githubCodeBlocks")(e, r, t), e = (e = (e = x.subParser("blockGamut")(e, r, t)).replace(/(^|\n)/g, "$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(e, r) {
  1844. return r.replace(/^ /gm, "¨0").replace(/¨0/g, "")
  1845. }), x.subParser("hashBlock")("<blockquote>\n" + e + "\n</blockquote>", r, t)
  1846. }), e = t.converter._dispatch("blockQuotes.after", e, r, t)
  1847. }), x.subParser("codeBlocks", function(e, n, s) {
  1848. "use strict";
  1849. e = s.converter._dispatch("codeBlocks.before", e, n, s);
  1850. return e = (e = (e += "¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g, function(e, r, t) {
  1851. var a = "\n",
  1852. r = x.subParser("outdent")(r, n, s);
  1853. return r = x.subParser("encodeCode")(r, n, s), r = "<pre><code>" + (r = (r = (r = x.subParser("detab")(r, n, s)).replace(/^\n+/g, "")).replace(/\n+$/g, "")) + (a = n.omitExtraWLInCodeBlocks ? "" : a) + "</code></pre>", x.subParser("hashBlock")(r, n, s) + t
  1854. })).replace(/¨0/, ""), e = s.converter._dispatch("codeBlocks.after", e, n, s)
  1855. }), x.subParser("codeSpans", function(e, n, s) {
  1856. "use strict";
  1857. return e = (e = void 0 === (e = s.converter._dispatch("codeSpans.before", e, n, s)) ? "" : e).replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(e, r, t, a) {
  1858. return a = (a = a.replace(/^([ \t]*)/g, "")).replace(/[ \t]*$/g, ""), a = r + "<code>" + (a = x.subParser("encodeCode")(a, n, s)) + "</code>", a = x.subParser("hashHTMLSpans")(a, n, s)
  1859. }), e = s.converter._dispatch("codeSpans.after", e, n, s)
  1860. }), x.subParser("completeHTMLDocument", function(e, r, t) {
  1861. "use strict";
  1862. if (!r.completeHTMLDocument) return e;
  1863. e = t.converter._dispatch("completeHTMLDocument.before", e, r, t);
  1864. var a, n = "html",
  1865. s = "<!DOCTYPE HTML>\n",
  1866. o = "",
  1867. i = '<meta charset="utf-8">\n',
  1868. l = "",
  1869. c = "";
  1870. for (a in void 0 !== t.metadata.parsed.doctype && (s = "<!DOCTYPE " + t.metadata.parsed.doctype + ">\n", "html" !== (n = t.metadata.parsed.doctype.toString().toLowerCase()) && "html5" !== n || (i = '<meta charset="utf-8">')), t.metadata.parsed)
  1871. if (t.metadata.parsed.hasOwnProperty(a)) switch (a.toLowerCase()) {
  1872. case "doctype":
  1873. break;
  1874. case "title":
  1875. o = "<title>" + t.metadata.parsed.title + "</title>\n";
  1876. break;
  1877. case "charset":
  1878. i = "html" === n || "html5" === n ? '<meta charset="' + t.metadata.parsed.charset + '">\n' : '<meta name="charset" content="' + t.metadata.parsed.charset + '">\n';
  1879. break;
  1880. case "language":
  1881. case "lang":
  1882. l = ' lang="' + t.metadata.parsed[a] + '"', c += '<meta name="' + a + '" content="' + t.metadata.parsed[a] + '">\n';
  1883. break;
  1884. default:
  1885. c += '<meta name="' + a + '" content="' + t.metadata.parsed[a] + '">\n'
  1886. }
  1887. return e = s + "<html" + l + ">\n<head>\n" + o + i + c + "</head>\n<body>\n" + e.trim() + "\n</body>\n</html>", e = t.converter._dispatch("completeHTMLDocument.after", e, r, t)
  1888. }), x.subParser("detab", function(e, r, t) {
  1889. "use strict";
  1890. return e = (e = (e = (e = (e = (e = t.converter._dispatch("detab.before", e, r, t)).replace(/\t(?=\t)/g, " ")).replace(/\t/g, "¨A¨B")).replace(/¨B(.+?)¨A/g, function(e, r) {
  1891. for (var t = r, a = 4 - t.length % 4, n = 0; n < a; n++) t += " ";
  1892. return t
  1893. })).replace(/¨A/g, " ")).replace(/¨B/g, ""), e = t.converter._dispatch("detab.after", e, r, t)
  1894. }), x.subParser("ellipsis", function(e, r, t) {
  1895. "use strict";
  1896. return r.ellipsis ? (e = (e = t.converter._dispatch("ellipsis.before", e, r, t)).replace(/\.\.\./g, "…"), t.converter._dispatch("ellipsis.after", e, r, t)) : e
  1897. }), x.subParser("emoji", function(e, r, t) {
  1898. "use strict";
  1899. if (!r.emoji) return e;
  1900. return e = (e = t.converter._dispatch("emoji.before", e, r, t)).replace(/:([\S]+?):/g, function(e, r) {
  1901. return x.helper.emojis.hasOwnProperty(r) ? x.helper.emojis[r] : e
  1902. }), e = t.converter._dispatch("emoji.after", e, r, t)
  1903. }), x.subParser("encodeAmpsAndAngles", function(e, r, t) {
  1904. "use strict";
  1905. return e = (e = (e = (e = (e = t.converter._dispatch("encodeAmpsAndAngles.before", e, r, t)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;")).replace(/<(?![a-z\/?$!])/gi, "&lt;")).replace(/</g, "&lt;")).replace(/>/g, "&gt;"), e = t.converter._dispatch("encodeAmpsAndAngles.after", e, r, t)
  1906. }), x.subParser("encodeBackslashEscapes", function(e, r, t) {
  1907. "use strict";
  1908. return e = (e = (e = t.converter._dispatch("encodeBackslashEscapes.before", e, r, t)).replace(/\\(\\)/g, x.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g, x.helper.escapeCharactersCallback), e = t.converter._dispatch("encodeBackslashEscapes.after", e, r, t)
  1909. }), x.subParser("encodeCode", function(e, r, t) {
  1910. "use strict";
  1911. return e = (e = t.converter._dispatch("encodeCode.before", e, r, t)).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/([*_{}\[\]\\=~-])/g, x.helper.escapeCharactersCallback), e = t.converter._dispatch("encodeCode.after", e, r, t)
  1912. }), x.subParser("escapeSpecialCharsWithinTagAttributes", function(e, r, t) {
  1913. "use strict";
  1914. return e = (e = (e = t.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", e, r, t)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, function(e) {
  1915. return e.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, x.helper.escapeCharactersCallback)
  1916. })).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi, function(e) {
  1917. return e.replace(/([\\`*_~=|])/g, x.helper.escapeCharactersCallback)
  1918. }), e = t.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", e, r, t)
  1919. }), x.subParser("githubCodeBlocks", function(e, s, o) {
  1920. "use strict";
  1921. return s.ghCodeBlocks ? (e = o.converter._dispatch("githubCodeBlocks.before", e, s, o), e = (e = (e += "¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function(e, r, t, a) {
  1922. var n = s.omitExtraWLInCodeBlocks ? "" : "\n";
  1923. return a = x.subParser("encodeCode")(a, s, o), a = "<pre><code" + (t ? ' class="' + t + " language-" + t + '"' : "") + ">" + (a = (a = (a = x.subParser("detab")(a, s, o)).replace(/^\n+/g, "")).replace(/\n+$/g, "")) + n + "</code></pre>", a = x.subParser("hashBlock")(a, s, o), "\n\n¨G" + (o.ghCodeBlocks.push({
  1924. text: e,
  1925. codeblock: a
  1926. }) - 1) + "G\n\n"
  1927. })).replace(/¨0/, ""), o.converter._dispatch("githubCodeBlocks.after", e, s, o)) : e
  1928. }), x.subParser("hashBlock", function(e, r, t) {
  1929. "use strict";
  1930. return e = (e = t.converter._dispatch("hashBlock.before", e, r, t)).replace(/(^\n+|\n+$)/g, ""), e = "\n\n¨K" + (t.gHtmlBlocks.push(e) - 1) + "K\n\n", e = t.converter._dispatch("hashBlock.after", e, r, t)
  1931. }), x.subParser("hashCodeTags", function(e, n, s) {
  1932. "use strict";
  1933. e = s.converter._dispatch("hashCodeTags.before", e, n, s);
  1934. return e = x.helper.replaceRecursiveRegExp(e, function(e, r, t, a) {
  1935. t = t + x.subParser("encodeCode")(r, n, s) + a;
  1936. return "¨C" + (s.gHtmlSpans.push(t) - 1) + "C"
  1937. }, "<code\\b[^>]*>", "</code>", "gim"), e = s.converter._dispatch("hashCodeTags.after", e, n, s)
  1938. }), x.subParser("hashElement", function(e, r, t) {
  1939. "use strict";
  1940. return function(e, r) {
  1941. return r = (r = (r = r.replace(/\n\n/g, "\n")).replace(/^\n/, "")).replace(/\n+$/g, ""), r = "\n\n¨K" + (t.gHtmlBlocks.push(r) - 1) + "K\n\n"
  1942. }
  1943. }), x.subParser("hashHTMLBlocks", function(e, r, n) {
  1944. "use strict";
  1945. e = n.converter._dispatch("hashHTMLBlocks.before", e, r, n);
  1946. function t(e, r, t, a) {
  1947. return -1 !== t.search(/\bmarkdown\b/) && (e = t + n.converter.makeHtml(r) + a), "\n\n¨K" + (n.gHtmlBlocks.push(e) - 1) + "K\n\n"
  1948. }
  1949. var a = ["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"];
  1950. r.backslashEscapesHTMLTags && (e = e.replace(/\\<(\/?[^>]+?)>/g, function(e, r) {
  1951. return "&lt;" + r + "&gt;"
  1952. }));
  1953. for (var s = 0; s < a.length; ++s)
  1954. for (var o = new RegExp("^ {0,3}(<" + a[s] + "\\b[^>]*>)", "im"), i = "<" + a[s] + "\\b[^>]*>", u = "</" + a[s] + ">"; - 1 !== (l = x.helper.regexIndexOf(e, o));) {
  1955. var l = x.helper.splitAtIndex(e, l),
  1956. c = x.helper.replaceRecursiveRegExp(l[1], t, i, u, "im");
  1957. if (c === l[1]) break;
  1958. e = l[0].concat(c)
  1959. }
  1960. return e = e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, x.subParser("hashElement")(e, r, n)), e = (e = x.helper.replaceRecursiveRegExp(e, function(e) {
  1961. return "\n\n¨K" + (n.gHtmlBlocks.push(e) - 1) + "K\n\n"
  1962. }, "^ {0,3}\x3c!--", "--\x3e", "gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, x.subParser("hashElement")(e, r, n)), e = n.converter._dispatch("hashHTMLBlocks.after", e, r, n)
  1963. }), x.subParser("hashHTMLSpans", function(e, r, t) {
  1964. "use strict";
  1965. function a(e) {
  1966. return "¨C" + (t.gHtmlSpans.push(e) - 1) + "C"
  1967. }
  1968. return e = (e = (e = (e = (e = t.converter._dispatch("hashHTMLSpans.before", e, r, t)).replace(/<[^>]+?\/>/gi, a)).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, a)).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, a)).replace(/<[^>]+?>/gi, a), e = t.converter._dispatch("hashHTMLSpans.after", e, r, t)
  1969. }), x.subParser("unhashHTMLSpans", function(e, r, t) {
  1970. "use strict";
  1971. e = t.converter._dispatch("unhashHTMLSpans.before", e, r, t);
  1972. for (var a = 0; a < t.gHtmlSpans.length; ++a) {
  1973. for (var n = t.gHtmlSpans[a], s = 0;
  1974. /¨C(\d+)C/.test(n);) {
  1975. var o = RegExp.$1,
  1976. n = n.replace("¨C" + o + "C", t.gHtmlSpans[o]);
  1977. if (10 === s) {
  1978. console.error("maximum nesting of 10 spans reached!!!");
  1979. break
  1980. }++s
  1981. }
  1982. e = e.replace("¨C" + a + "C", n)
  1983. }
  1984. return e = t.converter._dispatch("unhashHTMLSpans.after", e, r, t)
  1985. }), x.subParser("hashPreCodeTags", function(e, n, s) {
  1986. "use strict";
  1987. e = s.converter._dispatch("hashPreCodeTags.before", e, n, s);
  1988. return e = x.helper.replaceRecursiveRegExp(e, function(e, r, t, a) {
  1989. t = t + x.subParser("encodeCode")(r, n, s) + a;
  1990. return "\n\n¨G" + (s.ghCodeBlocks.push({
  1991. text: e,
  1992. codeblock: t
  1993. }) - 1) + "G\n\n"
  1994. }, "^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>", "^ {0,3}</code>\\s*</pre>", "gim"), e = s.converter._dispatch("hashPreCodeTags.after", e, n, s)
  1995. }), x.subParser("headers", function(e, n, s) {
  1996. "use strict";
  1997. e = s.converter._dispatch("headers.before", e, n, s);
  1998. var o = isNaN(parseInt(n.headerLevelStart)) ? 1 : parseInt(n.headerLevelStart),
  1999. r = n.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
  2000. t = n.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm,
  2001. r = (e = (e = e.replace(r, function(e, r) {
  2002. var t = x.subParser("spanGamut")(r, n, s),
  2003. r = n.noHeaderId ? "" : ' id="' + i(r) + '"',
  2004. r = "<h" + o + r + ">" + t + "</h" + o + ">";
  2005. return x.subParser("hashBlock")(r, n, s)
  2006. })).replace(t, function(e, r) {
  2007. var t = x.subParser("spanGamut")(r, n, s),
  2008. r = n.noHeaderId ? "" : ' id="' + i(r) + '"',
  2009. a = o + 1,
  2010. r = "<h" + a + r + ">" + t + "</h" + a + ">";
  2011. return x.subParser("hashBlock")(r, n, s)
  2012. }), n.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm);
  2013. function i(e) {
  2014. var r;
  2015. return !n.customizedHeaderId || (r = e.match(/\{([^{]+?)}\s*$/)) && r[1] && (e = r[1]), r = e, e = x.helper.isString(n.prefixHeaderId) ? n.prefixHeaderId : !0 === n.prefixHeaderId ? "section-" : "", n.rawPrefixHeaderId || (r = e + r), r = (n.ghCompatibleHeaderId ? r.replace(/ /g, "-").replace(/&amp;/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "") : n.rawHeaderId ? r.replace(/ /g, "-").replace(/&amp;/g, "&").replace(/¨T/g, "¨").replace(/¨D/g, "$").replace(/["']/g, "-") : r.replace(/[^\w]/g, "")).toLowerCase(), n.rawPrefixHeaderId && (r = e + r), s.hashLinkCounts[r] ? r = r + "-" + s.hashLinkCounts[r]++ : s.hashLinkCounts[r] = 1, r
  2016. }
  2017. return e = e.replace(r, function(e, r, t) {
  2018. var a = t,
  2019. a = (n.customizedHeaderId && (a = t.replace(/\s?\{([^{]+?)}\s*$/, "")), x.subParser("spanGamut")(a, n, s)),
  2020. t = n.noHeaderId ? "" : ' id="' + i(t) + '"',
  2021. r = o - 1 + r.length,
  2022. t = "<h" + r + t + ">" + a + "</h" + r + ">";
  2023. return x.subParser("hashBlock")(t, n, s)
  2024. }), e = s.converter._dispatch("headers.after", e, n, s)
  2025. }), x.subParser("horizontalRule", function(e, r, t) {
  2026. "use strict";
  2027. e = t.converter._dispatch("horizontalRule.before", e, r, t);
  2028. var a = x.subParser("hashBlock")("<hr />", r, t);
  2029. return e = (e = (e = e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, a)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, a)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, a), e = t.converter._dispatch("horizontalRule.after", e, r, t)
  2030. }), x.subParser("images", function(e, r, d) {
  2031. "use strict";
  2032. function l(e, r, t, a, n, s, u, o) {
  2033. var i = d.gUrls,
  2034. l = d.gTitles,
  2035. c = d.gDimensions;
  2036. if (t = t.toLowerCase(), o = o || "", -1 < e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)) a = "";
  2037. else if ("" === a || null === a) {
  2038. if (a = "#" + (t = "" !== t && null !== t ? t : r.toLowerCase().replace(/ ?\n/g, " ")), x.helper.isUndefined(i[t])) return e;
  2039. a = i[t], x.helper.isUndefined(l[t]) || (o = l[t]), x.helper.isUndefined(c[t]) || (n = c[t].width, s = c[t].height)
  2040. }
  2041. r = r.replace(/"/g, "&quot;").replace(x.helper.regexes.asteriskDashAndColon, x.helper.escapeCharactersCallback);
  2042. e = '<img src="' + (a = a.replace(x.helper.regexes.asteriskDashAndColon, x.helper.escapeCharactersCallback)) + '" alt="' + r + '"';
  2043. return o && x.helper.isString(o) && (e += ' title="' + (o = o.replace(/"/g, "&quot;").replace(x.helper.regexes.asteriskDashAndColon, x.helper.escapeCharactersCallback)) + '"'), n && s && (e = e + (' width="' + (n = "*" === n ? "auto" : n)) + '" height="' + (s = "*" === s ? "auto" : s) + '"'), e += " />"
  2044. }
  2045. return e = (e = (e = (e = (e = (e = d.converter._dispatch("images.before", e, r, d)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, l)).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(e, r, t, a, n, s, o, i) {
  2046. return l(e, r, t, a = a.replace(/\s/g, ""), n, s, 0, i)
  2047. })).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, l)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, l)).replace(/!\[([^\[\]]+)]()()()()()/g, l), e = d.converter._dispatch("images.after", e, r, d)
  2048. }), x.subParser("italicsAndBold", function(e, r, t) {
  2049. "use strict";
  2050. return e = t.converter._dispatch("italicsAndBold.before", e, r, t), e = r.literalMidWordUnderscores ? (e = (e = e.replace(/\b___(\S[\s\S]*?)___\b/g, function(e, r) {
  2051. return "<strong><em>" + r + "</em></strong>"
  2052. })).replace(/\b__(\S[\s\S]*?)__\b/g, function(e, r) {
  2053. return "<strong>" + r + "</strong>"
  2054. })).replace(/\b_(\S[\s\S]*?)_\b/g, function(e, r) {
  2055. return "<em>" + r + "</em>"
  2056. }) : (e = (e = e.replace(/___(\S[\s\S]*?)___/g, function(e, r) {
  2057. return /\S$/.test(r) ? "<strong><em>" + r + "</em></strong>" : e
  2058. })).replace(/__(\S[\s\S]*?)__/g, function(e, r) {
  2059. return /\S$/.test(r) ? "<strong>" + r + "</strong>" : e
  2060. })).replace(/_([^\s_][\s\S]*?)_/g, function(e, r) {
  2061. return /\S$/.test(r) ? "<em>" + r + "</em>" : e
  2062. }), e = r.literalMidWordAsterisks ? (e = (e = e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function(e, r, t) {
  2063. return r + "<strong><em>" + t + "</em></strong>"
  2064. })).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function(e, r, t) {
  2065. return r + "<strong>" + t + "</strong>"
  2066. })).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function(e, r, t) {
  2067. return r + "<em>" + t + "</em>"
  2068. }) : (e = (e = e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function(e, r) {
  2069. return /\S$/.test(r) ? "<strong><em>" + r + "</em></strong>" : e
  2070. })).replace(/\*\*(\S[\s\S]*?)\*\*/g, function(e, r) {
  2071. return /\S$/.test(r) ? "<strong>" + r + "</strong>" : e
  2072. })).replace(/\*([^\s*][\s\S]*?)\*/g, function(e, r) {
  2073. return /\S$/.test(r) ? "<em>" + r + "</em>" : e
  2074. }), e = t.converter._dispatch("italicsAndBold.after", e, r, t)
  2075. }), x.subParser("lists", function(e, d, c) {
  2076. "use strict";
  2077. function p(e, r) {
  2078. c.gListLevel++, e = e.replace(/\n{2,}$/, "\n");
  2079. var t = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
  2080. l = /\n[ \t]*\n(?!¨0)/.test(e += "¨0");
  2081. return d.disableForced4SpacesIndentedSublists && (t = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm), e = (e = e.replace(t, function(e, r, t, a, n, s, o) {
  2082. o = o && "" !== o.trim();
  2083. var n = x.subParser("outdent")(n, d, c),
  2084. i = "";
  2085. return s && d.tasklists && (i = ' class="task-list-item" style="list-style-type: none;"', n = n.replace(/^[ \t]*\[(x|X| )?]/m, function() {
  2086. var e = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
  2087. return o && (e += " checked"), e += ">"
  2088. })), n = n.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function(e) {
  2089. return "¨A" + e
  2090. }), n = "<li" + i + ">" + (n = (n = r || -1 < n.search(/\n{2,}/) ? (n = x.subParser("githubCodeBlocks")(n, d, c), x.subParser("blockGamut")(n, d, c)) : (n = (n = x.subParser("lists")(n, d, c)).replace(/\n$/, ""), n = (n = x.subParser("hashHTMLBlocks")(n, d, c)).replace(/\n\n+/g, "\n\n"), (l ? x.subParser("paragraphs") : x.subParser("spanGamut"))(n, d, c))).replace("¨A", "")) + "</li>\n"
  2091. })).replace(/¨0/g, ""), c.gListLevel--, e = r ? e.replace(/\s+$/, "") : e
  2092. }
  2093. function h(e, r) {
  2094. if ("ol" === r) {
  2095. r = e.match(/^ *(\d+)\./);
  2096. if (r && "1" !== r[1]) return ' start="' + r[1] + '"'
  2097. }
  2098. return ""
  2099. }
  2100. function n(n, s, o) {
  2101. var e, i = d.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm,
  2102. l = d.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm,
  2103. c = "ul" === s ? i : l,
  2104. u = "";
  2105. return -1 !== n.search(c) ? function e(r) {
  2106. var t = r.search(c),
  2107. a = h(n, s); - 1 !== t ? (u += "\n\n<" + s + a + ">\n" + p(r.slice(0, t), !!o) + "</" + s + ">\n", c = "ul" === (s = "ul" === s ? "ol" : "ul") ? i : l, e(r.slice(t))) : u += "\n\n<" + s + a + ">\n" + p(r, !!o) + "</" + s + ">\n"
  2108. }(n) : (e = h(n, s), u = "\n\n<" + s + e + ">\n" + p(n, !!o) + "</" + s + ">\n"), u
  2109. }
  2110. return e = c.converter._dispatch("lists.before", e, d, c), e += "¨0", e = (e = c.gListLevel ? e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, function(e, r, t) {
  2111. return n(r, -1 < t.search(/[*+-]/g) ? "ul" : "ol", !0)
  2112. }) : e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, function(e, r, t, a) {
  2113. return n(t, -1 < a.search(/[*+-]/g) ? "ul" : "ol", !1)
  2114. })).replace(/¨0/, ""), e = c.converter._dispatch("lists.after", e, d, c)
  2115. }), x.subParser("metadata", function(e, r, a) {
  2116. "use strict";
  2117. return r.metadata ? (e = (e = (e = (e = a.converter._dispatch("metadata.before", e, r, a)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function(e, r, t) {
  2118. return n(t), "¨M"
  2119. })).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function(e, r, t) {
  2120. return r && (a.metadata.format = r), n(t), "¨M"
  2121. })).replace(/¨M/g, ""), a.converter._dispatch("metadata.after", e, r, a)) : e;
  2122. function n(e) {
  2123. (e = (e = (a.metadata.raw = e).replace(/&/g, "&amp;").replace(/"/g, "&quot;")).replace(/\n {4}/g, " ")).replace(/^([\S ]+): +([\s\S]+?)$/gm, function(e, r, t) {
  2124. return a.metadata.parsed[r] = t, ""
  2125. })
  2126. }
  2127. }), x.subParser("outdent", function(e, r, t) {
  2128. "use strict";
  2129. return e = (e = (e = t.converter._dispatch("outdent.before", e, r, t)).replace(/^(\t|[ ]{1,4})/gm, "¨0")).replace(/¨0/g, ""), e = t.converter._dispatch("outdent.after", e, r, t)
  2130. }), x.subParser("paragraphs", function(e, r, t) {
  2131. "use strict";
  2132. for (var u = (e = (e = (e = t.converter._dispatch("paragraphs.before", e, r, t)).replace(/^\n+/g, "")).replace(/\n+$/g, "")).split(/\n{2,}/g), a = [], n = u.length, s = 0; s < n; s++) {
  2133. var o = u[s];
  2134. 0 <= o.search(/¨(K|G)(\d+)\1/g) ? a.push(o) : 0 <= o.search(/\S/) && (o = (o = x.subParser("spanGamut")(o, r, t)).replace(/^([ \t]*)/g, "<p>"), o += "</p>", a.push(o))
  2135. }
  2136. for (n = a.length, s = 0; s < n; s++) {
  2137. for (var i = "", l = a[s], d = !1;
  2138. /¨(K|G)(\d+)\1/.test(l);) {
  2139. var p = RegExp.$1,
  2140. c = RegExp.$2;
  2141. i = (i = "K" === p ? t.gHtmlBlocks[c] : d ? x.subParser("encodeCode")(t.ghCodeBlocks[c].text, r, t) : t.ghCodeBlocks[c].codeblock).replace(/\$/g, "$$$$"), l = l.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, i), /^<pre\b[^>]*>\s*<code\b[^>]*>/.test(l) && (d = !0)
  2142. }
  2143. a[s] = l
  2144. }
  2145. return e = (e = (e = a.join("\n")).replace(/^\n+/g, "")).replace(/\n+$/g, ""), t.converter._dispatch("paragraphs.after", e, r, t)
  2146. }), x.subParser("runExtension", function(e, r, t, a) {
  2147. "use strict";
  2148. return e.filter ? r = e.filter(r, a.converter, t) : e.regex && ((a = e.regex) instanceof RegExp || (a = new RegExp(a, "g")), r = r.replace(a, e.replace)), r
  2149. }), x.subParser("spanGamut", function(e, r, t) {
  2150. "use strict";
  2151. return e = t.converter._dispatch("spanGamut.before", e, r, t), e = x.subParser("codeSpans")(e, r, t), e = x.subParser("escapeSpecialCharsWithinTagAttributes")(e, r, t), e = x.subParser("encodeBackslashEscapes")(e, r, t), e = x.subParser("images")(e, r, t), e = x.subParser("anchors")(e, r, t), e = x.subParser("autoLinks")(e, r, t), e = x.subParser("simplifiedAutoLinks")(e, r, t), e = x.subParser("emoji")(e, r, t), e = x.subParser("underline")(e, r, t), e = x.subParser("italicsAndBold")(e, r, t), e = x.subParser("strikethrough")(e, r, t), e = x.subParser("ellipsis")(e, r, t), e = x.subParser("hashHTMLSpans")(e, r, t), e = x.subParser("encodeAmpsAndAngles")(e, r, t), r.simpleLineBreaks ? /\n\n¨K/.test(e) || (e = e.replace(/\n+/g, "<br />\n")) : e = e.replace(/ +\n/g, "<br />\n"), e = t.converter._dispatch("spanGamut.after", e, r, t)
  2152. }), x.subParser("strikethrough", function(e, t, a) {
  2153. "use strict";
  2154. return t.strikethrough && (e = (e = a.converter._dispatch("strikethrough.before", e, t, a)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function(e, r) {
  2155. return r = r, "<del>" + (r = t.simplifiedAutoLink ? x.subParser("simplifiedAutoLinks")(r, t, a) : r) + "</del>"
  2156. }), e = a.converter._dispatch("strikethrough.after", e, t, a)), e
  2157. }), x.subParser("stripLinkDefinitions", function(i, l, c) {
  2158. "use strict";
  2159. function e(e, r, t, a, n, s, o) {
  2160. return r = r.toLowerCase(), i.toLowerCase().split(r).length - 1 < 2 ? e : (t.match(/^data:.+?\/.+?;base64,/) ? c.gUrls[r] = t.replace(/\s/g, "") : c.gUrls[r] = x.subParser("encodeAmpsAndAngles")(t, l, c), s ? s + o : (o && (c.gTitles[r] = o.replace(/"|'/g, "&quot;")), l.parseImgDimensions && a && n && (c.gDimensions[r] = {
  2161. width: a,
  2162. height: n
  2163. }), ""))
  2164. }
  2165. return i = (i = (i = (i += "¨0").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|(?=¨0)|(?=\n\[))/gm, e)).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, e)).replace(/¨0/, "")
  2166. }), x.subParser("tables", function(e, y, P) {
  2167. "use strict";
  2168. if (!y.tables) return e;
  2169. function r(u) {
  2170. for (var e = u.split("\n"), r = 0; r < e.length; ++r) /^ {0,3}\|/.test(e[r]) && (e[r] = e[r].replace(/^ {0,3}\|/, "")), /\|[ \t]*$/.test(e[r]) && (e[r] = e[r].replace(/\|[ \t]*$/, "")), e[r] = x.subParser("codeSpans")(e[r], y, P);
  2171. var t, a, d, n, p, h = e[0].split("|").map(function(e) {
  2172. return e.trim()
  2173. }),
  2174. _ = e[1].split("|").map(function(e) {
  2175. return e.trim()
  2176. }),
  2177. s = [],
  2178. g = [],
  2179. o = [],
  2180. m = [];
  2181. for (e.shift(), e.shift(), r = 0; r < e.length; ++r) "" !== e[r].trim() && s.push(e[r].split("|").map(function(e) {
  2182. return e.trim()
  2183. }));
  2184. if (h.length < _.length) return u;
  2185. for (r = 0; r < _.length; ++r) o.push((t = _[r], /^:[ \t]*--*$/.test(t) ? ' style="text-align:left;"' : /^--*[ \t]*:[ \t]*$/.test(t) ? ' style="text-align:right;"' : /^:[ \t]*--*[ \t]*:$/.test(t) ? ' style="text-align:center;"' : ""));
  2186. for (r = 0; r < h.length; ++r) x.helper.isUndefined(o[r]) && (o[r] = ""), g.push((a = h[r], d = o[r], void 0, n = "", a = a.trim(), "<th" + (n = y.tablesHeaderId || y.tableHeaderId ? ' id="' + a.replace(/ /g, "_").toLowerCase() + '"' : n) + d + ">" + (a = x.subParser("spanGamut")(a, y, P)) + "</th>\n"));
  2187. for (r = 0; r < s.length; ++r) {
  2188. for (var f = [], i = 0; i < g.length; ++i) x.helper.isUndefined(s[r][i]), f.push((p = s[r][i], "<td" + o[i] + ">" + x.subParser("spanGamut")(p, y, P) + "</td>\n"));
  2189. m.push(f)
  2190. }
  2191. for (var b = g, w = m, l = "<table>\n<thead>\n<tr>\n", k = b.length, c = 0; c < k; ++c) l += b[c];
  2192. for (l += "</tr>\n</thead>\n<tbody>\n", c = 0; c < w.length; ++c) {
  2193. l += "<tr>\n";
  2194. for (var v = 0; v < k; ++v) l += w[c][v];
  2195. l += "</tr>\n"
  2196. }
  2197. return l += "</tbody>\n</table>\n"
  2198. }
  2199. return e = (e = (e = (e = P.converter._dispatch("tables.before", e, y, P)).replace(/\\(\|)/g, x.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, r)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm, r), e = P.converter._dispatch("tables.after", e, y, P)
  2200. }), x.subParser("underline", function(e, r, t) {
  2201. "use strict";
  2202. return r.underline ? (e = t.converter._dispatch("underline.before", e, r, t), e = (e = r.literalMidWordUnderscores ? (e = e.replace(/\b___(\S[\s\S]*?)___\b/g, function(e, r) {
  2203. return "<u>" + r + "</u>"
  2204. })).replace(/\b__(\S[\s\S]*?)__\b/g, function(e, r) {
  2205. return "<u>" + r + "</u>"
  2206. }) : (e = e.replace(/___(\S[\s\S]*?)___/g, function(e, r) {
  2207. return /\S$/.test(r) ? "<u>" + r + "</u>" : e
  2208. })).replace(/__(\S[\s\S]*?)__/g, function(e, r) {
  2209. return /\S$/.test(r) ? "<u>" + r + "</u>" : e
  2210. })).replace(/(_)/g, x.helper.escapeCharactersCallback), t.converter._dispatch("underline.after", e, r, t)) : e
  2211. }), x.subParser("unescapeSpecialChars", function(e, r, t) {
  2212. "use strict";
  2213. return e = (e = t.converter._dispatch("unescapeSpecialChars.before", e, r, t)).replace(/¨E(\d+)E/g, function(e, r) {
  2214. r = parseInt(r);
  2215. return String.fromCharCode(r)
  2216. }), e = t.converter._dispatch("unescapeSpecialChars.after", e, r, t)
  2217. }), x.subParser("makeMarkdown.blockquote", function(e, r) {
  2218. "use strict";
  2219. var t = "";
  2220. if (e.hasChildNodes())
  2221. for (var a = e.childNodes, n = a.length, s = 0; s < n; ++s) {
  2222. var o = x.subParser("makeMarkdown.node")(a[s], r);
  2223. "" !== o && (t += o)
  2224. }
  2225. return t = "> " + (t = t.trim()).split("\n").join("\n> ")
  2226. }), x.subParser("makeMarkdown.codeBlock", function(e, r) {
  2227. "use strict";
  2228. var t = e.getAttribute("language"),
  2229. e = e.getAttribute("precodenum");
  2230. return "```" + t + "\n" + r.preList[e] + "\n```"
  2231. }), x.subParser("makeMarkdown.codeSpan", function(e) {
  2232. "use strict";
  2233. return "`" + e.innerHTML + "`"
  2234. }), x.subParser("makeMarkdown.emphasis", function(e, r) {
  2235. "use strict";
  2236. var t = "";
  2237. if (e.hasChildNodes()) {
  2238. t += "*";
  2239. for (var a = e.childNodes, n = a.length, s = 0; s < n; ++s) t += x.subParser("makeMarkdown.node")(a[s], r);
  2240. t += "*"
  2241. }
  2242. return t
  2243. }), x.subParser("makeMarkdown.header", function(e, r, t) {
  2244. "use strict";
  2245. var t = new Array(t + 1).join("#"),
  2246. a = "";
  2247. if (e.hasChildNodes())
  2248. for (var a = t + " ", n = e.childNodes, s = n.length, o = 0; o < s; ++o) a += x.subParser("makeMarkdown.node")(n[o], r);
  2249. return a
  2250. }), x.subParser("makeMarkdown.hr", function() {
  2251. "use strict";
  2252. return "---"
  2253. }), x.subParser("makeMarkdown.image", function(e) {
  2254. "use strict";
  2255. var r = "";
  2256. return e.hasAttribute("src") && (r = (r += "![" + e.getAttribute("alt") + "](") + "<" + e.getAttribute("src") + ">", e.hasAttribute("width") && e.hasAttribute("height") && (r += " =" + e.getAttribute("width") + "x" + e.getAttribute("height")), e.hasAttribute("title") && (r += ' "' + e.getAttribute("title") + '"'), r += ")"), r
  2257. }), x.subParser("makeMarkdown.links", function(e, r) {
  2258. "use strict";
  2259. var t = "";
  2260. if (e.hasChildNodes() && e.hasAttribute("href")) {
  2261. for (var a = e.childNodes, n = a.length, t = "[", s = 0; s < n; ++s) t += x.subParser("makeMarkdown.node")(a[s], r);
  2262. t = (t += "](") + ("<" + e.getAttribute("href") + ">"), e.hasAttribute("title") && (t += ' "' + e.getAttribute("title") + '"'), t += ")"
  2263. }
  2264. return t
  2265. }), x.subParser("makeMarkdown.list", function(e, r, t) {
  2266. "use strict";
  2267. var a = "";
  2268. if (!e.hasChildNodes()) return "";
  2269. for (var n = e.childNodes, s = n.length, o = e.getAttribute("start") || 1, i = 0; i < s; ++i) void 0 !== n[i].tagName && "li" === n[i].tagName.toLowerCase() && (a += ("ol" === t ? o.toString() + ". " : "- ") + x.subParser("makeMarkdown.listItem")(n[i], r), ++o);
  2270. return (a += "\n\x3c!-- --\x3e\n").trim()
  2271. }), x.subParser("makeMarkdown.listItem", function(e, r) {
  2272. "use strict";
  2273. for (var t = "", a = e.childNodes, n = a.length, s = 0; s < n; ++s) t += x.subParser("makeMarkdown.node")(a[s], r);
  2274. return /\n$/.test(t) ? t = t.split("\n").join("\n ").replace(/^ {4}$/gm, "").replace(/\n\n+/g, "\n\n") : t += "\n", t
  2275. }), x.subParser("makeMarkdown.node", function(e, r, t) {
  2276. "use strict";
  2277. t = t || !1;
  2278. var a = "";
  2279. if (3 === e.nodeType) return x.subParser("makeMarkdown.txt")(e, r);
  2280. if (8 === e.nodeType) return "\x3c!--" + e.data + "--\x3e\n\n";
  2281. if (1 !== e.nodeType) return "";
  2282. switch (e.tagName.toLowerCase()) {
  2283. case "h1":
  2284. t || (a = x.subParser("makeMarkdown.header")(e, r, 1) + "\n\n");
  2285. break;
  2286. case "h2":
  2287. t || (a = x.subParser("makeMarkdown.header")(e, r, 2) + "\n\n");
  2288. break;
  2289. case "h3":
  2290. t || (a = x.subParser("makeMarkdown.header")(e, r, 3) + "\n\n");
  2291. break;
  2292. case "h4":
  2293. t || (a = x.subParser("makeMarkdown.header")(e, r, 4) + "\n\n");
  2294. break;
  2295. case "h5":
  2296. t || (a = x.subParser("makeMarkdown.header")(e, r, 5) + "\n\n");
  2297. break;
  2298. case "h6":
  2299. t || (a = x.subParser("makeMarkdown.header")(e, r, 6) + "\n\n");
  2300. break;
  2301. case "p":
  2302. t || (a = x.subParser("makeMarkdown.paragraph")(e, r) + "\n\n");
  2303. break;
  2304. case "blockquote":
  2305. t || (a = x.subParser("makeMarkdown.blockquote")(e, r) + "\n\n");
  2306. break;
  2307. case "hr":
  2308. t || (a = x.subParser("makeMarkdown.hr")(e, r) + "\n\n");
  2309. break;
  2310. case "ol":
  2311. t || (a = x.subParser("makeMarkdown.list")(e, r, "ol") + "\n\n");
  2312. break;
  2313. case "ul":
  2314. t || (a = x.subParser("makeMarkdown.list")(e, r, "ul") + "\n\n");
  2315. break;
  2316. case "precode":
  2317. t || (a = x.subParser("makeMarkdown.codeBlock")(e, r) + "\n\n");
  2318. break;
  2319. case "pre":
  2320. t || (a = x.subParser("makeMarkdown.pre")(e, r) + "\n\n");
  2321. break;
  2322. case "table":
  2323. t || (a = x.subParser("makeMarkdown.table")(e, r) + "\n\n");
  2324. break;
  2325. case "code":
  2326. a = x.subParser("makeMarkdown.codeSpan")(e, r);
  2327. break;
  2328. case "em":
  2329. case "i":
  2330. a = x.subParser("makeMarkdown.emphasis")(e, r);
  2331. break;
  2332. case "strong":
  2333. case "b":
  2334. a = x.subParser("makeMarkdown.strong")(e, r);
  2335. break;
  2336. case "del":
  2337. a = x.subParser("makeMarkdown.strikethrough")(e, r);
  2338. break;
  2339. case "a":
  2340. a = x.subParser("makeMarkdown.links")(e, r);
  2341. break;
  2342. case "img":
  2343. a = x.subParser("makeMarkdown.image")(e, r);
  2344. break;
  2345. default:
  2346. a = e.outerHTML + "\n\n"
  2347. }
  2348. return a
  2349. }), x.subParser("makeMarkdown.paragraph", function(e, r) {
  2350. "use strict";
  2351. var t = "";
  2352. if (e.hasChildNodes())
  2353. for (var a = e.childNodes, n = a.length, s = 0; s < n; ++s) t += x.subParser("makeMarkdown.node")(a[s], r);
  2354. return t = t.trim()
  2355. }), x.subParser("makeMarkdown.pre", function(e, r) {
  2356. "use strict";
  2357. e = e.getAttribute("prenum");
  2358. return "<pre>" + r.preList[e] + "</pre>"
  2359. }), x.subParser("makeMarkdown.strikethrough", function(e, r) {
  2360. "use strict";
  2361. var t = "";
  2362. if (e.hasChildNodes()) {
  2363. t += "~~";
  2364. for (var a = e.childNodes, n = a.length, s = 0; s < n; ++s) t += x.subParser("makeMarkdown.node")(a[s], r);
  2365. t += "~~"
  2366. }
  2367. return t
  2368. }), x.subParser("makeMarkdown.strong", function(e, r) {
  2369. "use strict";
  2370. var t = "";
  2371. if (e.hasChildNodes()) {
  2372. t += "**";
  2373. for (var a = e.childNodes, n = a.length, s = 0; s < n; ++s) t += x.subParser("makeMarkdown.node")(a[s], r);
  2374. t += "**"
  2375. }
  2376. return t
  2377. }), x.subParser("makeMarkdown.table", function(e, r) {
  2378. "use strict";
  2379. for (var t = "", a = [
  2380. [],
  2381. []
  2382. ], n = e.querySelectorAll("thead>tr>th"), s = e.querySelectorAll("tbody>tr"), o = 0; o < n.length; ++o) {
  2383. var u = x.subParser("makeMarkdown.tableCell")(n[o], r),
  2384. i = "---";
  2385. if (n[o].hasAttribute("style")) switch (n[o].getAttribute("style").toLowerCase().replace(/\s/g, "")) {
  2386. case "text-align:left;":
  2387. i = ":---";
  2388. break;
  2389. case "text-align:right;":
  2390. i = "---:";
  2391. break;
  2392. case "text-align:center;":
  2393. i = ":---:"
  2394. }
  2395. a[0][o] = u.trim(), a[1][o] = i
  2396. }
  2397. for (o = 0; o < s.length; ++o)
  2398. for (var d = a.push([]) - 1, p = s[o].getElementsByTagName("td"), l = 0; l < n.length; ++l) {
  2399. var h = " ";
  2400. void 0 !== p[l] && (h = x.subParser("makeMarkdown.tableCell")(p[l], r)), a[d].push(h)
  2401. }
  2402. var c = 3;
  2403. for (o = 0; o < a.length; ++o)
  2404. for (l = 0; l < a[o].length; ++l) {
  2405. var _ = a[o][l].length;
  2406. c < _ && (c = _)
  2407. }
  2408. for (o = 0; o < a.length; ++o) {
  2409. for (l = 0; l < a[o].length; ++l) 1 === o ? ":" === a[o][l].slice(-1) ? a[o][l] = x.helper.padEnd(a[o][l].slice(-1), c - 1, "-") + ":" : a[o][l] = x.helper.padEnd(a[o][l], c, "-") : a[o][l] = x.helper.padEnd(a[o][l], c);
  2410. t += "| " + a[o].join(" | ") + " |\n"
  2411. }
  2412. return t.trim()
  2413. }), x.subParser("makeMarkdown.tableCell", function(e, r) {
  2414. "use strict";
  2415. var t = "";
  2416. if (!e.hasChildNodes()) return "";
  2417. for (var a = e.childNodes, n = a.length, s = 0; s < n; ++s) t += x.subParser("makeMarkdown.node")(a[s], r, !0);
  2418. return t.trim()
  2419. }), x.subParser("makeMarkdown.txt", function(e) {
  2420. "use strict";
  2421. e = e.nodeValue;
  2422. return e = (e = e.replace(/ +/g, " ")).replace(/¨NBSP;/g, " "), e = (e = (e = (e = (e = (e = (e = (e = (e = x.helper.unescapeHTMLEntities(e)).replace(/([*_~|`])/g, "\\$1")).replace(/^(\s*)>/g, "\\$1>")).replace(/^#/gm, "\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3")).replace(/^( {0,3}\d+)\./gm, "$1\\.")).replace(/^( {0,3})([+-])/gm, "$1\\$2")).replace(/]([\s]*)\(/g, "\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:")
  2423. });
  2424. "function" == typeof define && define.amd ? define(function() {
  2425. "use strict";
  2426. return x
  2427. }) : "undefined" != typeof module && module.exports ? module.exports = x : this.showdown = x
  2428. }.call(this);
  2429. //# sourceMappingURL=showdown.min.js.map