showdown.js 162 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261
  1. ;/*! showdown v 1.7.6 - 24-10-2017 */
  2. (function(){
  3. /**
  4. * Created by Tivie on 13-07-2015.
  5. */
  6. function getDefaultOpts (simple) {
  7. 'use strict';
  8. var defaultOptions = {
  9. omitExtraWLInCodeBlocks: {
  10. defaultValue: false,
  11. describe: 'Omit the default extra whiteline added to code blocks',
  12. type: 'boolean'
  13. },
  14. noHeaderId: {
  15. defaultValue: false,
  16. describe: 'Turn on/off generated header id',
  17. type: 'boolean'
  18. },
  19. prefixHeaderId: {
  20. defaultValue: false,
  21. 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',
  22. type: 'string'
  23. },
  24. rawPrefixHeaderId: {
  25. defaultValue: false,
  26. 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)',
  27. type: 'boolean'
  28. },
  29. ghCompatibleHeaderId: {
  30. defaultValue: false,
  31. describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',
  32. type: 'boolean'
  33. },
  34. rawHeaderId: {
  35. defaultValue: false,
  36. describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',
  37. type: 'boolean'
  38. },
  39. headerLevelStart: {
  40. defaultValue: false,
  41. describe: 'The header blocks level start',
  42. type: 'integer'
  43. },
  44. parseImgDimensions: {
  45. defaultValue: false,
  46. describe: 'Turn on/off image dimension parsing',
  47. type: 'boolean'
  48. },
  49. simplifiedAutoLink: {
  50. defaultValue: false,
  51. describe: 'Turn on/off GFM autolink style',
  52. type: 'boolean'
  53. },
  54. excludeTrailingPunctuationFromURLs: {
  55. defaultValue: false,
  56. describe: 'Excludes trailing punctuation from links generated with autoLinking',
  57. type: 'boolean'
  58. },
  59. literalMidWordUnderscores: {
  60. defaultValue: false,
  61. describe: 'Parse midword underscores as literal underscores',
  62. type: 'boolean'
  63. },
  64. literalMidWordAsterisks: {
  65. defaultValue: false,
  66. describe: 'Parse midword asterisks as literal asterisks',
  67. type: 'boolean'
  68. },
  69. strikethrough: {
  70. defaultValue: false,
  71. describe: 'Turn on/off strikethrough support',
  72. type: 'boolean'
  73. },
  74. tables: {
  75. defaultValue: false,
  76. describe: 'Turn on/off tables support',
  77. type: 'boolean'
  78. },
  79. tablesHeaderId: {
  80. defaultValue: false,
  81. describe: 'Add an id to table headers',
  82. type: 'boolean'
  83. },
  84. ghCodeBlocks: {
  85. defaultValue: true,
  86. describe: 'Turn on/off GFM fenced code blocks support',
  87. type: 'boolean'
  88. },
  89. tasklists: {
  90. defaultValue: false,
  91. describe: 'Turn on/off GFM tasklist support',
  92. type: 'boolean'
  93. },
  94. smoothLivePreview: {
  95. defaultValue: false,
  96. describe: 'Prevents weird effects in live previews due to incomplete input',
  97. type: 'boolean'
  98. },
  99. smartIndentationFix: {
  100. defaultValue: false,
  101. description: 'Tries to smartly fix indentation in es6 strings',
  102. type: 'boolean'
  103. },
  104. disableForced4SpacesIndentedSublists: {
  105. defaultValue: false,
  106. description: 'Disables the requirement of indenting nested sublists by 4 spaces',
  107. type: 'boolean'
  108. },
  109. simpleLineBreaks: {
  110. defaultValue: false,
  111. description: 'Parses simple line breaks as <br> (GFM Style)',
  112. type: 'boolean'
  113. },
  114. requireSpaceBeforeHeadingText: {
  115. defaultValue: false,
  116. description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
  117. type: 'boolean'
  118. },
  119. ghMentions: {
  120. defaultValue: false,
  121. description: 'Enables github @mentions',
  122. type: 'boolean'
  123. },
  124. ghMentionsLink: {
  125. defaultValue: 'https://github.com/{u}',
  126. description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
  127. type: 'string'
  128. },
  129. encodeEmails: {
  130. defaultValue: true,
  131. description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
  132. type: 'boolean'
  133. },
  134. openLinksInNewWindow: {
  135. defaultValue: false,
  136. description: 'Open all links in new windows',
  137. type: 'boolean'
  138. },
  139. backslashEscapesHTMLTags: {
  140. defaultValue: false,
  141. description: 'Support for HTML Tag escaping. ex: \<div>foo\</div>',
  142. type: 'boolean'
  143. },
  144. emoji: {
  145. defaultValue: false,
  146. description: 'Enable emoji support. Ex: `this is a :smile: emoji`',
  147. type: 'boolean'
  148. }
  149. };
  150. if (simple === false) {
  151. return JSON.parse(JSON.stringify(defaultOptions));
  152. }
  153. var ret = {};
  154. for (var opt in defaultOptions) {
  155. if (defaultOptions.hasOwnProperty(opt)) {
  156. ret[opt] = defaultOptions[opt].defaultValue;
  157. }
  158. }
  159. return ret;
  160. }
  161. function allOptionsOn () {
  162. 'use strict';
  163. var options = getDefaultOpts(true),
  164. ret = {};
  165. for (var opt in options) {
  166. if (options.hasOwnProperty(opt)) {
  167. ret[opt] = true;
  168. }
  169. }
  170. return ret;
  171. }
  172. /**
  173. * Created by Tivie on 06-01-2015.
  174. */
  175. // Private properties
  176. var showdown = {},
  177. parsers = {},
  178. extensions = {},
  179. globalOptions = getDefaultOpts(true),
  180. setFlavor = 'vanilla',
  181. flavor = {
  182. github: {
  183. omitExtraWLInCodeBlocks: true,
  184. simplifiedAutoLink: true,
  185. excludeTrailingPunctuationFromURLs: true,
  186. literalMidWordUnderscores: true,
  187. strikethrough: true,
  188. tables: true,
  189. tablesHeaderId: true,
  190. ghCodeBlocks: true,
  191. tasklists: true,
  192. disableForced4SpacesIndentedSublists: true,
  193. simpleLineBreaks: true,
  194. requireSpaceBeforeHeadingText: true,
  195. ghCompatibleHeaderId: true,
  196. ghMentions: true,
  197. backslashEscapesHTMLTags: true,
  198. emoji: true
  199. },
  200. original: {
  201. noHeaderId: true,
  202. ghCodeBlocks: false
  203. },
  204. ghost: {
  205. omitExtraWLInCodeBlocks: true,
  206. parseImgDimensions: true,
  207. simplifiedAutoLink: true,
  208. excludeTrailingPunctuationFromURLs: true,
  209. literalMidWordUnderscores: true,
  210. strikethrough: true,
  211. tables: true,
  212. tablesHeaderId: true,
  213. ghCodeBlocks: true,
  214. tasklists: true,
  215. smoothLivePreview: true,
  216. simpleLineBreaks: true,
  217. requireSpaceBeforeHeadingText: true,
  218. ghMentions: false,
  219. encodeEmails: true
  220. },
  221. vanilla: getDefaultOpts(true),
  222. allOn: allOptionsOn()
  223. };
  224. /**
  225. * helper namespace
  226. * @type {{}}
  227. */
  228. showdown.helper = {};
  229. /**
  230. * TODO LEGACY SUPPORT CODE
  231. * @type {{}}
  232. */
  233. showdown.extensions = {};
  234. /**
  235. * Set a global option
  236. * @static
  237. * @param {string} key
  238. * @param {*} value
  239. * @returns {showdown}
  240. */
  241. showdown.setOption = function (key, value) {
  242. 'use strict';
  243. globalOptions[key] = value;
  244. return this;
  245. };
  246. /**
  247. * Get a global option
  248. * @static
  249. * @param {string} key
  250. * @returns {*}
  251. */
  252. showdown.getOption = function (key) {
  253. 'use strict';
  254. return globalOptions[key];
  255. };
  256. /**
  257. * Get the global options
  258. * @static
  259. * @returns {{}}
  260. */
  261. showdown.getOptions = function () {
  262. 'use strict';
  263. return globalOptions;
  264. };
  265. /**
  266. * Reset global options to the default values
  267. * @static
  268. */
  269. showdown.resetOptions = function () {
  270. 'use strict';
  271. globalOptions = getDefaultOpts(true);
  272. };
  273. /**
  274. * Set the flavor showdown should use as default
  275. * @param {string} name
  276. */
  277. showdown.setFlavor = function (name) {
  278. 'use strict';
  279. if (!flavor.hasOwnProperty(name)) {
  280. throw Error(name + ' flavor was not found');
  281. }
  282. showdown.resetOptions();
  283. var preset = flavor[name];
  284. setFlavor = name;
  285. for (var option in preset) {
  286. if (preset.hasOwnProperty(option)) {
  287. globalOptions[option] = preset[option];
  288. }
  289. }
  290. };
  291. /**
  292. * Get the currently set flavor
  293. * @returns {string}
  294. */
  295. showdown.getFlavor = function () {
  296. 'use strict';
  297. return setFlavor;
  298. };
  299. /**
  300. * Get the options of a specified flavor. Returns undefined if the flavor was not found
  301. * @param {string} name Name of the flavor
  302. * @returns {{}|undefined}
  303. */
  304. showdown.getFlavorOptions = function (name) {
  305. 'use strict';
  306. if (flavor.hasOwnProperty(name)) {
  307. return flavor[name];
  308. }
  309. };
  310. /**
  311. * Get the default options
  312. * @static
  313. * @param {boolean} [simple=true]
  314. * @returns {{}}
  315. */
  316. showdown.getDefaultOptions = function (simple) {
  317. 'use strict';
  318. return getDefaultOpts(simple);
  319. };
  320. /**
  321. * Get or set a subParser
  322. *
  323. * subParser(name) - Get a registered subParser
  324. * subParser(name, func) - Register a subParser
  325. * @static
  326. * @param {string} name
  327. * @param {function} [func]
  328. * @returns {*}
  329. */
  330. showdown.subParser = function (name, func) {
  331. 'use strict';
  332. if (showdown.helper.isString(name)) {
  333. if (typeof func !== 'undefined') {
  334. parsers[name] = func;
  335. } else {
  336. if (parsers.hasOwnProperty(name)) {
  337. return parsers[name];
  338. } else {
  339. throw Error('SubParser named ' + name + ' not registered!');
  340. }
  341. }
  342. }
  343. };
  344. /**
  345. * Gets or registers an extension
  346. * @static
  347. * @param {string} name
  348. * @param {object|function=} ext
  349. * @returns {*}
  350. */
  351. showdown.extension = function (name, ext) {
  352. 'use strict';
  353. if (!showdown.helper.isString(name)) {
  354. throw Error('Extension \'name\' must be a string');
  355. }
  356. name = showdown.helper.stdExtName(name);
  357. // Getter
  358. if (showdown.helper.isUndefined(ext)) {
  359. if (!extensions.hasOwnProperty(name)) {
  360. throw Error('Extension named ' + name + ' is not registered!');
  361. }
  362. return extensions[name];
  363. // Setter
  364. } else {
  365. // Expand extension if it's wrapped in a function
  366. if (typeof ext === 'function') {
  367. ext = ext();
  368. }
  369. // Ensure extension is an array
  370. if (!showdown.helper.isArray(ext)) {
  371. ext = [ext];
  372. }
  373. var validExtension = validate(ext, name);
  374. if (validExtension.valid) {
  375. extensions[name] = ext;
  376. } else {
  377. throw Error(validExtension.error);
  378. }
  379. }
  380. };
  381. /**
  382. * Gets all extensions registered
  383. * @returns {{}}
  384. */
  385. showdown.getAllExtensions = function () {
  386. 'use strict';
  387. return extensions;
  388. };
  389. /**
  390. * Remove an extension
  391. * @param {string} name
  392. */
  393. showdown.removeExtension = function (name) {
  394. 'use strict';
  395. delete extensions[name];
  396. };
  397. /**
  398. * Removes all extensions
  399. */
  400. showdown.resetExtensions = function () {
  401. 'use strict';
  402. extensions = {};
  403. };
  404. /**
  405. * Validate extension
  406. * @param {array} extension
  407. * @param {string} name
  408. * @returns {{valid: boolean, error: string}}
  409. */
  410. function validate (extension, name) {
  411. 'use strict';
  412. var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
  413. ret = {
  414. valid: true,
  415. error: ''
  416. };
  417. if (!showdown.helper.isArray(extension)) {
  418. extension = [extension];
  419. }
  420. for (var i = 0; i < extension.length; ++i) {
  421. var baseMsg = errMsg + ' sub-extension ' + i + ': ',
  422. ext = extension[i];
  423. if (typeof ext !== 'object') {
  424. ret.valid = false;
  425. ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
  426. return ret;
  427. }
  428. if (!showdown.helper.isString(ext.type)) {
  429. ret.valid = false;
  430. ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
  431. return ret;
  432. }
  433. var type = ext.type = ext.type.toLowerCase();
  434. // normalize extension type
  435. if (type === 'language') {
  436. type = ext.type = 'lang';
  437. }
  438. if (type === 'html') {
  439. type = ext.type = 'output';
  440. }
  441. if (type !== 'lang' && type !== 'output' && type !== 'listener') {
  442. ret.valid = false;
  443. ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
  444. return ret;
  445. }
  446. if (type === 'listener') {
  447. if (showdown.helper.isUndefined(ext.listeners)) {
  448. ret.valid = false;
  449. ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
  450. return ret;
  451. }
  452. } else {
  453. if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {
  454. ret.valid = false;
  455. ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
  456. return ret;
  457. }
  458. }
  459. if (ext.listeners) {
  460. if (typeof ext.listeners !== 'object') {
  461. ret.valid = false;
  462. ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + ' given';
  463. return ret;
  464. }
  465. for (var ln in ext.listeners) {
  466. if (ext.listeners.hasOwnProperty(ln)) {
  467. if (typeof ext.listeners[ln] !== 'function') {
  468. ret.valid = false;
  469. ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln +
  470. ' must be a function but ' + typeof ext.listeners[ln] + ' given';
  471. return ret;
  472. }
  473. }
  474. }
  475. }
  476. if (ext.filter) {
  477. if (typeof ext.filter !== 'function') {
  478. ret.valid = false;
  479. ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + ' given';
  480. return ret;
  481. }
  482. } else if (ext.regex) {
  483. if (showdown.helper.isString(ext.regex)) {
  484. ext.regex = new RegExp(ext.regex, 'g');
  485. }
  486. if (!(ext.regex instanceof RegExp)) {
  487. ret.valid = false;
  488. ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';
  489. return ret;
  490. }
  491. if (showdown.helper.isUndefined(ext.replace)) {
  492. ret.valid = false;
  493. ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
  494. return ret;
  495. }
  496. }
  497. }
  498. return ret;
  499. }
  500. /**
  501. * Validate extension
  502. * @param {object} ext
  503. * @returns {boolean}
  504. */
  505. showdown.validateExtension = function (ext) {
  506. 'use strict';
  507. var validateExtension = validate(ext, null);
  508. if (!validateExtension.valid) {
  509. console.warn(validateExtension.error);
  510. return false;
  511. }
  512. return true;
  513. };
  514. /**
  515. * showdownjs helper functions
  516. */
  517. if (!showdown.hasOwnProperty('helper')) {
  518. showdown.helper = {};
  519. }
  520. /**
  521. * Check if var is string
  522. * @static
  523. * @param {string} a
  524. * @returns {boolean}
  525. */
  526. showdown.helper.isString = function (a) {
  527. 'use strict';
  528. return (typeof a === 'string' || a instanceof String);
  529. };
  530. /**
  531. * Check if var is a function
  532. * @static
  533. * @param {*} a
  534. * @returns {boolean}
  535. */
  536. showdown.helper.isFunction = function (a) {
  537. 'use strict';
  538. var getType = {};
  539. return a && getType.toString.call(a) === '[object Function]';
  540. };
  541. /**
  542. * isArray helper function
  543. * @static
  544. * @param {*} a
  545. * @returns {boolean}
  546. */
  547. showdown.helper.isArray = function (a) {
  548. 'use strict';
  549. return Array.isArray(a);
  550. };
  551. /**
  552. * Check if value is undefined
  553. * @static
  554. * @param {*} value The value to check.
  555. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  556. */
  557. showdown.helper.isUndefined = function (value) {
  558. 'use strict';
  559. return typeof value === 'undefined';
  560. };
  561. /**
  562. * ForEach helper function
  563. * Iterates over Arrays and Objects (own properties only)
  564. * @static
  565. * @param {*} obj
  566. * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object
  567. */
  568. showdown.helper.forEach = function (obj, callback) {
  569. 'use strict';
  570. // check if obj is defined
  571. if (showdown.helper.isUndefined(obj)) {
  572. throw new Error('obj param is required');
  573. }
  574. if (showdown.helper.isUndefined(callback)) {
  575. throw new Error('callback param is required');
  576. }
  577. if (!showdown.helper.isFunction(callback)) {
  578. throw new Error('callback param must be a function/closure');
  579. }
  580. if (typeof obj.forEach === 'function') {
  581. obj.forEach(callback);
  582. } else if (showdown.helper.isArray(obj)) {
  583. for (var i = 0; i < obj.length; i++) {
  584. callback(obj[i], i, obj);
  585. }
  586. } else if (typeof (obj) === 'object') {
  587. for (var prop in obj) {
  588. if (obj.hasOwnProperty(prop)) {
  589. callback(obj[prop], prop, obj);
  590. }
  591. }
  592. } else {
  593. throw new Error('obj does not seem to be an array or an iterable object');
  594. }
  595. };
  596. /**
  597. * Standardidize extension name
  598. * @static
  599. * @param {string} s extension name
  600. * @returns {string}
  601. */
  602. showdown.helper.stdExtName = function (s) {
  603. 'use strict';
  604. return s.replace(/[_?*+\/\\.^-]/g, '').replace(/\s/g, '').toLowerCase();
  605. };
  606. function escapeCharactersCallback (wholeMatch, m1) {
  607. 'use strict';
  608. var charCodeToEscape = m1.charCodeAt(0);
  609. return '¨E' + charCodeToEscape + 'E';
  610. }
  611. /**
  612. * Callback used to escape characters when passing through String.replace
  613. * @static
  614. * @param {string} wholeMatch
  615. * @param {string} m1
  616. * @returns {string}
  617. */
  618. showdown.helper.escapeCharactersCallback = escapeCharactersCallback;
  619. /**
  620. * Escape characters in a string
  621. * @static
  622. * @param {string} text
  623. * @param {string} charsToEscape
  624. * @param {boolean} afterBackslash
  625. * @returns {XML|string|void|*}
  626. */
  627. showdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) {
  628. 'use strict';
  629. // First we have to escape the escape characters so that
  630. // we can build a character class out of them
  631. var regexString = '([' + charsToEscape.replace(/([\[\]\\])/g, '\\$1') + '])';
  632. if (afterBackslash) {
  633. regexString = '\\\\' + regexString;
  634. }
  635. var regex = new RegExp(regexString, 'g');
  636. text = text.replace(regex, escapeCharactersCallback);
  637. return text;
  638. };
  639. var rgxFindMatchPos = function (str, left, right, flags) {
  640. 'use strict';
  641. var f = flags || '',
  642. g = f.indexOf('g') > -1,
  643. x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),
  644. l = new RegExp(left, f.replace(/g/g, '')),
  645. pos = [],
  646. t, s, m, start, end;
  647. do {
  648. t = 0;
  649. while ((m = x.exec(str))) {
  650. if (l.test(m[0])) {
  651. if (!(t++)) {
  652. s = x.lastIndex;
  653. start = s - m[0].length;
  654. }
  655. } else if (t) {
  656. if (!--t) {
  657. end = m.index + m[0].length;
  658. var obj = {
  659. left: {start: start, end: s},
  660. match: {start: s, end: m.index},
  661. right: {start: m.index, end: end},
  662. wholeMatch: {start: start, end: end}
  663. };
  664. pos.push(obj);
  665. if (!g) {
  666. return pos;
  667. }
  668. }
  669. }
  670. }
  671. } while (t && (x.lastIndex = s));
  672. return pos;
  673. };
  674. /**
  675. * matchRecursiveRegExp
  676. *
  677. * (c) 2007 Steven Levithan <stevenlevithan.com>
  678. * MIT License
  679. *
  680. * Accepts a string to search, a left and right format delimiter
  681. * as regex patterns, and optional regex flags. Returns an array
  682. * of matches, allowing nested instances of left/right delimiters.
  683. * Use the "g" flag to return all matches, otherwise only the
  684. * first is returned. Be careful to ensure that the left and
  685. * right format delimiters produce mutually exclusive matches.
  686. * Backreferences are not supported within the right delimiter
  687. * due to how it is internally combined with the left delimiter.
  688. * When matching strings whose format delimiters are unbalanced
  689. * to the left or right, the output is intentionally as a
  690. * conventional regex library with recursion support would
  691. * produce, e.g. "<<x>" and "<x>>" both produce ["x"] when using
  692. * "<" and ">" as the delimiters (both strings contain a single,
  693. * balanced instance of "<x>").
  694. *
  695. * examples:
  696. * matchRecursiveRegExp("test", "\\(", "\\)")
  697. * returns: []
  698. * matchRecursiveRegExp("<t<<e>><s>>t<>", "<", ">", "g")
  699. * returns: ["t<<e>><s>", ""]
  700. * matchRecursiveRegExp("<div id=\"x\">test</div>", "<div\\b[^>]*>", "</div>", "gi")
  701. * returns: ["test"]
  702. */
  703. showdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {
  704. 'use strict';
  705. var matchPos = rgxFindMatchPos (str, left, right, flags),
  706. results = [];
  707. for (var i = 0; i < matchPos.length; ++i) {
  708. results.push([
  709. str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
  710. str.slice(matchPos[i].match.start, matchPos[i].match.end),
  711. str.slice(matchPos[i].left.start, matchPos[i].left.end),
  712. str.slice(matchPos[i].right.start, matchPos[i].right.end)
  713. ]);
  714. }
  715. return results;
  716. };
  717. /**
  718. *
  719. * @param {string} str
  720. * @param {string|function} replacement
  721. * @param {string} left
  722. * @param {string} right
  723. * @param {string} flags
  724. * @returns {string}
  725. */
  726. showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
  727. 'use strict';
  728. if (!showdown.helper.isFunction(replacement)) {
  729. var repStr = replacement;
  730. replacement = function () {
  731. return repStr;
  732. };
  733. }
  734. var matchPos = rgxFindMatchPos(str, left, right, flags),
  735. finalStr = str,
  736. lng = matchPos.length;
  737. if (lng > 0) {
  738. var bits = [];
  739. if (matchPos[0].wholeMatch.start !== 0) {
  740. bits.push(str.slice(0, matchPos[0].wholeMatch.start));
  741. }
  742. for (var i = 0; i < lng; ++i) {
  743. bits.push(
  744. replacement(
  745. str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
  746. str.slice(matchPos[i].match.start, matchPos[i].match.end),
  747. str.slice(matchPos[i].left.start, matchPos[i].left.end),
  748. str.slice(matchPos[i].right.start, matchPos[i].right.end)
  749. )
  750. );
  751. if (i < lng - 1) {
  752. bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));
  753. }
  754. }
  755. if (matchPos[lng - 1].wholeMatch.end < str.length) {
  756. bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));
  757. }
  758. finalStr = bits.join('');
  759. }
  760. return finalStr;
  761. };
  762. /**
  763. * Returns the index within the passed String object of the first occurrence of the specified regex,
  764. * starting the search at fromIndex. Returns -1 if the value is not found.
  765. *
  766. * @param {string} str string to search
  767. * @param {RegExp} regex Regular expression to search
  768. * @param {int} [fromIndex = 0] Index to start the search
  769. * @returns {Number}
  770. * @throws InvalidArgumentError
  771. */
  772. showdown.helper.regexIndexOf = function (str, regex, fromIndex) {
  773. 'use strict';
  774. if (!showdown.helper.isString(str)) {
  775. throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
  776. }
  777. if (regex instanceof RegExp === false) {
  778. throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp';
  779. }
  780. var indexOf = str.substring(fromIndex || 0).search(regex);
  781. return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf;
  782. };
  783. /**
  784. * Splits the passed string object at the defined index, and returns an array composed of the two substrings
  785. * @param {string} str string to split
  786. * @param {int} index index to split string at
  787. * @returns {[string,string]}
  788. * @throws InvalidArgumentError
  789. */
  790. showdown.helper.splitAtIndex = function (str, index) {
  791. 'use strict';
  792. if (!showdown.helper.isString(str)) {
  793. throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
  794. }
  795. return [str.substring(0, index), str.substring(index)];
  796. };
  797. /**
  798. * Obfuscate an e-mail address through the use of Character Entities,
  799. * transforming ASCII characters into their equivalent decimal or hex entities.
  800. *
  801. * Since it has a random component, subsequent calls to this function produce different results
  802. *
  803. * @param {string} mail
  804. * @returns {string}
  805. */
  806. showdown.helper.encodeEmailAddress = function (mail) {
  807. 'use strict';
  808. var encode = [
  809. function (ch) {
  810. return '&#' + ch.charCodeAt(0) + ';';
  811. },
  812. function (ch) {
  813. return '&#x' + ch.charCodeAt(0).toString(16) + ';';
  814. },
  815. function (ch) {
  816. return ch;
  817. }
  818. ];
  819. mail = mail.replace(/./g, function (ch) {
  820. if (ch === '@') {
  821. // this *must* be encoded. I insist.
  822. ch = encode[Math.floor(Math.random() * 2)](ch);
  823. } else {
  824. var r = Math.random();
  825. // roughly 10% raw, 45% hex, 45% dec
  826. ch = (
  827. r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)
  828. );
  829. }
  830. return ch;
  831. });
  832. return mail;
  833. };
  834. /**
  835. * POLYFILLS
  836. */
  837. // use this instead of builtin is undefined for IE8 compatibility
  838. if (typeof(console) === 'undefined') {
  839. console = {
  840. warn: function (msg) {
  841. 'use strict';
  842. alert(msg);
  843. },
  844. log: function (msg) {
  845. 'use strict';
  846. alert(msg);
  847. },
  848. error: function (msg) {
  849. 'use strict';
  850. throw msg;
  851. }
  852. };
  853. }
  854. /**
  855. * Common regexes.
  856. * We declare some common regexes to improve performance
  857. */
  858. showdown.helper.regexes = {
  859. asteriskDashAndColon: /([*_:~])/g
  860. };
  861. /**
  862. * EMOJIS LIST
  863. */
  864. showdown.helper.emojis = {
  865. '+1':'\ud83d\udc4d',
  866. '-1':'\ud83d\udc4e',
  867. '100':'\ud83d\udcaf',
  868. '1234':'\ud83d\udd22',
  869. '1st_place_medal':'\ud83e\udd47',
  870. '2nd_place_medal':'\ud83e\udd48',
  871. '3rd_place_medal':'\ud83e\udd49',
  872. '8ball':'\ud83c\udfb1',
  873. 'a':'\ud83c\udd70\ufe0f',
  874. 'ab':'\ud83c\udd8e',
  875. 'abc':'\ud83d\udd24',
  876. 'abcd':'\ud83d\udd21',
  877. 'accept':'\ud83c\ude51',
  878. 'aerial_tramway':'\ud83d\udea1',
  879. 'airplane':'\u2708\ufe0f',
  880. 'alarm_clock':'\u23f0',
  881. 'alembic':'\u2697\ufe0f',
  882. 'alien':'\ud83d\udc7d',
  883. 'ambulance':'\ud83d\ude91',
  884. 'amphora':'\ud83c\udffa',
  885. 'anchor':'\u2693\ufe0f',
  886. 'angel':'\ud83d\udc7c',
  887. 'anger':'\ud83d\udca2',
  888. 'angry':'\ud83d\ude20',
  889. 'anguished':'\ud83d\ude27',
  890. 'ant':'\ud83d\udc1c',
  891. 'apple':'\ud83c\udf4e',
  892. 'aquarius':'\u2652\ufe0f',
  893. 'aries':'\u2648\ufe0f',
  894. 'arrow_backward':'\u25c0\ufe0f',
  895. 'arrow_double_down':'\u23ec',
  896. 'arrow_double_up':'\u23eb',
  897. 'arrow_down':'\u2b07\ufe0f',
  898. 'arrow_down_small':'\ud83d\udd3d',
  899. 'arrow_forward':'\u25b6\ufe0f',
  900. 'arrow_heading_down':'\u2935\ufe0f',
  901. 'arrow_heading_up':'\u2934\ufe0f',
  902. 'arrow_left':'\u2b05\ufe0f',
  903. 'arrow_lower_left':'\u2199\ufe0f',
  904. 'arrow_lower_right':'\u2198\ufe0f',
  905. 'arrow_right':'\u27a1\ufe0f',
  906. 'arrow_right_hook':'\u21aa\ufe0f',
  907. 'arrow_up':'\u2b06\ufe0f',
  908. 'arrow_up_down':'\u2195\ufe0f',
  909. 'arrow_up_small':'\ud83d\udd3c',
  910. 'arrow_upper_left':'\u2196\ufe0f',
  911. 'arrow_upper_right':'\u2197\ufe0f',
  912. 'arrows_clockwise':'\ud83d\udd03',
  913. 'arrows_counterclockwise':'\ud83d\udd04',
  914. 'art':'\ud83c\udfa8',
  915. 'articulated_lorry':'\ud83d\ude9b',
  916. 'artificial_satellite':'\ud83d\udef0',
  917. 'astonished':'\ud83d\ude32',
  918. 'athletic_shoe':'\ud83d\udc5f',
  919. 'atm':'\ud83c\udfe7',
  920. 'atom_symbol':'\u269b\ufe0f',
  921. 'avocado':'\ud83e\udd51',
  922. 'b':'\ud83c\udd71\ufe0f',
  923. 'baby':'\ud83d\udc76',
  924. 'baby_bottle':'\ud83c\udf7c',
  925. 'baby_chick':'\ud83d\udc24',
  926. 'baby_symbol':'\ud83d\udebc',
  927. 'back':'\ud83d\udd19',
  928. 'bacon':'\ud83e\udd53',
  929. 'badminton':'\ud83c\udff8',
  930. 'baggage_claim':'\ud83d\udec4',
  931. 'baguette_bread':'\ud83e\udd56',
  932. 'balance_scale':'\u2696\ufe0f',
  933. 'balloon':'\ud83c\udf88',
  934. 'ballot_box':'\ud83d\uddf3',
  935. 'ballot_box_with_check':'\u2611\ufe0f',
  936. 'bamboo':'\ud83c\udf8d',
  937. 'banana':'\ud83c\udf4c',
  938. 'bangbang':'\u203c\ufe0f',
  939. 'bank':'\ud83c\udfe6',
  940. 'bar_chart':'\ud83d\udcca',
  941. 'barber':'\ud83d\udc88',
  942. 'baseball':'\u26be\ufe0f',
  943. 'basketball':'\ud83c\udfc0',
  944. 'basketball_man':'\u26f9\ufe0f',
  945. 'basketball_woman':'\u26f9\ufe0f&zwj;\u2640\ufe0f',
  946. 'bat':'\ud83e\udd87',
  947. 'bath':'\ud83d\udec0',
  948. 'bathtub':'\ud83d\udec1',
  949. 'battery':'\ud83d\udd0b',
  950. 'beach_umbrella':'\ud83c\udfd6',
  951. 'bear':'\ud83d\udc3b',
  952. 'bed':'\ud83d\udecf',
  953. 'bee':'\ud83d\udc1d',
  954. 'beer':'\ud83c\udf7a',
  955. 'beers':'\ud83c\udf7b',
  956. 'beetle':'\ud83d\udc1e',
  957. 'beginner':'\ud83d\udd30',
  958. 'bell':'\ud83d\udd14',
  959. 'bellhop_bell':'\ud83d\udece',
  960. 'bento':'\ud83c\udf71',
  961. 'biking_man':'\ud83d\udeb4',
  962. 'bike':'\ud83d\udeb2',
  963. 'biking_woman':'\ud83d\udeb4&zwj;\u2640\ufe0f',
  964. 'bikini':'\ud83d\udc59',
  965. 'biohazard':'\u2623\ufe0f',
  966. 'bird':'\ud83d\udc26',
  967. 'birthday':'\ud83c\udf82',
  968. 'black_circle':'\u26ab\ufe0f',
  969. 'black_flag':'\ud83c\udff4',
  970. 'black_heart':'\ud83d\udda4',
  971. 'black_joker':'\ud83c\udccf',
  972. 'black_large_square':'\u2b1b\ufe0f',
  973. 'black_medium_small_square':'\u25fe\ufe0f',
  974. 'black_medium_square':'\u25fc\ufe0f',
  975. 'black_nib':'\u2712\ufe0f',
  976. 'black_small_square':'\u25aa\ufe0f',
  977. 'black_square_button':'\ud83d\udd32',
  978. 'blonde_man':'\ud83d\udc71',
  979. 'blonde_woman':'\ud83d\udc71&zwj;\u2640\ufe0f',
  980. 'blossom':'\ud83c\udf3c',
  981. 'blowfish':'\ud83d\udc21',
  982. 'blue_book':'\ud83d\udcd8',
  983. 'blue_car':'\ud83d\ude99',
  984. 'blue_heart':'\ud83d\udc99',
  985. 'blush':'\ud83d\ude0a',
  986. 'boar':'\ud83d\udc17',
  987. 'boat':'\u26f5\ufe0f',
  988. 'bomb':'\ud83d\udca3',
  989. 'book':'\ud83d\udcd6',
  990. 'bookmark':'\ud83d\udd16',
  991. 'bookmark_tabs':'\ud83d\udcd1',
  992. 'books':'\ud83d\udcda',
  993. 'boom':'\ud83d\udca5',
  994. 'boot':'\ud83d\udc62',
  995. 'bouquet':'\ud83d\udc90',
  996. 'bowing_man':'\ud83d\ude47',
  997. 'bow_and_arrow':'\ud83c\udff9',
  998. 'bowing_woman':'\ud83d\ude47&zwj;\u2640\ufe0f',
  999. 'bowling':'\ud83c\udfb3',
  1000. 'boxing_glove':'\ud83e\udd4a',
  1001. 'boy':'\ud83d\udc66',
  1002. 'bread':'\ud83c\udf5e',
  1003. 'bride_with_veil':'\ud83d\udc70',
  1004. 'bridge_at_night':'\ud83c\udf09',
  1005. 'briefcase':'\ud83d\udcbc',
  1006. 'broken_heart':'\ud83d\udc94',
  1007. 'bug':'\ud83d\udc1b',
  1008. 'building_construction':'\ud83c\udfd7',
  1009. 'bulb':'\ud83d\udca1',
  1010. 'bullettrain_front':'\ud83d\ude85',
  1011. 'bullettrain_side':'\ud83d\ude84',
  1012. 'burrito':'\ud83c\udf2f',
  1013. 'bus':'\ud83d\ude8c',
  1014. 'business_suit_levitating':'\ud83d\udd74',
  1015. 'busstop':'\ud83d\ude8f',
  1016. 'bust_in_silhouette':'\ud83d\udc64',
  1017. 'busts_in_silhouette':'\ud83d\udc65',
  1018. 'butterfly':'\ud83e\udd8b',
  1019. 'cactus':'\ud83c\udf35',
  1020. 'cake':'\ud83c\udf70',
  1021. 'calendar':'\ud83d\udcc6',
  1022. 'call_me_hand':'\ud83e\udd19',
  1023. 'calling':'\ud83d\udcf2',
  1024. 'camel':'\ud83d\udc2b',
  1025. 'camera':'\ud83d\udcf7',
  1026. 'camera_flash':'\ud83d\udcf8',
  1027. 'camping':'\ud83c\udfd5',
  1028. 'cancer':'\u264b\ufe0f',
  1029. 'candle':'\ud83d\udd6f',
  1030. 'candy':'\ud83c\udf6c',
  1031. 'canoe':'\ud83d\udef6',
  1032. 'capital_abcd':'\ud83d\udd20',
  1033. 'capricorn':'\u2651\ufe0f',
  1034. 'car':'\ud83d\ude97',
  1035. 'card_file_box':'\ud83d\uddc3',
  1036. 'card_index':'\ud83d\udcc7',
  1037. 'card_index_dividers':'\ud83d\uddc2',
  1038. 'carousel_horse':'\ud83c\udfa0',
  1039. 'carrot':'\ud83e\udd55',
  1040. 'cat':'\ud83d\udc31',
  1041. 'cat2':'\ud83d\udc08',
  1042. 'cd':'\ud83d\udcbf',
  1043. 'chains':'\u26d3',
  1044. 'champagne':'\ud83c\udf7e',
  1045. 'chart':'\ud83d\udcb9',
  1046. 'chart_with_downwards_trend':'\ud83d\udcc9',
  1047. 'chart_with_upwards_trend':'\ud83d\udcc8',
  1048. 'checkered_flag':'\ud83c\udfc1',
  1049. 'cheese':'\ud83e\uddc0',
  1050. 'cherries':'\ud83c\udf52',
  1051. 'cherry_blossom':'\ud83c\udf38',
  1052. 'chestnut':'\ud83c\udf30',
  1053. 'chicken':'\ud83d\udc14',
  1054. 'children_crossing':'\ud83d\udeb8',
  1055. 'chipmunk':'\ud83d\udc3f',
  1056. 'chocolate_bar':'\ud83c\udf6b',
  1057. 'christmas_tree':'\ud83c\udf84',
  1058. 'church':'\u26ea\ufe0f',
  1059. 'cinema':'\ud83c\udfa6',
  1060. 'circus_tent':'\ud83c\udfaa',
  1061. 'city_sunrise':'\ud83c\udf07',
  1062. 'city_sunset':'\ud83c\udf06',
  1063. 'cityscape':'\ud83c\udfd9',
  1064. 'cl':'\ud83c\udd91',
  1065. 'clamp':'\ud83d\udddc',
  1066. 'clap':'\ud83d\udc4f',
  1067. 'clapper':'\ud83c\udfac',
  1068. 'classical_building':'\ud83c\udfdb',
  1069. 'clinking_glasses':'\ud83e\udd42',
  1070. 'clipboard':'\ud83d\udccb',
  1071. 'clock1':'\ud83d\udd50',
  1072. 'clock10':'\ud83d\udd59',
  1073. 'clock1030':'\ud83d\udd65',
  1074. 'clock11':'\ud83d\udd5a',
  1075. 'clock1130':'\ud83d\udd66',
  1076. 'clock12':'\ud83d\udd5b',
  1077. 'clock1230':'\ud83d\udd67',
  1078. 'clock130':'\ud83d\udd5c',
  1079. 'clock2':'\ud83d\udd51',
  1080. 'clock230':'\ud83d\udd5d',
  1081. 'clock3':'\ud83d\udd52',
  1082. 'clock330':'\ud83d\udd5e',
  1083. 'clock4':'\ud83d\udd53',
  1084. 'clock430':'\ud83d\udd5f',
  1085. 'clock5':'\ud83d\udd54',
  1086. 'clock530':'\ud83d\udd60',
  1087. 'clock6':'\ud83d\udd55',
  1088. 'clock630':'\ud83d\udd61',
  1089. 'clock7':'\ud83d\udd56',
  1090. 'clock730':'\ud83d\udd62',
  1091. 'clock8':'\ud83d\udd57',
  1092. 'clock830':'\ud83d\udd63',
  1093. 'clock9':'\ud83d\udd58',
  1094. 'clock930':'\ud83d\udd64',
  1095. 'closed_book':'\ud83d\udcd5',
  1096. 'closed_lock_with_key':'\ud83d\udd10',
  1097. 'closed_umbrella':'\ud83c\udf02',
  1098. 'cloud':'\u2601\ufe0f',
  1099. 'cloud_with_lightning':'\ud83c\udf29',
  1100. 'cloud_with_lightning_and_rain':'\u26c8',
  1101. 'cloud_with_rain':'\ud83c\udf27',
  1102. 'cloud_with_snow':'\ud83c\udf28',
  1103. 'clown_face':'\ud83e\udd21',
  1104. 'clubs':'\u2663\ufe0f',
  1105. 'cocktail':'\ud83c\udf78',
  1106. 'coffee':'\u2615\ufe0f',
  1107. 'coffin':'\u26b0\ufe0f',
  1108. 'cold_sweat':'\ud83d\ude30',
  1109. 'comet':'\u2604\ufe0f',
  1110. 'computer':'\ud83d\udcbb',
  1111. 'computer_mouse':'\ud83d\uddb1',
  1112. 'confetti_ball':'\ud83c\udf8a',
  1113. 'confounded':'\ud83d\ude16',
  1114. 'confused':'\ud83d\ude15',
  1115. 'congratulations':'\u3297\ufe0f',
  1116. 'construction':'\ud83d\udea7',
  1117. 'construction_worker_man':'\ud83d\udc77',
  1118. 'construction_worker_woman':'\ud83d\udc77&zwj;\u2640\ufe0f',
  1119. 'control_knobs':'\ud83c\udf9b',
  1120. 'convenience_store':'\ud83c\udfea',
  1121. 'cookie':'\ud83c\udf6a',
  1122. 'cool':'\ud83c\udd92',
  1123. 'policeman':'\ud83d\udc6e',
  1124. 'copyright':'\u00a9\ufe0f',
  1125. 'corn':'\ud83c\udf3d',
  1126. 'couch_and_lamp':'\ud83d\udecb',
  1127. 'couple':'\ud83d\udc6b',
  1128. 'couple_with_heart_woman_man':'\ud83d\udc91',
  1129. 'couple_with_heart_man_man':'\ud83d\udc68&zwj;\u2764\ufe0f&zwj;\ud83d\udc68',
  1130. 'couple_with_heart_woman_woman':'\ud83d\udc69&zwj;\u2764\ufe0f&zwj;\ud83d\udc69',
  1131. 'couplekiss_man_man':'\ud83d\udc68&zwj;\u2764\ufe0f&zwj;\ud83d\udc8b&zwj;\ud83d\udc68',
  1132. 'couplekiss_man_woman':'\ud83d\udc8f',
  1133. 'couplekiss_woman_woman':'\ud83d\udc69&zwj;\u2764\ufe0f&zwj;\ud83d\udc8b&zwj;\ud83d\udc69',
  1134. 'cow':'\ud83d\udc2e',
  1135. 'cow2':'\ud83d\udc04',
  1136. 'cowboy_hat_face':'\ud83e\udd20',
  1137. 'crab':'\ud83e\udd80',
  1138. 'crayon':'\ud83d\udd8d',
  1139. 'credit_card':'\ud83d\udcb3',
  1140. 'crescent_moon':'\ud83c\udf19',
  1141. 'cricket':'\ud83c\udfcf',
  1142. 'crocodile':'\ud83d\udc0a',
  1143. 'croissant':'\ud83e\udd50',
  1144. 'crossed_fingers':'\ud83e\udd1e',
  1145. 'crossed_flags':'\ud83c\udf8c',
  1146. 'crossed_swords':'\u2694\ufe0f',
  1147. 'crown':'\ud83d\udc51',
  1148. 'cry':'\ud83d\ude22',
  1149. 'crying_cat_face':'\ud83d\ude3f',
  1150. 'crystal_ball':'\ud83d\udd2e',
  1151. 'cucumber':'\ud83e\udd52',
  1152. 'cupid':'\ud83d\udc98',
  1153. 'curly_loop':'\u27b0',
  1154. 'currency_exchange':'\ud83d\udcb1',
  1155. 'curry':'\ud83c\udf5b',
  1156. 'custard':'\ud83c\udf6e',
  1157. 'customs':'\ud83d\udec3',
  1158. 'cyclone':'\ud83c\udf00',
  1159. 'dagger':'\ud83d\udde1',
  1160. 'dancer':'\ud83d\udc83',
  1161. 'dancing_women':'\ud83d\udc6f',
  1162. 'dancing_men':'\ud83d\udc6f&zwj;\u2642\ufe0f',
  1163. 'dango':'\ud83c\udf61',
  1164. 'dark_sunglasses':'\ud83d\udd76',
  1165. 'dart':'\ud83c\udfaf',
  1166. 'dash':'\ud83d\udca8',
  1167. 'date':'\ud83d\udcc5',
  1168. 'deciduous_tree':'\ud83c\udf33',
  1169. 'deer':'\ud83e\udd8c',
  1170. 'department_store':'\ud83c\udfec',
  1171. 'derelict_house':'\ud83c\udfda',
  1172. 'desert':'\ud83c\udfdc',
  1173. 'desert_island':'\ud83c\udfdd',
  1174. 'desktop_computer':'\ud83d\udda5',
  1175. 'male_detective':'\ud83d\udd75\ufe0f',
  1176. 'diamond_shape_with_a_dot_inside':'\ud83d\udca0',
  1177. 'diamonds':'\u2666\ufe0f',
  1178. 'disappointed':'\ud83d\ude1e',
  1179. 'disappointed_relieved':'\ud83d\ude25',
  1180. 'dizzy':'\ud83d\udcab',
  1181. 'dizzy_face':'\ud83d\ude35',
  1182. 'do_not_litter':'\ud83d\udeaf',
  1183. 'dog':'\ud83d\udc36',
  1184. 'dog2':'\ud83d\udc15',
  1185. 'dollar':'\ud83d\udcb5',
  1186. 'dolls':'\ud83c\udf8e',
  1187. 'dolphin':'\ud83d\udc2c',
  1188. 'door':'\ud83d\udeaa',
  1189. 'doughnut':'\ud83c\udf69',
  1190. 'dove':'\ud83d\udd4a',
  1191. 'dragon':'\ud83d\udc09',
  1192. 'dragon_face':'\ud83d\udc32',
  1193. 'dress':'\ud83d\udc57',
  1194. 'dromedary_camel':'\ud83d\udc2a',
  1195. 'drooling_face':'\ud83e\udd24',
  1196. 'droplet':'\ud83d\udca7',
  1197. 'drum':'\ud83e\udd41',
  1198. 'duck':'\ud83e\udd86',
  1199. 'dvd':'\ud83d\udcc0',
  1200. 'e-mail':'\ud83d\udce7',
  1201. 'eagle':'\ud83e\udd85',
  1202. 'ear':'\ud83d\udc42',
  1203. 'ear_of_rice':'\ud83c\udf3e',
  1204. 'earth_africa':'\ud83c\udf0d',
  1205. 'earth_americas':'\ud83c\udf0e',
  1206. 'earth_asia':'\ud83c\udf0f',
  1207. 'egg':'\ud83e\udd5a',
  1208. 'eggplant':'\ud83c\udf46',
  1209. 'eight_pointed_black_star':'\u2734\ufe0f',
  1210. 'eight_spoked_asterisk':'\u2733\ufe0f',
  1211. 'electric_plug':'\ud83d\udd0c',
  1212. 'elephant':'\ud83d\udc18',
  1213. 'email':'\u2709\ufe0f',
  1214. 'end':'\ud83d\udd1a',
  1215. 'envelope_with_arrow':'\ud83d\udce9',
  1216. 'euro':'\ud83d\udcb6',
  1217. 'european_castle':'\ud83c\udff0',
  1218. 'european_post_office':'\ud83c\udfe4',
  1219. 'evergreen_tree':'\ud83c\udf32',
  1220. 'exclamation':'\u2757\ufe0f',
  1221. 'expressionless':'\ud83d\ude11',
  1222. 'eye':'\ud83d\udc41',
  1223. 'eye_speech_bubble':'\ud83d\udc41&zwj;\ud83d\udde8',
  1224. 'eyeglasses':'\ud83d\udc53',
  1225. 'eyes':'\ud83d\udc40',
  1226. 'face_with_head_bandage':'\ud83e\udd15',
  1227. 'face_with_thermometer':'\ud83e\udd12',
  1228. 'fist_oncoming':'\ud83d\udc4a',
  1229. 'factory':'\ud83c\udfed',
  1230. 'fallen_leaf':'\ud83c\udf42',
  1231. 'family_man_woman_boy':'\ud83d\udc6a',
  1232. 'family_man_boy':'\ud83d\udc68&zwj;\ud83d\udc66',
  1233. 'family_man_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
  1234. 'family_man_girl':'\ud83d\udc68&zwj;\ud83d\udc67',
  1235. 'family_man_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
  1236. 'family_man_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
  1237. 'family_man_man_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc66',
  1238. 'family_man_man_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
  1239. 'family_man_man_girl':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67',
  1240. 'family_man_man_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
  1241. 'family_man_man_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
  1242. 'family_man_woman_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
  1243. 'family_man_woman_girl':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67',
  1244. 'family_man_woman_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
  1245. 'family_man_woman_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
  1246. 'family_woman_boy':'\ud83d\udc69&zwj;\ud83d\udc66',
  1247. 'family_woman_boy_boy':'\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
  1248. 'family_woman_girl':'\ud83d\udc69&zwj;\ud83d\udc67',
  1249. 'family_woman_girl_boy':'\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
  1250. 'family_woman_girl_girl':'\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
  1251. 'family_woman_woman_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc66',
  1252. 'family_woman_woman_boy_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
  1253. 'family_woman_woman_girl':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67',
  1254. 'family_woman_woman_girl_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
  1255. 'family_woman_woman_girl_girl':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
  1256. 'fast_forward':'\u23e9',
  1257. 'fax':'\ud83d\udce0',
  1258. 'fearful':'\ud83d\ude28',
  1259. 'feet':'\ud83d\udc3e',
  1260. 'female_detective':'\ud83d\udd75\ufe0f&zwj;\u2640\ufe0f',
  1261. 'ferris_wheel':'\ud83c\udfa1',
  1262. 'ferry':'\u26f4',
  1263. 'field_hockey':'\ud83c\udfd1',
  1264. 'file_cabinet':'\ud83d\uddc4',
  1265. 'file_folder':'\ud83d\udcc1',
  1266. 'film_projector':'\ud83d\udcfd',
  1267. 'film_strip':'\ud83c\udf9e',
  1268. 'fire':'\ud83d\udd25',
  1269. 'fire_engine':'\ud83d\ude92',
  1270. 'fireworks':'\ud83c\udf86',
  1271. 'first_quarter_moon':'\ud83c\udf13',
  1272. 'first_quarter_moon_with_face':'\ud83c\udf1b',
  1273. 'fish':'\ud83d\udc1f',
  1274. 'fish_cake':'\ud83c\udf65',
  1275. 'fishing_pole_and_fish':'\ud83c\udfa3',
  1276. 'fist_raised':'\u270a',
  1277. 'fist_left':'\ud83e\udd1b',
  1278. 'fist_right':'\ud83e\udd1c',
  1279. 'flags':'\ud83c\udf8f',
  1280. 'flashlight':'\ud83d\udd26',
  1281. 'fleur_de_lis':'\u269c\ufe0f',
  1282. 'flight_arrival':'\ud83d\udeec',
  1283. 'flight_departure':'\ud83d\udeeb',
  1284. 'floppy_disk':'\ud83d\udcbe',
  1285. 'flower_playing_cards':'\ud83c\udfb4',
  1286. 'flushed':'\ud83d\ude33',
  1287. 'fog':'\ud83c\udf2b',
  1288. 'foggy':'\ud83c\udf01',
  1289. 'football':'\ud83c\udfc8',
  1290. 'footprints':'\ud83d\udc63',
  1291. 'fork_and_knife':'\ud83c\udf74',
  1292. 'fountain':'\u26f2\ufe0f',
  1293. 'fountain_pen':'\ud83d\udd8b',
  1294. 'four_leaf_clover':'\ud83c\udf40',
  1295. 'fox_face':'\ud83e\udd8a',
  1296. 'framed_picture':'\ud83d\uddbc',
  1297. 'free':'\ud83c\udd93',
  1298. 'fried_egg':'\ud83c\udf73',
  1299. 'fried_shrimp':'\ud83c\udf64',
  1300. 'fries':'\ud83c\udf5f',
  1301. 'frog':'\ud83d\udc38',
  1302. 'frowning':'\ud83d\ude26',
  1303. 'frowning_face':'\u2639\ufe0f',
  1304. 'frowning_man':'\ud83d\ude4d&zwj;\u2642\ufe0f',
  1305. 'frowning_woman':'\ud83d\ude4d',
  1306. 'middle_finger':'\ud83d\udd95',
  1307. 'fuelpump':'\u26fd\ufe0f',
  1308. 'full_moon':'\ud83c\udf15',
  1309. 'full_moon_with_face':'\ud83c\udf1d',
  1310. 'funeral_urn':'\u26b1\ufe0f',
  1311. 'game_die':'\ud83c\udfb2',
  1312. 'gear':'\u2699\ufe0f',
  1313. 'gem':'\ud83d\udc8e',
  1314. 'gemini':'\u264a\ufe0f',
  1315. 'ghost':'\ud83d\udc7b',
  1316. 'gift':'\ud83c\udf81',
  1317. 'gift_heart':'\ud83d\udc9d',
  1318. 'girl':'\ud83d\udc67',
  1319. 'globe_with_meridians':'\ud83c\udf10',
  1320. 'goal_net':'\ud83e\udd45',
  1321. 'goat':'\ud83d\udc10',
  1322. 'golf':'\u26f3\ufe0f',
  1323. 'golfing_man':'\ud83c\udfcc\ufe0f',
  1324. 'golfing_woman':'\ud83c\udfcc\ufe0f&zwj;\u2640\ufe0f',
  1325. 'gorilla':'\ud83e\udd8d',
  1326. 'grapes':'\ud83c\udf47',
  1327. 'green_apple':'\ud83c\udf4f',
  1328. 'green_book':'\ud83d\udcd7',
  1329. 'green_heart':'\ud83d\udc9a',
  1330. 'green_salad':'\ud83e\udd57',
  1331. 'grey_exclamation':'\u2755',
  1332. 'grey_question':'\u2754',
  1333. 'grimacing':'\ud83d\ude2c',
  1334. 'grin':'\ud83d\ude01',
  1335. 'grinning':'\ud83d\ude00',
  1336. 'guardsman':'\ud83d\udc82',
  1337. 'guardswoman':'\ud83d\udc82&zwj;\u2640\ufe0f',
  1338. 'guitar':'\ud83c\udfb8',
  1339. 'gun':'\ud83d\udd2b',
  1340. 'haircut_woman':'\ud83d\udc87',
  1341. 'haircut_man':'\ud83d\udc87&zwj;\u2642\ufe0f',
  1342. 'hamburger':'\ud83c\udf54',
  1343. 'hammer':'\ud83d\udd28',
  1344. 'hammer_and_pick':'\u2692',
  1345. 'hammer_and_wrench':'\ud83d\udee0',
  1346. 'hamster':'\ud83d\udc39',
  1347. 'hand':'\u270b',
  1348. 'handbag':'\ud83d\udc5c',
  1349. 'handshake':'\ud83e\udd1d',
  1350. 'hankey':'\ud83d\udca9',
  1351. 'hatched_chick':'\ud83d\udc25',
  1352. 'hatching_chick':'\ud83d\udc23',
  1353. 'headphones':'\ud83c\udfa7',
  1354. 'hear_no_evil':'\ud83d\ude49',
  1355. 'heart':'\u2764\ufe0f',
  1356. 'heart_decoration':'\ud83d\udc9f',
  1357. 'heart_eyes':'\ud83d\ude0d',
  1358. 'heart_eyes_cat':'\ud83d\ude3b',
  1359. 'heartbeat':'\ud83d\udc93',
  1360. 'heartpulse':'\ud83d\udc97',
  1361. 'hearts':'\u2665\ufe0f',
  1362. 'heavy_check_mark':'\u2714\ufe0f',
  1363. 'heavy_division_sign':'\u2797',
  1364. 'heavy_dollar_sign':'\ud83d\udcb2',
  1365. 'heavy_heart_exclamation':'\u2763\ufe0f',
  1366. 'heavy_minus_sign':'\u2796',
  1367. 'heavy_multiplication_x':'\u2716\ufe0f',
  1368. 'heavy_plus_sign':'\u2795',
  1369. 'helicopter':'\ud83d\ude81',
  1370. 'herb':'\ud83c\udf3f',
  1371. 'hibiscus':'\ud83c\udf3a',
  1372. 'high_brightness':'\ud83d\udd06',
  1373. 'high_heel':'\ud83d\udc60',
  1374. 'hocho':'\ud83d\udd2a',
  1375. 'hole':'\ud83d\udd73',
  1376. 'honey_pot':'\ud83c\udf6f',
  1377. 'horse':'\ud83d\udc34',
  1378. 'horse_racing':'\ud83c\udfc7',
  1379. 'hospital':'\ud83c\udfe5',
  1380. 'hot_pepper':'\ud83c\udf36',
  1381. 'hotdog':'\ud83c\udf2d',
  1382. 'hotel':'\ud83c\udfe8',
  1383. 'hotsprings':'\u2668\ufe0f',
  1384. 'hourglass':'\u231b\ufe0f',
  1385. 'hourglass_flowing_sand':'\u23f3',
  1386. 'house':'\ud83c\udfe0',
  1387. 'house_with_garden':'\ud83c\udfe1',
  1388. 'houses':'\ud83c\udfd8',
  1389. 'hugs':'\ud83e\udd17',
  1390. 'hushed':'\ud83d\ude2f',
  1391. 'ice_cream':'\ud83c\udf68',
  1392. 'ice_hockey':'\ud83c\udfd2',
  1393. 'ice_skate':'\u26f8',
  1394. 'icecream':'\ud83c\udf66',
  1395. 'id':'\ud83c\udd94',
  1396. 'ideograph_advantage':'\ud83c\ude50',
  1397. 'imp':'\ud83d\udc7f',
  1398. 'inbox_tray':'\ud83d\udce5',
  1399. 'incoming_envelope':'\ud83d\udce8',
  1400. 'tipping_hand_woman':'\ud83d\udc81',
  1401. 'information_source':'\u2139\ufe0f',
  1402. 'innocent':'\ud83d\ude07',
  1403. 'interrobang':'\u2049\ufe0f',
  1404. 'iphone':'\ud83d\udcf1',
  1405. 'izakaya_lantern':'\ud83c\udfee',
  1406. 'jack_o_lantern':'\ud83c\udf83',
  1407. 'japan':'\ud83d\uddfe',
  1408. 'japanese_castle':'\ud83c\udfef',
  1409. 'japanese_goblin':'\ud83d\udc7a',
  1410. 'japanese_ogre':'\ud83d\udc79',
  1411. 'jeans':'\ud83d\udc56',
  1412. 'joy':'\ud83d\ude02',
  1413. 'joy_cat':'\ud83d\ude39',
  1414. 'joystick':'\ud83d\udd79',
  1415. 'kaaba':'\ud83d\udd4b',
  1416. 'key':'\ud83d\udd11',
  1417. 'keyboard':'\u2328\ufe0f',
  1418. 'keycap_ten':'\ud83d\udd1f',
  1419. 'kick_scooter':'\ud83d\udef4',
  1420. 'kimono':'\ud83d\udc58',
  1421. 'kiss':'\ud83d\udc8b',
  1422. 'kissing':'\ud83d\ude17',
  1423. 'kissing_cat':'\ud83d\ude3d',
  1424. 'kissing_closed_eyes':'\ud83d\ude1a',
  1425. 'kissing_heart':'\ud83d\ude18',
  1426. 'kissing_smiling_eyes':'\ud83d\ude19',
  1427. 'kiwi_fruit':'\ud83e\udd5d',
  1428. 'koala':'\ud83d\udc28',
  1429. 'koko':'\ud83c\ude01',
  1430. 'label':'\ud83c\udff7',
  1431. 'large_blue_circle':'\ud83d\udd35',
  1432. 'large_blue_diamond':'\ud83d\udd37',
  1433. 'large_orange_diamond':'\ud83d\udd36',
  1434. 'last_quarter_moon':'\ud83c\udf17',
  1435. 'last_quarter_moon_with_face':'\ud83c\udf1c',
  1436. 'latin_cross':'\u271d\ufe0f',
  1437. 'laughing':'\ud83d\ude06',
  1438. 'leaves':'\ud83c\udf43',
  1439. 'ledger':'\ud83d\udcd2',
  1440. 'left_luggage':'\ud83d\udec5',
  1441. 'left_right_arrow':'\u2194\ufe0f',
  1442. 'leftwards_arrow_with_hook':'\u21a9\ufe0f',
  1443. 'lemon':'\ud83c\udf4b',
  1444. 'leo':'\u264c\ufe0f',
  1445. 'leopard':'\ud83d\udc06',
  1446. 'level_slider':'\ud83c\udf9a',
  1447. 'libra':'\u264e\ufe0f',
  1448. 'light_rail':'\ud83d\ude88',
  1449. 'link':'\ud83d\udd17',
  1450. 'lion':'\ud83e\udd81',
  1451. 'lips':'\ud83d\udc44',
  1452. 'lipstick':'\ud83d\udc84',
  1453. 'lizard':'\ud83e\udd8e',
  1454. 'lock':'\ud83d\udd12',
  1455. 'lock_with_ink_pen':'\ud83d\udd0f',
  1456. 'lollipop':'\ud83c\udf6d',
  1457. 'loop':'\u27bf',
  1458. 'loud_sound':'\ud83d\udd0a',
  1459. 'loudspeaker':'\ud83d\udce2',
  1460. 'love_hotel':'\ud83c\udfe9',
  1461. 'love_letter':'\ud83d\udc8c',
  1462. 'low_brightness':'\ud83d\udd05',
  1463. 'lying_face':'\ud83e\udd25',
  1464. 'm':'\u24c2\ufe0f',
  1465. 'mag':'\ud83d\udd0d',
  1466. 'mag_right':'\ud83d\udd0e',
  1467. 'mahjong':'\ud83c\udc04\ufe0f',
  1468. 'mailbox':'\ud83d\udceb',
  1469. 'mailbox_closed':'\ud83d\udcea',
  1470. 'mailbox_with_mail':'\ud83d\udcec',
  1471. 'mailbox_with_no_mail':'\ud83d\udced',
  1472. 'man':'\ud83d\udc68',
  1473. 'man_artist':'\ud83d\udc68&zwj;\ud83c\udfa8',
  1474. 'man_astronaut':'\ud83d\udc68&zwj;\ud83d\ude80',
  1475. 'man_cartwheeling':'\ud83e\udd38&zwj;\u2642\ufe0f',
  1476. 'man_cook':'\ud83d\udc68&zwj;\ud83c\udf73',
  1477. 'man_dancing':'\ud83d\udd7a',
  1478. 'man_facepalming':'\ud83e\udd26&zwj;\u2642\ufe0f',
  1479. 'man_factory_worker':'\ud83d\udc68&zwj;\ud83c\udfed',
  1480. 'man_farmer':'\ud83d\udc68&zwj;\ud83c\udf3e',
  1481. 'man_firefighter':'\ud83d\udc68&zwj;\ud83d\ude92',
  1482. 'man_health_worker':'\ud83d\udc68&zwj;\u2695\ufe0f',
  1483. 'man_in_tuxedo':'\ud83e\udd35',
  1484. 'man_judge':'\ud83d\udc68&zwj;\u2696\ufe0f',
  1485. 'man_juggling':'\ud83e\udd39&zwj;\u2642\ufe0f',
  1486. 'man_mechanic':'\ud83d\udc68&zwj;\ud83d\udd27',
  1487. 'man_office_worker':'\ud83d\udc68&zwj;\ud83d\udcbc',
  1488. 'man_pilot':'\ud83d\udc68&zwj;\u2708\ufe0f',
  1489. 'man_playing_handball':'\ud83e\udd3e&zwj;\u2642\ufe0f',
  1490. 'man_playing_water_polo':'\ud83e\udd3d&zwj;\u2642\ufe0f',
  1491. 'man_scientist':'\ud83d\udc68&zwj;\ud83d\udd2c',
  1492. 'man_shrugging':'\ud83e\udd37&zwj;\u2642\ufe0f',
  1493. 'man_singer':'\ud83d\udc68&zwj;\ud83c\udfa4',
  1494. 'man_student':'\ud83d\udc68&zwj;\ud83c\udf93',
  1495. 'man_teacher':'\ud83d\udc68&zwj;\ud83c\udfeb',
  1496. 'man_technologist':'\ud83d\udc68&zwj;\ud83d\udcbb',
  1497. 'man_with_gua_pi_mao':'\ud83d\udc72',
  1498. 'man_with_turban':'\ud83d\udc73',
  1499. 'tangerine':'\ud83c\udf4a',
  1500. 'mans_shoe':'\ud83d\udc5e',
  1501. 'mantelpiece_clock':'\ud83d\udd70',
  1502. 'maple_leaf':'\ud83c\udf41',
  1503. 'martial_arts_uniform':'\ud83e\udd4b',
  1504. 'mask':'\ud83d\ude37',
  1505. 'massage_woman':'\ud83d\udc86',
  1506. 'massage_man':'\ud83d\udc86&zwj;\u2642\ufe0f',
  1507. 'meat_on_bone':'\ud83c\udf56',
  1508. 'medal_military':'\ud83c\udf96',
  1509. 'medal_sports':'\ud83c\udfc5',
  1510. 'mega':'\ud83d\udce3',
  1511. 'melon':'\ud83c\udf48',
  1512. 'memo':'\ud83d\udcdd',
  1513. 'men_wrestling':'\ud83e\udd3c&zwj;\u2642\ufe0f',
  1514. 'menorah':'\ud83d\udd4e',
  1515. 'mens':'\ud83d\udeb9',
  1516. 'metal':'\ud83e\udd18',
  1517. 'metro':'\ud83d\ude87',
  1518. 'microphone':'\ud83c\udfa4',
  1519. 'microscope':'\ud83d\udd2c',
  1520. 'milk_glass':'\ud83e\udd5b',
  1521. 'milky_way':'\ud83c\udf0c',
  1522. 'minibus':'\ud83d\ude90',
  1523. 'minidisc':'\ud83d\udcbd',
  1524. 'mobile_phone_off':'\ud83d\udcf4',
  1525. 'money_mouth_face':'\ud83e\udd11',
  1526. 'money_with_wings':'\ud83d\udcb8',
  1527. 'moneybag':'\ud83d\udcb0',
  1528. 'monkey':'\ud83d\udc12',
  1529. 'monkey_face':'\ud83d\udc35',
  1530. 'monorail':'\ud83d\ude9d',
  1531. 'moon':'\ud83c\udf14',
  1532. 'mortar_board':'\ud83c\udf93',
  1533. 'mosque':'\ud83d\udd4c',
  1534. 'motor_boat':'\ud83d\udee5',
  1535. 'motor_scooter':'\ud83d\udef5',
  1536. 'motorcycle':'\ud83c\udfcd',
  1537. 'motorway':'\ud83d\udee3',
  1538. 'mount_fuji':'\ud83d\uddfb',
  1539. 'mountain':'\u26f0',
  1540. 'mountain_biking_man':'\ud83d\udeb5',
  1541. 'mountain_biking_woman':'\ud83d\udeb5&zwj;\u2640\ufe0f',
  1542. 'mountain_cableway':'\ud83d\udea0',
  1543. 'mountain_railway':'\ud83d\ude9e',
  1544. 'mountain_snow':'\ud83c\udfd4',
  1545. 'mouse':'\ud83d\udc2d',
  1546. 'mouse2':'\ud83d\udc01',
  1547. 'movie_camera':'\ud83c\udfa5',
  1548. 'moyai':'\ud83d\uddff',
  1549. 'mrs_claus':'\ud83e\udd36',
  1550. 'muscle':'\ud83d\udcaa',
  1551. 'mushroom':'\ud83c\udf44',
  1552. 'musical_keyboard':'\ud83c\udfb9',
  1553. 'musical_note':'\ud83c\udfb5',
  1554. 'musical_score':'\ud83c\udfbc',
  1555. 'mute':'\ud83d\udd07',
  1556. 'nail_care':'\ud83d\udc85',
  1557. 'name_badge':'\ud83d\udcdb',
  1558. 'national_park':'\ud83c\udfde',
  1559. 'nauseated_face':'\ud83e\udd22',
  1560. 'necktie':'\ud83d\udc54',
  1561. 'negative_squared_cross_mark':'\u274e',
  1562. 'nerd_face':'\ud83e\udd13',
  1563. 'neutral_face':'\ud83d\ude10',
  1564. 'new':'\ud83c\udd95',
  1565. 'new_moon':'\ud83c\udf11',
  1566. 'new_moon_with_face':'\ud83c\udf1a',
  1567. 'newspaper':'\ud83d\udcf0',
  1568. 'newspaper_roll':'\ud83d\uddde',
  1569. 'next_track_button':'\u23ed',
  1570. 'ng':'\ud83c\udd96',
  1571. 'no_good_man':'\ud83d\ude45&zwj;\u2642\ufe0f',
  1572. 'no_good_woman':'\ud83d\ude45',
  1573. 'night_with_stars':'\ud83c\udf03',
  1574. 'no_bell':'\ud83d\udd15',
  1575. 'no_bicycles':'\ud83d\udeb3',
  1576. 'no_entry':'\u26d4\ufe0f',
  1577. 'no_entry_sign':'\ud83d\udeab',
  1578. 'no_mobile_phones':'\ud83d\udcf5',
  1579. 'no_mouth':'\ud83d\ude36',
  1580. 'no_pedestrians':'\ud83d\udeb7',
  1581. 'no_smoking':'\ud83d\udead',
  1582. 'non-potable_water':'\ud83d\udeb1',
  1583. 'nose':'\ud83d\udc43',
  1584. 'notebook':'\ud83d\udcd3',
  1585. 'notebook_with_decorative_cover':'\ud83d\udcd4',
  1586. 'notes':'\ud83c\udfb6',
  1587. 'nut_and_bolt':'\ud83d\udd29',
  1588. 'o':'\u2b55\ufe0f',
  1589. 'o2':'\ud83c\udd7e\ufe0f',
  1590. 'ocean':'\ud83c\udf0a',
  1591. 'octopus':'\ud83d\udc19',
  1592. 'oden':'\ud83c\udf62',
  1593. 'office':'\ud83c\udfe2',
  1594. 'oil_drum':'\ud83d\udee2',
  1595. 'ok':'\ud83c\udd97',
  1596. 'ok_hand':'\ud83d\udc4c',
  1597. 'ok_man':'\ud83d\ude46&zwj;\u2642\ufe0f',
  1598. 'ok_woman':'\ud83d\ude46',
  1599. 'old_key':'\ud83d\udddd',
  1600. 'older_man':'\ud83d\udc74',
  1601. 'older_woman':'\ud83d\udc75',
  1602. 'om':'\ud83d\udd49',
  1603. 'on':'\ud83d\udd1b',
  1604. 'oncoming_automobile':'\ud83d\ude98',
  1605. 'oncoming_bus':'\ud83d\ude8d',
  1606. 'oncoming_police_car':'\ud83d\ude94',
  1607. 'oncoming_taxi':'\ud83d\ude96',
  1608. 'open_file_folder':'\ud83d\udcc2',
  1609. 'open_hands':'\ud83d\udc50',
  1610. 'open_mouth':'\ud83d\ude2e',
  1611. 'open_umbrella':'\u2602\ufe0f',
  1612. 'ophiuchus':'\u26ce',
  1613. 'orange_book':'\ud83d\udcd9',
  1614. 'orthodox_cross':'\u2626\ufe0f',
  1615. 'outbox_tray':'\ud83d\udce4',
  1616. 'owl':'\ud83e\udd89',
  1617. 'ox':'\ud83d\udc02',
  1618. 'package':'\ud83d\udce6',
  1619. 'page_facing_up':'\ud83d\udcc4',
  1620. 'page_with_curl':'\ud83d\udcc3',
  1621. 'pager':'\ud83d\udcdf',
  1622. 'paintbrush':'\ud83d\udd8c',
  1623. 'palm_tree':'\ud83c\udf34',
  1624. 'pancakes':'\ud83e\udd5e',
  1625. 'panda_face':'\ud83d\udc3c',
  1626. 'paperclip':'\ud83d\udcce',
  1627. 'paperclips':'\ud83d\udd87',
  1628. 'parasol_on_ground':'\u26f1',
  1629. 'parking':'\ud83c\udd7f\ufe0f',
  1630. 'part_alternation_mark':'\u303d\ufe0f',
  1631. 'partly_sunny':'\u26c5\ufe0f',
  1632. 'passenger_ship':'\ud83d\udef3',
  1633. 'passport_control':'\ud83d\udec2',
  1634. 'pause_button':'\u23f8',
  1635. 'peace_symbol':'\u262e\ufe0f',
  1636. 'peach':'\ud83c\udf51',
  1637. 'peanuts':'\ud83e\udd5c',
  1638. 'pear':'\ud83c\udf50',
  1639. 'pen':'\ud83d\udd8a',
  1640. 'pencil2':'\u270f\ufe0f',
  1641. 'penguin':'\ud83d\udc27',
  1642. 'pensive':'\ud83d\ude14',
  1643. 'performing_arts':'\ud83c\udfad',
  1644. 'persevere':'\ud83d\ude23',
  1645. 'person_fencing':'\ud83e\udd3a',
  1646. 'pouting_woman':'\ud83d\ude4e',
  1647. 'phone':'\u260e\ufe0f',
  1648. 'pick':'\u26cf',
  1649. 'pig':'\ud83d\udc37',
  1650. 'pig2':'\ud83d\udc16',
  1651. 'pig_nose':'\ud83d\udc3d',
  1652. 'pill':'\ud83d\udc8a',
  1653. 'pineapple':'\ud83c\udf4d',
  1654. 'ping_pong':'\ud83c\udfd3',
  1655. 'pisces':'\u2653\ufe0f',
  1656. 'pizza':'\ud83c\udf55',
  1657. 'place_of_worship':'\ud83d\uded0',
  1658. 'plate_with_cutlery':'\ud83c\udf7d',
  1659. 'play_or_pause_button':'\u23ef',
  1660. 'point_down':'\ud83d\udc47',
  1661. 'point_left':'\ud83d\udc48',
  1662. 'point_right':'\ud83d\udc49',
  1663. 'point_up':'\u261d\ufe0f',
  1664. 'point_up_2':'\ud83d\udc46',
  1665. 'police_car':'\ud83d\ude93',
  1666. 'policewoman':'\ud83d\udc6e&zwj;\u2640\ufe0f',
  1667. 'poodle':'\ud83d\udc29',
  1668. 'popcorn':'\ud83c\udf7f',
  1669. 'post_office':'\ud83c\udfe3',
  1670. 'postal_horn':'\ud83d\udcef',
  1671. 'postbox':'\ud83d\udcee',
  1672. 'potable_water':'\ud83d\udeb0',
  1673. 'potato':'\ud83e\udd54',
  1674. 'pouch':'\ud83d\udc5d',
  1675. 'poultry_leg':'\ud83c\udf57',
  1676. 'pound':'\ud83d\udcb7',
  1677. 'rage':'\ud83d\ude21',
  1678. 'pouting_cat':'\ud83d\ude3e',
  1679. 'pouting_man':'\ud83d\ude4e&zwj;\u2642\ufe0f',
  1680. 'pray':'\ud83d\ude4f',
  1681. 'prayer_beads':'\ud83d\udcff',
  1682. 'pregnant_woman':'\ud83e\udd30',
  1683. 'previous_track_button':'\u23ee',
  1684. 'prince':'\ud83e\udd34',
  1685. 'princess':'\ud83d\udc78',
  1686. 'printer':'\ud83d\udda8',
  1687. 'purple_heart':'\ud83d\udc9c',
  1688. 'purse':'\ud83d\udc5b',
  1689. 'pushpin':'\ud83d\udccc',
  1690. 'put_litter_in_its_place':'\ud83d\udeae',
  1691. 'question':'\u2753',
  1692. 'rabbit':'\ud83d\udc30',
  1693. 'rabbit2':'\ud83d\udc07',
  1694. 'racehorse':'\ud83d\udc0e',
  1695. 'racing_car':'\ud83c\udfce',
  1696. 'radio':'\ud83d\udcfb',
  1697. 'radio_button':'\ud83d\udd18',
  1698. 'radioactive':'\u2622\ufe0f',
  1699. 'railway_car':'\ud83d\ude83',
  1700. 'railway_track':'\ud83d\udee4',
  1701. 'rainbow':'\ud83c\udf08',
  1702. 'rainbow_flag':'\ud83c\udff3\ufe0f&zwj;\ud83c\udf08',
  1703. 'raised_back_of_hand':'\ud83e\udd1a',
  1704. 'raised_hand_with_fingers_splayed':'\ud83d\udd90',
  1705. 'raised_hands':'\ud83d\ude4c',
  1706. 'raising_hand_woman':'\ud83d\ude4b',
  1707. 'raising_hand_man':'\ud83d\ude4b&zwj;\u2642\ufe0f',
  1708. 'ram':'\ud83d\udc0f',
  1709. 'ramen':'\ud83c\udf5c',
  1710. 'rat':'\ud83d\udc00',
  1711. 'record_button':'\u23fa',
  1712. 'recycle':'\u267b\ufe0f',
  1713. 'red_circle':'\ud83d\udd34',
  1714. 'registered':'\u00ae\ufe0f',
  1715. 'relaxed':'\u263a\ufe0f',
  1716. 'relieved':'\ud83d\ude0c',
  1717. 'reminder_ribbon':'\ud83c\udf97',
  1718. 'repeat':'\ud83d\udd01',
  1719. 'repeat_one':'\ud83d\udd02',
  1720. 'rescue_worker_helmet':'\u26d1',
  1721. 'restroom':'\ud83d\udebb',
  1722. 'revolving_hearts':'\ud83d\udc9e',
  1723. 'rewind':'\u23ea',
  1724. 'rhinoceros':'\ud83e\udd8f',
  1725. 'ribbon':'\ud83c\udf80',
  1726. 'rice':'\ud83c\udf5a',
  1727. 'rice_ball':'\ud83c\udf59',
  1728. 'rice_cracker':'\ud83c\udf58',
  1729. 'rice_scene':'\ud83c\udf91',
  1730. 'right_anger_bubble':'\ud83d\uddef',
  1731. 'ring':'\ud83d\udc8d',
  1732. 'robot':'\ud83e\udd16',
  1733. 'rocket':'\ud83d\ude80',
  1734. 'rofl':'\ud83e\udd23',
  1735. 'roll_eyes':'\ud83d\ude44',
  1736. 'roller_coaster':'\ud83c\udfa2',
  1737. 'rooster':'\ud83d\udc13',
  1738. 'rose':'\ud83c\udf39',
  1739. 'rosette':'\ud83c\udff5',
  1740. 'rotating_light':'\ud83d\udea8',
  1741. 'round_pushpin':'\ud83d\udccd',
  1742. 'rowing_man':'\ud83d\udea3',
  1743. 'rowing_woman':'\ud83d\udea3&zwj;\u2640\ufe0f',
  1744. 'rugby_football':'\ud83c\udfc9',
  1745. 'running_man':'\ud83c\udfc3',
  1746. 'running_shirt_with_sash':'\ud83c\udfbd',
  1747. 'running_woman':'\ud83c\udfc3&zwj;\u2640\ufe0f',
  1748. 'sa':'\ud83c\ude02\ufe0f',
  1749. 'sagittarius':'\u2650\ufe0f',
  1750. 'sake':'\ud83c\udf76',
  1751. 'sandal':'\ud83d\udc61',
  1752. 'santa':'\ud83c\udf85',
  1753. 'satellite':'\ud83d\udce1',
  1754. 'saxophone':'\ud83c\udfb7',
  1755. 'school':'\ud83c\udfeb',
  1756. 'school_satchel':'\ud83c\udf92',
  1757. 'scissors':'\u2702\ufe0f',
  1758. 'scorpion':'\ud83e\udd82',
  1759. 'scorpius':'\u264f\ufe0f',
  1760. 'scream':'\ud83d\ude31',
  1761. 'scream_cat':'\ud83d\ude40',
  1762. 'scroll':'\ud83d\udcdc',
  1763. 'seat':'\ud83d\udcba',
  1764. 'secret':'\u3299\ufe0f',
  1765. 'see_no_evil':'\ud83d\ude48',
  1766. 'seedling':'\ud83c\udf31',
  1767. 'selfie':'\ud83e\udd33',
  1768. 'shallow_pan_of_food':'\ud83e\udd58',
  1769. 'shamrock':'\u2618\ufe0f',
  1770. 'shark':'\ud83e\udd88',
  1771. 'shaved_ice':'\ud83c\udf67',
  1772. 'sheep':'\ud83d\udc11',
  1773. 'shell':'\ud83d\udc1a',
  1774. 'shield':'\ud83d\udee1',
  1775. 'shinto_shrine':'\u26e9',
  1776. 'ship':'\ud83d\udea2',
  1777. 'shirt':'\ud83d\udc55',
  1778. 'shopping':'\ud83d\udecd',
  1779. 'shopping_cart':'\ud83d\uded2',
  1780. 'shower':'\ud83d\udebf',
  1781. 'shrimp':'\ud83e\udd90',
  1782. 'signal_strength':'\ud83d\udcf6',
  1783. 'six_pointed_star':'\ud83d\udd2f',
  1784. 'ski':'\ud83c\udfbf',
  1785. 'skier':'\u26f7',
  1786. 'skull':'\ud83d\udc80',
  1787. 'skull_and_crossbones':'\u2620\ufe0f',
  1788. 'sleeping':'\ud83d\ude34',
  1789. 'sleeping_bed':'\ud83d\udecc',
  1790. 'sleepy':'\ud83d\ude2a',
  1791. 'slightly_frowning_face':'\ud83d\ude41',
  1792. 'slightly_smiling_face':'\ud83d\ude42',
  1793. 'slot_machine':'\ud83c\udfb0',
  1794. 'small_airplane':'\ud83d\udee9',
  1795. 'small_blue_diamond':'\ud83d\udd39',
  1796. 'small_orange_diamond':'\ud83d\udd38',
  1797. 'small_red_triangle':'\ud83d\udd3a',
  1798. 'small_red_triangle_down':'\ud83d\udd3b',
  1799. 'smile':'\ud83d\ude04',
  1800. 'smile_cat':'\ud83d\ude38',
  1801. 'smiley':'\ud83d\ude03',
  1802. 'smiley_cat':'\ud83d\ude3a',
  1803. 'smiling_imp':'\ud83d\ude08',
  1804. 'smirk':'\ud83d\ude0f',
  1805. 'smirk_cat':'\ud83d\ude3c',
  1806. 'smoking':'\ud83d\udeac',
  1807. 'snail':'\ud83d\udc0c',
  1808. 'snake':'\ud83d\udc0d',
  1809. 'sneezing_face':'\ud83e\udd27',
  1810. 'snowboarder':'\ud83c\udfc2',
  1811. 'snowflake':'\u2744\ufe0f',
  1812. 'snowman':'\u26c4\ufe0f',
  1813. 'snowman_with_snow':'\u2603\ufe0f',
  1814. 'sob':'\ud83d\ude2d',
  1815. 'soccer':'\u26bd\ufe0f',
  1816. 'soon':'\ud83d\udd1c',
  1817. 'sos':'\ud83c\udd98',
  1818. 'sound':'\ud83d\udd09',
  1819. 'space_invader':'\ud83d\udc7e',
  1820. 'spades':'\u2660\ufe0f',
  1821. 'spaghetti':'\ud83c\udf5d',
  1822. 'sparkle':'\u2747\ufe0f',
  1823. 'sparkler':'\ud83c\udf87',
  1824. 'sparkles':'\u2728',
  1825. 'sparkling_heart':'\ud83d\udc96',
  1826. 'speak_no_evil':'\ud83d\ude4a',
  1827. 'speaker':'\ud83d\udd08',
  1828. 'speaking_head':'\ud83d\udde3',
  1829. 'speech_balloon':'\ud83d\udcac',
  1830. 'speedboat':'\ud83d\udea4',
  1831. 'spider':'\ud83d\udd77',
  1832. 'spider_web':'\ud83d\udd78',
  1833. 'spiral_calendar':'\ud83d\uddd3',
  1834. 'spiral_notepad':'\ud83d\uddd2',
  1835. 'spoon':'\ud83e\udd44',
  1836. 'squid':'\ud83e\udd91',
  1837. 'stadium':'\ud83c\udfdf',
  1838. 'star':'\u2b50\ufe0f',
  1839. 'star2':'\ud83c\udf1f',
  1840. 'star_and_crescent':'\u262a\ufe0f',
  1841. 'star_of_david':'\u2721\ufe0f',
  1842. 'stars':'\ud83c\udf20',
  1843. 'station':'\ud83d\ude89',
  1844. 'statue_of_liberty':'\ud83d\uddfd',
  1845. 'steam_locomotive':'\ud83d\ude82',
  1846. 'stew':'\ud83c\udf72',
  1847. 'stop_button':'\u23f9',
  1848. 'stop_sign':'\ud83d\uded1',
  1849. 'stopwatch':'\u23f1',
  1850. 'straight_ruler':'\ud83d\udccf',
  1851. 'strawberry':'\ud83c\udf53',
  1852. 'stuck_out_tongue':'\ud83d\ude1b',
  1853. 'stuck_out_tongue_closed_eyes':'\ud83d\ude1d',
  1854. 'stuck_out_tongue_winking_eye':'\ud83d\ude1c',
  1855. 'studio_microphone':'\ud83c\udf99',
  1856. 'stuffed_flatbread':'\ud83e\udd59',
  1857. 'sun_behind_large_cloud':'\ud83c\udf25',
  1858. 'sun_behind_rain_cloud':'\ud83c\udf26',
  1859. 'sun_behind_small_cloud':'\ud83c\udf24',
  1860. 'sun_with_face':'\ud83c\udf1e',
  1861. 'sunflower':'\ud83c\udf3b',
  1862. 'sunglasses':'\ud83d\ude0e',
  1863. 'sunny':'\u2600\ufe0f',
  1864. 'sunrise':'\ud83c\udf05',
  1865. 'sunrise_over_mountains':'\ud83c\udf04',
  1866. 'surfing_man':'\ud83c\udfc4',
  1867. 'surfing_woman':'\ud83c\udfc4&zwj;\u2640\ufe0f',
  1868. 'sushi':'\ud83c\udf63',
  1869. 'suspension_railway':'\ud83d\ude9f',
  1870. 'sweat':'\ud83d\ude13',
  1871. 'sweat_drops':'\ud83d\udca6',
  1872. 'sweat_smile':'\ud83d\ude05',
  1873. 'sweet_potato':'\ud83c\udf60',
  1874. 'swimming_man':'\ud83c\udfca',
  1875. 'swimming_woman':'\ud83c\udfca&zwj;\u2640\ufe0f',
  1876. 'symbols':'\ud83d\udd23',
  1877. 'synagogue':'\ud83d\udd4d',
  1878. 'syringe':'\ud83d\udc89',
  1879. 'taco':'\ud83c\udf2e',
  1880. 'tada':'\ud83c\udf89',
  1881. 'tanabata_tree':'\ud83c\udf8b',
  1882. 'taurus':'\u2649\ufe0f',
  1883. 'taxi':'\ud83d\ude95',
  1884. 'tea':'\ud83c\udf75',
  1885. 'telephone_receiver':'\ud83d\udcde',
  1886. 'telescope':'\ud83d\udd2d',
  1887. 'tennis':'\ud83c\udfbe',
  1888. 'tent':'\u26fa\ufe0f',
  1889. 'thermometer':'\ud83c\udf21',
  1890. 'thinking':'\ud83e\udd14',
  1891. 'thought_balloon':'\ud83d\udcad',
  1892. 'ticket':'\ud83c\udfab',
  1893. 'tickets':'\ud83c\udf9f',
  1894. 'tiger':'\ud83d\udc2f',
  1895. 'tiger2':'\ud83d\udc05',
  1896. 'timer_clock':'\u23f2',
  1897. 'tipping_hand_man':'\ud83d\udc81&zwj;\u2642\ufe0f',
  1898. 'tired_face':'\ud83d\ude2b',
  1899. 'tm':'\u2122\ufe0f',
  1900. 'toilet':'\ud83d\udebd',
  1901. 'tokyo_tower':'\ud83d\uddfc',
  1902. 'tomato':'\ud83c\udf45',
  1903. 'tongue':'\ud83d\udc45',
  1904. 'top':'\ud83d\udd1d',
  1905. 'tophat':'\ud83c\udfa9',
  1906. 'tornado':'\ud83c\udf2a',
  1907. 'trackball':'\ud83d\uddb2',
  1908. 'tractor':'\ud83d\ude9c',
  1909. 'traffic_light':'\ud83d\udea5',
  1910. 'train':'\ud83d\ude8b',
  1911. 'train2':'\ud83d\ude86',
  1912. 'tram':'\ud83d\ude8a',
  1913. 'triangular_flag_on_post':'\ud83d\udea9',
  1914. 'triangular_ruler':'\ud83d\udcd0',
  1915. 'trident':'\ud83d\udd31',
  1916. 'triumph':'\ud83d\ude24',
  1917. 'trolleybus':'\ud83d\ude8e',
  1918. 'trophy':'\ud83c\udfc6',
  1919. 'tropical_drink':'\ud83c\udf79',
  1920. 'tropical_fish':'\ud83d\udc20',
  1921. 'truck':'\ud83d\ude9a',
  1922. 'trumpet':'\ud83c\udfba',
  1923. 'tulip':'\ud83c\udf37',
  1924. 'tumbler_glass':'\ud83e\udd43',
  1925. 'turkey':'\ud83e\udd83',
  1926. 'turtle':'\ud83d\udc22',
  1927. 'tv':'\ud83d\udcfa',
  1928. 'twisted_rightwards_arrows':'\ud83d\udd00',
  1929. 'two_hearts':'\ud83d\udc95',
  1930. 'two_men_holding_hands':'\ud83d\udc6c',
  1931. 'two_women_holding_hands':'\ud83d\udc6d',
  1932. 'u5272':'\ud83c\ude39',
  1933. 'u5408':'\ud83c\ude34',
  1934. 'u55b6':'\ud83c\ude3a',
  1935. 'u6307':'\ud83c\ude2f\ufe0f',
  1936. 'u6708':'\ud83c\ude37\ufe0f',
  1937. 'u6709':'\ud83c\ude36',
  1938. 'u6e80':'\ud83c\ude35',
  1939. 'u7121':'\ud83c\ude1a\ufe0f',
  1940. 'u7533':'\ud83c\ude38',
  1941. 'u7981':'\ud83c\ude32',
  1942. 'u7a7a':'\ud83c\ude33',
  1943. 'umbrella':'\u2614\ufe0f',
  1944. 'unamused':'\ud83d\ude12',
  1945. 'underage':'\ud83d\udd1e',
  1946. 'unicorn':'\ud83e\udd84',
  1947. 'unlock':'\ud83d\udd13',
  1948. 'up':'\ud83c\udd99',
  1949. 'upside_down_face':'\ud83d\ude43',
  1950. 'v':'\u270c\ufe0f',
  1951. 'vertical_traffic_light':'\ud83d\udea6',
  1952. 'vhs':'\ud83d\udcfc',
  1953. 'vibration_mode':'\ud83d\udcf3',
  1954. 'video_camera':'\ud83d\udcf9',
  1955. 'video_game':'\ud83c\udfae',
  1956. 'violin':'\ud83c\udfbb',
  1957. 'virgo':'\u264d\ufe0f',
  1958. 'volcano':'\ud83c\udf0b',
  1959. 'volleyball':'\ud83c\udfd0',
  1960. 'vs':'\ud83c\udd9a',
  1961. 'vulcan_salute':'\ud83d\udd96',
  1962. 'walking_man':'\ud83d\udeb6',
  1963. 'walking_woman':'\ud83d\udeb6&zwj;\u2640\ufe0f',
  1964. 'waning_crescent_moon':'\ud83c\udf18',
  1965. 'waning_gibbous_moon':'\ud83c\udf16',
  1966. 'warning':'\u26a0\ufe0f',
  1967. 'wastebasket':'\ud83d\uddd1',
  1968. 'watch':'\u231a\ufe0f',
  1969. 'water_buffalo':'\ud83d\udc03',
  1970. 'watermelon':'\ud83c\udf49',
  1971. 'wave':'\ud83d\udc4b',
  1972. 'wavy_dash':'\u3030\ufe0f',
  1973. 'waxing_crescent_moon':'\ud83c\udf12',
  1974. 'wc':'\ud83d\udebe',
  1975. 'weary':'\ud83d\ude29',
  1976. 'wedding':'\ud83d\udc92',
  1977. 'weight_lifting_man':'\ud83c\udfcb\ufe0f',
  1978. 'weight_lifting_woman':'\ud83c\udfcb\ufe0f&zwj;\u2640\ufe0f',
  1979. 'whale':'\ud83d\udc33',
  1980. 'whale2':'\ud83d\udc0b',
  1981. 'wheel_of_dharma':'\u2638\ufe0f',
  1982. 'wheelchair':'\u267f\ufe0f',
  1983. 'white_check_mark':'\u2705',
  1984. 'white_circle':'\u26aa\ufe0f',
  1985. 'white_flag':'\ud83c\udff3\ufe0f',
  1986. 'white_flower':'\ud83d\udcae',
  1987. 'white_large_square':'\u2b1c\ufe0f',
  1988. 'white_medium_small_square':'\u25fd\ufe0f',
  1989. 'white_medium_square':'\u25fb\ufe0f',
  1990. 'white_small_square':'\u25ab\ufe0f',
  1991. 'white_square_button':'\ud83d\udd33',
  1992. 'wilted_flower':'\ud83e\udd40',
  1993. 'wind_chime':'\ud83c\udf90',
  1994. 'wind_face':'\ud83c\udf2c',
  1995. 'wine_glass':'\ud83c\udf77',
  1996. 'wink':'\ud83d\ude09',
  1997. 'wolf':'\ud83d\udc3a',
  1998. 'woman':'\ud83d\udc69',
  1999. 'woman_artist':'\ud83d\udc69&zwj;\ud83c\udfa8',
  2000. 'woman_astronaut':'\ud83d\udc69&zwj;\ud83d\ude80',
  2001. 'woman_cartwheeling':'\ud83e\udd38&zwj;\u2640\ufe0f',
  2002. 'woman_cook':'\ud83d\udc69&zwj;\ud83c\udf73',
  2003. 'woman_facepalming':'\ud83e\udd26&zwj;\u2640\ufe0f',
  2004. 'woman_factory_worker':'\ud83d\udc69&zwj;\ud83c\udfed',
  2005. 'woman_farmer':'\ud83d\udc69&zwj;\ud83c\udf3e',
  2006. 'woman_firefighter':'\ud83d\udc69&zwj;\ud83d\ude92',
  2007. 'woman_health_worker':'\ud83d\udc69&zwj;\u2695\ufe0f',
  2008. 'woman_judge':'\ud83d\udc69&zwj;\u2696\ufe0f',
  2009. 'woman_juggling':'\ud83e\udd39&zwj;\u2640\ufe0f',
  2010. 'woman_mechanic':'\ud83d\udc69&zwj;\ud83d\udd27',
  2011. 'woman_office_worker':'\ud83d\udc69&zwj;\ud83d\udcbc',
  2012. 'woman_pilot':'\ud83d\udc69&zwj;\u2708\ufe0f',
  2013. 'woman_playing_handball':'\ud83e\udd3e&zwj;\u2640\ufe0f',
  2014. 'woman_playing_water_polo':'\ud83e\udd3d&zwj;\u2640\ufe0f',
  2015. 'woman_scientist':'\ud83d\udc69&zwj;\ud83d\udd2c',
  2016. 'woman_shrugging':'\ud83e\udd37&zwj;\u2640\ufe0f',
  2017. 'woman_singer':'\ud83d\udc69&zwj;\ud83c\udfa4',
  2018. 'woman_student':'\ud83d\udc69&zwj;\ud83c\udf93',
  2019. 'woman_teacher':'\ud83d\udc69&zwj;\ud83c\udfeb',
  2020. 'woman_technologist':'\ud83d\udc69&zwj;\ud83d\udcbb',
  2021. 'woman_with_turban':'\ud83d\udc73&zwj;\u2640\ufe0f',
  2022. 'womans_clothes':'\ud83d\udc5a',
  2023. 'womans_hat':'\ud83d\udc52',
  2024. 'women_wrestling':'\ud83e\udd3c&zwj;\u2640\ufe0f',
  2025. 'womens':'\ud83d\udeba',
  2026. 'world_map':'\ud83d\uddfa',
  2027. 'worried':'\ud83d\ude1f',
  2028. 'wrench':'\ud83d\udd27',
  2029. 'writing_hand':'\u270d\ufe0f',
  2030. 'x':'\u274c',
  2031. 'yellow_heart':'\ud83d\udc9b',
  2032. 'yen':'\ud83d\udcb4',
  2033. 'yin_yang':'\u262f\ufe0f',
  2034. 'yum':'\ud83d\ude0b',
  2035. 'zap':'\u26a1\ufe0f',
  2036. 'zipper_mouth_face':'\ud83e\udd10',
  2037. 'zzz':'\ud83d\udca4',
  2038. /* special emojis :P */
  2039. 'octocat': '<img width="20" height="20" align="absmiddle" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAOwUlEQVR42uVbCVyO6RbPmn0sw9gZS0aZO4y5GTEUE2ObxjZjrbHEJVy3sWS5pkaWxjLEkCVDSbSgFLdESaWSLIVUSIi4kvb9f895vi/zbbR+yZ339/tbnu99n/ec/3Oe85xznufV0CjDBaAdwZqwnzCJ0FXjHV70/i8J5oQDhCFV8cJdq1atwqxZs+Ds7Iz4+HhqwgXCLELNKlK6G2Ej4e6lS5ewZcsWzJgxA+fOnWNZFqvzxT1v3boF/qcsBg0ahP3796OwsJAFWKYuIqjfPoS9cXFxWL58Obp06SInh5aWFr//jjoJWLlu3TolAorRuXNn7Ny5k4W4Spgj81xrgj5hLmED4RDhlNRygglBhADCSakpWxFMCHoETUJTwrYHDx7A1NT0je9nPHz4kN/fXl0EeI0aNeqtAjB69+4NPz8/FsSdlXvy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/EoiuZvw6TTZHpyuNNmEaNGsndP3fu3OJAq1N1JOAHDmyKheVtNP4OkE2crULRAW7fvl20EyyLy24a8p+/7WISFixYIMLt4t82bNhQYjXqXREgPq3j74mlX3AmSL8E1eOPIBXnuVT5OsVZpuLnOMeOHeN7vifwiYhYzhC5IpwlOXj1QXWdBmy/XWU/X+UqMZfKBw4cKAobHPlJlZe9h6tOu+7cuSN2dg0MDMSSyZUpmXvaSD+crq/xvl0k9BTCRa7qEPq+5T4t6ffF52WVV+f1P6zyLG30bsU4AAAAAElFTkSuQmCC">',
  2040. 'showdown': '<img width="20" height="20" align="absmiddle" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPj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RGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+NjQ8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/Pse7bzcAAAAgY0hSTQAAeiUAAICD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WtgVvRKUSUFkSKt2S7fAGgAXLYpmQQXf36MUChTZdUa2u8/rkvPA6Tz30r4eH3ybcBS5gJ6SaNXb+aABkA1AMxKenclBZLW/He4cYEGwEXb3wEASelexk6LIIIAAAAASUVORK5CYII=">'
  2041. };
  2042. /**
  2043. * Created by Estevao on 31-05-2015.
  2044. */
  2045. /**
  2046. * Showdown Converter class
  2047. * @class
  2048. * @param {object} [converterOptions]
  2049. * @returns {Converter}
  2050. */
  2051. showdown.Converter = function (converterOptions) {
  2052. 'use strict';
  2053. var
  2054. /**
  2055. * Options used by this converter
  2056. * @private
  2057. * @type {{}}
  2058. */
  2059. options = {},
  2060. /**
  2061. * Language extensions used by this converter
  2062. * @private
  2063. * @type {Array}
  2064. */
  2065. langExtensions = [],
  2066. /**
  2067. * Output modifiers extensions used by this converter
  2068. * @private
  2069. * @type {Array}
  2070. */
  2071. outputModifiers = [],
  2072. /**
  2073. * Event listeners
  2074. * @private
  2075. * @type {{}}
  2076. */
  2077. listeners = {},
  2078. /**
  2079. * The flavor set in this converter
  2080. */
  2081. setConvFlavor = setFlavor;
  2082. _constructor();
  2083. /**
  2084. * Converter constructor
  2085. * @private
  2086. */
  2087. function _constructor () {
  2088. converterOptions = converterOptions || {};
  2089. for (var gOpt in globalOptions) {
  2090. if (globalOptions.hasOwnProperty(gOpt)) {
  2091. options[gOpt] = globalOptions[gOpt];
  2092. }
  2093. }
  2094. // Merge options
  2095. if (typeof converterOptions === 'object') {
  2096. for (var opt in converterOptions) {
  2097. if (converterOptions.hasOwnProperty(opt)) {
  2098. options[opt] = converterOptions[opt];
  2099. }
  2100. }
  2101. } else {
  2102. throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
  2103. ' was passed instead.');
  2104. }
  2105. if (options.extensions) {
  2106. showdown.helper.forEach(options.extensions, _parseExtension);
  2107. }
  2108. }
  2109. /**
  2110. * Parse extension
  2111. * @param {*} ext
  2112. * @param {string} [name='']
  2113. * @private
  2114. */
  2115. function _parseExtension (ext, name) {
  2116. name = name || null;
  2117. // If it's a string, the extension was previously loaded
  2118. if (showdown.helper.isString(ext)) {
  2119. ext = showdown.helper.stdExtName(ext);
  2120. name = ext;
  2121. // LEGACY_SUPPORT CODE
  2122. if (showdown.extensions[ext]) {
  2123. console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +
  2124. 'Please inform the developer that the extension should be updated!');
  2125. legacyExtensionLoading(showdown.extensions[ext], ext);
  2126. return;
  2127. // END LEGACY SUPPORT CODE
  2128. } else if (!showdown.helper.isUndefined(extensions[ext])) {
  2129. ext = extensions[ext];
  2130. } else {
  2131. throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
  2132. }
  2133. }
  2134. if (typeof ext === 'function') {
  2135. ext = ext();
  2136. }
  2137. if (!showdown.helper.isArray(ext)) {
  2138. ext = [ext];
  2139. }
  2140. var validExt = validate(ext, name);
  2141. if (!validExt.valid) {
  2142. throw Error(validExt.error);
  2143. }
  2144. for (var i = 0; i < ext.length; ++i) {
  2145. switch (ext[i].type) {
  2146. case 'lang':
  2147. langExtensions.push(ext[i]);
  2148. break;
  2149. case 'output':
  2150. outputModifiers.push(ext[i]);
  2151. break;
  2152. }
  2153. if (ext[i].hasOwnProperty('listeners')) {
  2154. for (var ln in ext[i].listeners) {
  2155. if (ext[i].listeners.hasOwnProperty(ln)) {
  2156. listen(ln, ext[i].listeners[ln]);
  2157. }
  2158. }
  2159. }
  2160. }
  2161. }
  2162. /**
  2163. * LEGACY_SUPPORT
  2164. * @param {*} ext
  2165. * @param {string} name
  2166. */
  2167. function legacyExtensionLoading (ext, name) {
  2168. if (typeof ext === 'function') {
  2169. ext = ext(new showdown.Converter());
  2170. }
  2171. if (!showdown.helper.isArray(ext)) {
  2172. ext = [ext];
  2173. }
  2174. var valid = validate(ext, name);
  2175. if (!valid.valid) {
  2176. throw Error(valid.error);
  2177. }
  2178. for (var i = 0; i < ext.length; ++i) {
  2179. switch (ext[i].type) {
  2180. case 'lang':
  2181. langExtensions.push(ext[i]);
  2182. break;
  2183. case 'output':
  2184. outputModifiers.push(ext[i]);
  2185. break;
  2186. default:// should never reach here
  2187. throw Error('Extension loader error: Type unrecognized!!!');
  2188. }
  2189. }
  2190. }
  2191. /**
  2192. * Listen to an event
  2193. * @param {string} name
  2194. * @param {function} callback
  2195. */
  2196. function listen (name, callback) {
  2197. if (!showdown.helper.isString(name)) {
  2198. throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
  2199. }
  2200. if (typeof callback !== 'function') {
  2201. throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
  2202. }
  2203. if (!listeners.hasOwnProperty(name)) {
  2204. listeners[name] = [];
  2205. }
  2206. listeners[name].push(callback);
  2207. }
  2208. function rTrimInputText (text) {
  2209. var rsp = text.match(/^\s*/)[0].length,
  2210. rgx = new RegExp('^\\s{0,' + rsp + '}', 'gm');
  2211. return text.replace(rgx, '');
  2212. }
  2213. /**
  2214. * Dispatch an event
  2215. * @private
  2216. * @param {string} evtName Event name
  2217. * @param {string} text Text
  2218. * @param {{}} options Converter Options
  2219. * @param {{}} globals
  2220. * @returns {string}
  2221. */
  2222. this._dispatch = function dispatch (evtName, text, options, globals) {
  2223. if (listeners.hasOwnProperty(evtName)) {
  2224. for (var ei = 0; ei < listeners[evtName].length; ++ei) {
  2225. var nText = listeners[evtName][ei](evtName, text, this, options, globals);
  2226. if (nText && typeof nText !== 'undefined') {
  2227. text = nText;
  2228. }
  2229. }
  2230. }
  2231. return text;
  2232. };
  2233. /**
  2234. * Listen to an event
  2235. * @param {string} name
  2236. * @param {function} callback
  2237. * @returns {showdown.Converter}
  2238. */
  2239. this.listen = function (name, callback) {
  2240. listen(name, callback);
  2241. return this;
  2242. };
  2243. /**
  2244. * Converts a markdown string into HTML
  2245. * @param {string} text
  2246. * @returns {*}
  2247. */
  2248. this.makeHtml = function (text) {
  2249. //check if text is not falsy
  2250. if (!text) {
  2251. return text;
  2252. }
  2253. var globals = {
  2254. gHtmlBlocks: [],
  2255. gHtmlMdBlocks: [],
  2256. gHtmlSpans: [],
  2257. gUrls: {},
  2258. gTitles: {},
  2259. gDimensions: {},
  2260. gListLevel: 0,
  2261. hashLinkCounts: {},
  2262. langExtensions: langExtensions,
  2263. outputModifiers: outputModifiers,
  2264. converter: this,
  2265. ghCodeBlocks: []
  2266. };
  2267. // This lets us use ¨ trema as an escape char to avoid md5 hashes
  2268. // The choice of character is arbitrary; anything that isn't
  2269. // magic in Markdown will work.
  2270. text = text.replace(/¨/g, '¨T');
  2271. // Replace $ with ¨D
  2272. // RegExp interprets $ as a special character
  2273. // when it's in a replacement string
  2274. text = text.replace(/\$/g, '¨D');
  2275. // Standardize line endings
  2276. text = text.replace(/\r\n/g, '\n'); // DOS to Unix
  2277. text = text.replace(/\r/g, '\n'); // Mac to Unix
  2278. // Stardardize line spaces (nbsp causes trouble in older browsers and some regex flavors)
  2279. text = text.replace(/\u00A0/g, ' ');
  2280. if (options.smartIndentationFix) {
  2281. text = rTrimInputText(text);
  2282. }
  2283. // Make sure text begins and ends with a couple of newlines:
  2284. text = '\n\n' + text + '\n\n';
  2285. // detab
  2286. text = showdown.subParser('detab')(text, options, globals);
  2287. /**
  2288. * Strip any lines consisting only of spaces and tabs.
  2289. * This makes subsequent regexs easier to write, because we can
  2290. * match consecutive blank lines with /\n+/ instead of something
  2291. * contorted like /[ \t]*\n+/
  2292. */
  2293. text = text.replace(/^[ \t]+$/mg, '');
  2294. //run languageExtensions
  2295. showdown.helper.forEach(langExtensions, function (ext) {
  2296. text = showdown.subParser('runExtension')(ext, text, options, globals);
  2297. });
  2298. // run the sub parsers
  2299. text = showdown.subParser('hashPreCodeTags')(text, options, globals);
  2300. text = showdown.subParser('githubCodeBlocks')(text, options, globals);
  2301. text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
  2302. text = showdown.subParser('hashCodeTags')(text, options, globals);
  2303. text = showdown.subParser('stripLinkDefinitions')(text, options, globals);
  2304. text = showdown.subParser('blockGamut')(text, options, globals);
  2305. text = showdown.subParser('unhashHTMLSpans')(text, options, globals);
  2306. text = showdown.subParser('unescapeSpecialChars')(text, options, globals);
  2307. // attacklab: Restore dollar signs
  2308. text = text.replace(/¨D/g, '$$');
  2309. // attacklab: Restore tremas
  2310. text = text.replace(/¨T/g, '¨');
  2311. // Run output modifiers
  2312. showdown.helper.forEach(outputModifiers, function (ext) {
  2313. text = showdown.subParser('runExtension')(ext, text, options, globals);
  2314. });
  2315. return text;
  2316. };
  2317. /**
  2318. * Set an option of this Converter instance
  2319. * @param {string} key
  2320. * @param {*} value
  2321. */
  2322. this.setOption = function (key, value) {
  2323. options[key] = value;
  2324. };
  2325. /**
  2326. * Get the option of this Converter instance
  2327. * @param {string} key
  2328. * @returns {*}
  2329. */
  2330. this.getOption = function (key) {
  2331. return options[key];
  2332. };
  2333. /**
  2334. * Get the options of this Converter instance
  2335. * @returns {{}}
  2336. */
  2337. this.getOptions = function () {
  2338. return options;
  2339. };
  2340. /**
  2341. * Add extension to THIS converter
  2342. * @param {{}} extension
  2343. * @param {string} [name=null]
  2344. */
  2345. this.addExtension = function (extension, name) {
  2346. name = name || null;
  2347. _parseExtension(extension, name);
  2348. };
  2349. /**
  2350. * Use a global registered extension with THIS converter
  2351. * @param {string} extensionName Name of the previously registered extension
  2352. */
  2353. this.useExtension = function (extensionName) {
  2354. _parseExtension(extensionName);
  2355. };
  2356. /**
  2357. * Set the flavor THIS converter should use
  2358. * @param {string} name
  2359. */
  2360. this.setFlavor = function (name) {
  2361. if (!flavor.hasOwnProperty(name)) {
  2362. throw Error(name + ' flavor was not found');
  2363. }
  2364. var preset = flavor[name];
  2365. setConvFlavor = name;
  2366. for (var option in preset) {
  2367. if (preset.hasOwnProperty(option)) {
  2368. options[option] = preset[option];
  2369. }
  2370. }
  2371. };
  2372. /**
  2373. * Get the currently set flavor of this converter
  2374. * @returns {string}
  2375. */
  2376. this.getFlavor = function () {
  2377. return setConvFlavor;
  2378. };
  2379. /**
  2380. * Remove an extension from THIS converter.
  2381. * Note: This is a costly operation. It's better to initialize a new converter
  2382. * and specify the extensions you wish to use
  2383. * @param {Array} extension
  2384. */
  2385. this.removeExtension = function (extension) {
  2386. if (!showdown.helper.isArray(extension)) {
  2387. extension = [extension];
  2388. }
  2389. for (var a = 0; a < extension.length; ++a) {
  2390. var ext = extension[a];
  2391. for (var i = 0; i < langExtensions.length; ++i) {
  2392. if (langExtensions[i] === ext) {
  2393. langExtensions[i].splice(i, 1);
  2394. }
  2395. }
  2396. for (var ii = 0; ii < outputModifiers.length; ++i) {
  2397. if (outputModifiers[ii] === ext) {
  2398. outputModifiers[ii].splice(i, 1);
  2399. }
  2400. }
  2401. }
  2402. };
  2403. /**
  2404. * Get all extension of THIS converter
  2405. * @returns {{language: Array, output: Array}}
  2406. */
  2407. this.getAllExtensions = function () {
  2408. return {
  2409. language: langExtensions,
  2410. output: outputModifiers
  2411. };
  2412. };
  2413. };
  2414. /**
  2415. * Turn Markdown link shortcuts into XHTML <a> tags.
  2416. */
  2417. showdown.subParser('anchors', function (text, options, globals) {
  2418. 'use strict';
  2419. text = globals.converter._dispatch('anchors.before', text, options, globals);
  2420. var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) {
  2421. if (showdown.helper.isUndefined(title)) {
  2422. title = '';
  2423. }
  2424. linkId = linkId.toLowerCase();
  2425. // Special case for explicit empty url
  2426. if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
  2427. url = '';
  2428. } else if (!url) {
  2429. if (!linkId) {
  2430. // lower-case and turn embedded newlines into spaces
  2431. linkId = linkText.toLowerCase().replace(/ ?\n/g, ' ');
  2432. }
  2433. url = '#' + linkId;
  2434. if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {
  2435. url = globals.gUrls[linkId];
  2436. if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {
  2437. title = globals.gTitles[linkId];
  2438. }
  2439. } else {
  2440. return wholeMatch;
  2441. }
  2442. }
  2443. //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance
  2444. url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
  2445. var result = '<a href="' + url + '"';
  2446. if (title !== '' && title !== null) {
  2447. title = title.replace(/"/g, '&quot;');
  2448. //title = showdown.helper.escapeCharacters(title, '*_', false); // replaced line to improve performance
  2449. title = title.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
  2450. result += ' title="' + title + '"';
  2451. }
  2452. if (options.openLinksInNewWindow) {
  2453. // escaped _
  2454. result += ' target="¨E95Eblank"';
  2455. }
  2456. result += '>' + linkText + '</a>';
  2457. return result;
  2458. };
  2459. // First, handle reference-style links: [link text] [id]
  2460. text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag);
  2461. // Next, inline-style links: [link text](url "optional title")
  2462. // cases with crazy urls like ./image/cat1).png
  2463. text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
  2464. writeAnchorTag);
  2465. // normal cases
  2466. text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
  2467. writeAnchorTag);
  2468. // handle reference-style shortcuts: [link text]
  2469. // These must come last in case you've also got [link test][1]
  2470. // or [link test](/foo)
  2471. text = text.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag);
  2472. // Lastly handle GithubMentions if option is enabled
  2473. if (options.ghMentions) {
  2474. text = text.replace(/(^|\s)(\\)?(@([a-z\d\-]+))(?=[.!?;,[\]()]|\s|$)/gmi, function (wm, st, escape, mentions, username) {
  2475. if (escape === '\\') {
  2476. return st + mentions;
  2477. }
  2478. //check if options.ghMentionsLink is a string
  2479. if (!showdown.helper.isString(options.ghMentionsLink)) {
  2480. throw new Error('ghMentionsLink option must be a string');
  2481. }
  2482. var lnk = options.ghMentionsLink.replace(/\{u}/g, username),
  2483. target = '';
  2484. if (options.openLinksInNewWindow) {
  2485. target = ' target="¨E95Eblank"';
  2486. }
  2487. return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>';
  2488. });
  2489. }
  2490. text = globals.converter._dispatch('anchors.after', text, options, globals);
  2491. return text;
  2492. });
  2493. // url allowed chars [a-z\d_.~:/?#[]@!$&'()*+,;=-]
  2494. var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
  2495. simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
  2496. delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
  2497. simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,
  2498. delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
  2499. replaceLink = function (options) {
  2500. 'use strict';
  2501. return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {
  2502. link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
  2503. var lnkTxt = link,
  2504. append = '',
  2505. target = '',
  2506. lmc = leadingMagicChars || '',
  2507. tmc = trailingMagicChars || '';
  2508. if (/^www\./i.test(link)) {
  2509. link = link.replace(/^www\./i, 'http://www.');
  2510. }
  2511. if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {
  2512. append = trailingPunctuation;
  2513. }
  2514. if (options.openLinksInNewWindow) {
  2515. target = ' target="¨E95Eblank"';
  2516. }
  2517. return lmc + '<a href="' + link + '"' + target + '>' + lnkTxt + '</a>' + append + tmc;
  2518. };
  2519. },
  2520. replaceMail = function (options, globals) {
  2521. 'use strict';
  2522. return function (wholeMatch, b, mail) {
  2523. var href = 'mailto:';
  2524. b = b || '';
  2525. mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals);
  2526. if (options.encodeEmails) {
  2527. href = showdown.helper.encodeEmailAddress(href + mail);
  2528. mail = showdown.helper.encodeEmailAddress(mail);
  2529. } else {
  2530. href = href + mail;
  2531. }
  2532. return b + '<a href="' + href + '">' + mail + '</a>';
  2533. };
  2534. };
  2535. showdown.subParser('autoLinks', function (text, options, globals) {
  2536. 'use strict';
  2537. text = globals.converter._dispatch('autoLinks.before', text, options, globals);
  2538. text = text.replace(delimUrlRegex, replaceLink(options));
  2539. text = text.replace(delimMailRegex, replaceMail(options, globals));
  2540. text = globals.converter._dispatch('autoLinks.after', text, options, globals);
  2541. return text;
  2542. });
  2543. showdown.subParser('simplifiedAutoLinks', function (text, options, globals) {
  2544. 'use strict';
  2545. if (!options.simplifiedAutoLink) {
  2546. return text;
  2547. }
  2548. text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals);
  2549. if (options.excludeTrailingPunctuationFromURLs) {
  2550. text = text.replace(simpleURLRegex2, replaceLink(options));
  2551. } else {
  2552. text = text.replace(simpleURLRegex, replaceLink(options));
  2553. }
  2554. text = text.replace(simpleMailRegex, replaceMail(options, globals));
  2555. text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals);
  2556. return text;
  2557. });
  2558. /**
  2559. * These are all the transformations that form block-level
  2560. * tags like paragraphs, headers, and list items.
  2561. */
  2562. showdown.subParser('blockGamut', function (text, options, globals) {
  2563. 'use strict';
  2564. text = globals.converter._dispatch('blockGamut.before', text, options, globals);
  2565. // we parse blockquotes first so that we can have headings and hrs
  2566. // inside blockquotes
  2567. text = showdown.subParser('blockQuotes')(text, options, globals);
  2568. text = showdown.subParser('headers')(text, options, globals);
  2569. // Do Horizontal Rules:
  2570. text = showdown.subParser('horizontalRule')(text, options, globals);
  2571. text = showdown.subParser('lists')(text, options, globals);
  2572. text = showdown.subParser('codeBlocks')(text, options, globals);
  2573. text = showdown.subParser('tables')(text, options, globals);
  2574. // We already ran _HashHTMLBlocks() before, in Markdown(), but that
  2575. // was to escape raw HTML in the original Markdown source. This time,
  2576. // we're escaping the markup we've just created, so that we don't wrap
  2577. // <p> tags around block-level tags.
  2578. text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
  2579. text = showdown.subParser('paragraphs')(text, options, globals);
  2580. text = globals.converter._dispatch('blockGamut.after', text, options, globals);
  2581. return text;
  2582. });
  2583. showdown.subParser('blockQuotes', function (text, options, globals) {
  2584. 'use strict';
  2585. text = globals.converter._dispatch('blockQuotes.before', text, options, globals);
  2586. text = text.replace(/((^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm, function (wholeMatch, m1) {
  2587. var bq = m1;
  2588. // attacklab: hack around Konqueror 3.5.4 bug:
  2589. // "----------bug".replace(/^-/g,"") == "bug"
  2590. bq = bq.replace(/^[ \t]*>[ \t]?/gm, '¨0'); // trim one level of quoting
  2591. // attacklab: clean up hack
  2592. bq = bq.replace(/¨0/g, '');
  2593. bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
  2594. bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);
  2595. bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse
  2596. bq = bq.replace(/(^|\n)/g, '$1 ');
  2597. // These leading spaces screw with <pre> content, so we need to fix that:
  2598. bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
  2599. var pre = m1;
  2600. // attacklab: hack around Konqueror 3.5.4 bug:
  2601. pre = pre.replace(/^ /mg, '¨0');
  2602. pre = pre.replace(/¨0/g, '');
  2603. return pre;
  2604. });
  2605. return showdown.subParser('hashBlock')('<blockquote>\n' + bq + '\n</blockquote>', options, globals);
  2606. });
  2607. text = globals.converter._dispatch('blockQuotes.after', text, options, globals);
  2608. return text;
  2609. });
  2610. /**
  2611. * Process Markdown `<pre><code>` blocks.
  2612. */
  2613. showdown.subParser('codeBlocks', function (text, options, globals) {
  2614. 'use strict';
  2615. text = globals.converter._dispatch('codeBlocks.before', text, options, globals);
  2616. // sentinel workarounds for lack of \A and \Z, safari\khtml bug
  2617. text += '¨0';
  2618. var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
  2619. text = text.replace(pattern, function (wholeMatch, m1, m2) {
  2620. var codeblock = m1,
  2621. nextChar = m2,
  2622. end = '\n';
  2623. codeblock = showdown.subParser('outdent')(codeblock, options, globals);
  2624. codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
  2625. codeblock = showdown.subParser('detab')(codeblock, options, globals);
  2626. codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
  2627. codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
  2628. if (options.omitExtraWLInCodeBlocks) {
  2629. end = '';
  2630. }
  2631. codeblock = '<pre><code>' + codeblock + end + '</code></pre>';
  2632. return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;
  2633. });
  2634. // strip sentinel
  2635. text = text.replace(/¨0/, '');
  2636. text = globals.converter._dispatch('codeBlocks.after', text, options, globals);
  2637. return text;
  2638. });
  2639. /**
  2640. *
  2641. * * Backtick quotes are used for <code></code> spans.
  2642. *
  2643. * * You can use multiple backticks as the delimiters if you want to
  2644. * include literal backticks in the code span. So, this input:
  2645. *
  2646. * Just type ``foo `bar` baz`` at the prompt.
  2647. *
  2648. * Will translate to:
  2649. *
  2650. * <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
  2651. *
  2652. * There's no arbitrary limit to the number of backticks you
  2653. * can use as delimters. If you need three consecutive backticks
  2654. * in your code, use four for delimiters, etc.
  2655. *
  2656. * * You can use spaces to get literal backticks at the edges:
  2657. *
  2658. * ... type `` `bar` `` ...
  2659. *
  2660. * Turns to:
  2661. *
  2662. * ... type <code>`bar`</code> ...
  2663. */
  2664. showdown.subParser('codeSpans', function (text, options, globals) {
  2665. 'use strict';
  2666. text = globals.converter._dispatch('codeSpans.before', text, options, globals);
  2667. if (typeof(text) === 'undefined') {
  2668. text = '';
  2669. }
  2670. text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
  2671. function (wholeMatch, m1, m2, m3) {
  2672. var c = m3;
  2673. c = c.replace(/^([ \t]*)/g, ''); // leading whitespace
  2674. c = c.replace(/[ \t]*$/g, ''); // trailing whitespace
  2675. c = showdown.subParser('encodeCode')(c, options, globals);
  2676. return m1 + '<code>' + c + '</code>';
  2677. }
  2678. );
  2679. text = globals.converter._dispatch('codeSpans.after', text, options, globals);
  2680. return text;
  2681. });
  2682. /**
  2683. * Convert all tabs to spaces
  2684. */
  2685. showdown.subParser('detab', function (text, options, globals) {
  2686. 'use strict';
  2687. text = globals.converter._dispatch('detab.before', text, options, globals);
  2688. // expand first n-1 tabs
  2689. text = text.replace(/\t(?=\t)/g, ' '); // g_tab_width
  2690. // replace the nth with two sentinels
  2691. text = text.replace(/\t/g, '¨A¨B');
  2692. // use the sentinel to anchor our regex so it doesn't explode
  2693. text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) {
  2694. var leadingText = m1,
  2695. numSpaces = 4 - leadingText.length % 4; // g_tab_width
  2696. // there *must* be a better way to do this:
  2697. for (var i = 0; i < numSpaces; i++) {
  2698. leadingText += ' ';
  2699. }
  2700. return leadingText;
  2701. });
  2702. // clean up sentinels
  2703. text = text.replace(/¨A/g, ' '); // g_tab_width
  2704. text = text.replace(/¨B/g, '');
  2705. text = globals.converter._dispatch('detab.after', text, options, globals);
  2706. return text;
  2707. });
  2708. /**
  2709. * These are all the transformations that occur *within* block-level
  2710. * tags like paragraphs, headers, and list items.
  2711. */
  2712. showdown.subParser('emoji', function (text, options, globals) {
  2713. 'use strict';
  2714. if (!options.emoji) {
  2715. return text;
  2716. }
  2717. text = globals.converter._dispatch('emoji.before', text, options, globals);
  2718. var emojiRgx = /:([\S]+?):/g;
  2719. text = text.replace(emojiRgx, function (wm, emojiCode) {
  2720. if (showdown.helper.emojis.hasOwnProperty(emojiCode)) {
  2721. return showdown.helper.emojis[emojiCode];
  2722. }
  2723. return wm;
  2724. });
  2725. text = globals.converter._dispatch('emoji.after', text, options, globals);
  2726. return text;
  2727. });
  2728. /**
  2729. * Smart processing for ampersands and angle brackets that need to be encoded.
  2730. */
  2731. showdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {
  2732. 'use strict';
  2733. text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals);
  2734. // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
  2735. // http://bumppo.net/projects/amputator/
  2736. text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&amp;');
  2737. // Encode naked <'s
  2738. text = text.replace(/<(?![a-z\/?$!])/gi, '&lt;');
  2739. // Encode <
  2740. text = text.replace(/</g, '&lt;');
  2741. // Encode >
  2742. text = text.replace(/>/g, '&gt;');
  2743. text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);
  2744. return text;
  2745. });
  2746. /**
  2747. * Returns the string, with after processing the following backslash escape sequences.
  2748. *
  2749. * attacklab: The polite way to do this is with the new escapeCharacters() function:
  2750. *
  2751. * text = escapeCharacters(text,"\\",true);
  2752. * text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
  2753. *
  2754. * ...but we're sidestepping its use of the (slow) RegExp constructor
  2755. * as an optimization for Firefox. This function gets called a LOT.
  2756. */
  2757. showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
  2758. 'use strict';
  2759. text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
  2760. text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
  2761. text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback);
  2762. text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
  2763. return text;
  2764. });
  2765. /**
  2766. * Encode/escape certain characters inside Markdown code runs.
  2767. * The point is that in code, these characters are literals,
  2768. * and lose their special Markdown meanings.
  2769. */
  2770. showdown.subParser('encodeCode', function (text, options, globals) {
  2771. 'use strict';
  2772. text = globals.converter._dispatch('encodeCode.before', text, options, globals);
  2773. // Encode all ampersands; HTML entities are not
  2774. // entities within a Markdown code span.
  2775. text = text
  2776. .replace(/&/g, '&amp;')
  2777. // Do the angle bracket song and dance:
  2778. .replace(/</g, '&lt;')
  2779. .replace(/>/g, '&gt;')
  2780. // Now, escape characters that are magic in Markdown:
  2781. .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
  2782. text = globals.converter._dispatch('encodeCode.after', text, options, globals);
  2783. return text;
  2784. });
  2785. /**
  2786. * Within tags -- meaning between < and > -- encode [\ ` * _ ~ =] so they
  2787. * don't conflict with their use in Markdown for code, italics and strong.
  2788. */
  2789. showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {
  2790. 'use strict';
  2791. text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals);
  2792. // Build a regex to find HTML tags.
  2793. var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,
  2794. comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
  2795. text = text.replace(tags, function (wholeMatch) {
  2796. return wholeMatch
  2797. .replace(/(.)<\/?code>(?=.)/g, '$1`')
  2798. .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
  2799. });
  2800. text = text.replace(comments, function (wholeMatch) {
  2801. return wholeMatch
  2802. .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
  2803. });
  2804. text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);
  2805. return text;
  2806. });
  2807. /**
  2808. * Handle github codeblocks prior to running HashHTML so that
  2809. * HTML contained within the codeblock gets escaped properly
  2810. * Example:
  2811. * ```ruby
  2812. * def hello_world(x)
  2813. * puts "Hello, #{x}"
  2814. * end
  2815. * ```
  2816. */
  2817. showdown.subParser('githubCodeBlocks', function (text, options, globals) {
  2818. 'use strict';
  2819. // early exit if option is not enabled
  2820. if (!options.ghCodeBlocks) {
  2821. return text;
  2822. }
  2823. text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);
  2824. text += '¨0';
  2825. text = text.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g, function (wholeMatch, language, codeblock) {
  2826. var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n';
  2827. // First parse the github code block
  2828. codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
  2829. codeblock = showdown.subParser('detab')(codeblock, options, globals);
  2830. codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
  2831. codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace
  2832. codeblock = '<pre><code' + (language ? ' class="' + language + ' language-' + language + '"' : '') + '>' + codeblock + end + '</code></pre>';
  2833. codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);
  2834. // Since GHCodeblocks can be false positives, we need to
  2835. // store the primitive text and the parsed text in a global var,
  2836. // and then return a token
  2837. return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
  2838. });
  2839. // attacklab: strip sentinel
  2840. text = text.replace(/¨0/, '');
  2841. return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);
  2842. });
  2843. showdown.subParser('hashBlock', function (text, options, globals) {
  2844. 'use strict';
  2845. text = globals.converter._dispatch('hashBlock.before', text, options, globals);
  2846. text = text.replace(/(^\n+|\n+$)/g, '');
  2847. text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
  2848. text = globals.converter._dispatch('hashBlock.after', text, options, globals);
  2849. return text;
  2850. });
  2851. /**
  2852. * Hash and escape <code> elements that should not be parsed as markdown
  2853. */
  2854. showdown.subParser('hashCodeTags', function (text, options, globals) {
  2855. 'use strict';
  2856. text = globals.converter._dispatch('hashCodeTags.before', text, options, globals);
  2857. var repFunc = function (wholeMatch, match, left, right) {
  2858. var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
  2859. return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
  2860. };
  2861. // Hash naked <code>
  2862. text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '<code\\b[^>]*>', '</code>', 'gim');
  2863. text = globals.converter._dispatch('hashCodeTags.after', text, options, globals);
  2864. return text;
  2865. });
  2866. showdown.subParser('hashElement', function (text, options, globals) {
  2867. 'use strict';
  2868. return function (wholeMatch, m1) {
  2869. var blockText = m1;
  2870. // Undo double lines
  2871. blockText = blockText.replace(/\n\n/g, '\n');
  2872. blockText = blockText.replace(/^\n/, '');
  2873. // strip trailing blank lines
  2874. blockText = blockText.replace(/\n+$/g, '');
  2875. // Replace the element text with a marker ("¨KxK" where x is its key)
  2876. blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
  2877. return blockText;
  2878. };
  2879. });
  2880. showdown.subParser('hashHTMLBlocks', function (text, options, globals) {
  2881. 'use strict';
  2882. text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals);
  2883. var blockTags = [
  2884. 'pre',
  2885. 'div',
  2886. 'h1',
  2887. 'h2',
  2888. 'h3',
  2889. 'h4',
  2890. 'h5',
  2891. 'h6',
  2892. 'blockquote',
  2893. 'table',
  2894. 'dl',
  2895. 'ol',
  2896. 'ul',
  2897. 'script',
  2898. 'noscript',
  2899. 'form',
  2900. 'fieldset',
  2901. 'iframe',
  2902. 'math',
  2903. 'style',
  2904. 'section',
  2905. 'header',
  2906. 'footer',
  2907. 'nav',
  2908. 'article',
  2909. 'aside',
  2910. 'address',
  2911. 'audio',
  2912. 'canvas',
  2913. 'figure',
  2914. 'hgroup',
  2915. 'output',
  2916. 'video',
  2917. 'p'
  2918. ],
  2919. repFunc = function (wholeMatch, match, left, right) {
  2920. var txt = wholeMatch;
  2921. // check if this html element is marked as markdown
  2922. // if so, it's contents should be parsed as markdown
  2923. if (left.search(/\bmarkdown\b/) !== -1) {
  2924. txt = left + globals.converter.makeHtml(match) + right;
  2925. }
  2926. return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
  2927. };
  2928. if (options.backslashEscapesHTMLTags) {
  2929. // encode backslash escaped HTML tags
  2930. text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) {
  2931. return '&lt;' + inside + '&gt;';
  2932. });
  2933. }
  2934. // hash HTML Blocks
  2935. for (var i = 0; i < blockTags.length; ++i) {
  2936. var opTagPos,
  2937. rgx1 = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'),
  2938. patLeft = '<' + blockTags[i] + '\\b[^>]*>',
  2939. patRight = '</' + blockTags[i] + '>';
  2940. // 1. Look for the first position of the first opening HTML tag in the text
  2941. while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {
  2942. // if the HTML tag is \ escaped, we need to escape it and break
  2943. //2. Split the text in that position
  2944. var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
  2945. //3. Match recursively
  2946. newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
  2947. // prevent an infinite loop
  2948. if (newSubText1 === subTexts[1]) {
  2949. break;
  2950. }
  2951. text = subTexts[0].concat(newSubText1);
  2952. }
  2953. }
  2954. // HR SPECIAL CASE
  2955. text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
  2956. showdown.subParser('hashElement')(text, options, globals));
  2957. // Special case for standalone HTML comments
  2958. text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {
  2959. return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
  2960. }, '^ {0,3}<!--', '-->', 'gm');
  2961. // PHP and ASP-style processor instructions (<?...?> and <%...%>)
  2962. text = text.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
  2963. showdown.subParser('hashElement')(text, options, globals));
  2964. text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals);
  2965. return text;
  2966. });
  2967. /**
  2968. * Hash span elements that should not be parsed as markdown
  2969. */
  2970. showdown.subParser('hashHTMLSpans', function (text, options, globals) {
  2971. 'use strict';
  2972. text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals);
  2973. function hashHTMLSpan (html) {
  2974. return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C';
  2975. }
  2976. // Hash Self Closing tags
  2977. text = text.replace(/<[^>]+?\/>/gi, function (wm) {
  2978. return hashHTMLSpan(wm);
  2979. });
  2980. // Hash tags without properties
  2981. text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) {
  2982. return hashHTMLSpan(wm);
  2983. });
  2984. // Hash tags with properties
  2985. text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) {
  2986. return hashHTMLSpan(wm);
  2987. });
  2988. // Hash self closing tags without />
  2989. text = text.replace(/<[^>]+?>/gi, function (wm) {
  2990. return hashHTMLSpan(wm);
  2991. });
  2992. /*showdown.helper.matchRecursiveRegExp(text, '<code\\b[^>]*>', '</code>', 'gi');*/
  2993. text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals);
  2994. return text;
  2995. });
  2996. /**
  2997. * Unhash HTML spans
  2998. */
  2999. showdown.subParser('unhashHTMLSpans', function (text, options, globals) {
  3000. 'use strict';
  3001. text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals);
  3002. for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
  3003. var repText = globals.gHtmlSpans[i],
  3004. // limiter to prevent infinite loop (assume 10 as limit for recurse)
  3005. limit = 0;
  3006. while (/¨C(\d+)C/.test(repText)) {
  3007. var num = RegExp.$1;
  3008. repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);
  3009. if (limit === 10) {
  3010. break;
  3011. }
  3012. ++limit;
  3013. }
  3014. text = text.replace('¨C' + i + 'C', repText);
  3015. }
  3016. text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals);
  3017. return text;
  3018. });
  3019. /**
  3020. * Hash and escape <pre><code> elements that should not be parsed as markdown
  3021. */
  3022. showdown.subParser('hashPreCodeTags', function (text, options, globals) {
  3023. 'use strict';
  3024. text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals);
  3025. var repFunc = function (wholeMatch, match, left, right) {
  3026. // encode html entities
  3027. var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
  3028. return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
  3029. };
  3030. // Hash <pre><code>
  3031. text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>', '^ {0,3}</code>\\s*</pre>', 'gim');
  3032. text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals);
  3033. return text;
  3034. });
  3035. showdown.subParser('headers', function (text, options, globals) {
  3036. 'use strict';
  3037. text = globals.converter._dispatch('headers.before', text, options, globals);
  3038. var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
  3039. // Set text-style headers:
  3040. // Header 1
  3041. // ========
  3042. //
  3043. // Header 2
  3044. // --------
  3045. //
  3046. setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
  3047. setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
  3048. text = text.replace(setextRegexH1, function (wholeMatch, m1) {
  3049. var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
  3050. hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
  3051. hLevel = headerLevelStart,
  3052. hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
  3053. return showdown.subParser('hashBlock')(hashBlock, options, globals);
  3054. });
  3055. text = text.replace(setextRegexH2, function (matchFound, m1) {
  3056. var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
  3057. hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
  3058. hLevel = headerLevelStart + 1,
  3059. hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
  3060. return showdown.subParser('hashBlock')(hashBlock, options, globals);
  3061. });
  3062. // atx-style headers:
  3063. // # Header 1
  3064. // ## Header 2
  3065. // ## Header 2 with closing hashes ##
  3066. // ...
  3067. // ###### Header 6
  3068. //
  3069. var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
  3070. text = text.replace(atxStyle, function (wholeMatch, m1, m2) {
  3071. var hText = m2;
  3072. if (options.customizedHeaderId) {
  3073. hText = m2.replace(/\s?\{([^{]+?)}\s*$/, '');
  3074. }
  3075. var span = showdown.subParser('spanGamut')(hText, options, globals),
  3076. hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
  3077. hLevel = headerLevelStart - 1 + m1.length,
  3078. header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';
  3079. return showdown.subParser('hashBlock')(header, options, globals);
  3080. });
  3081. function headerId (m) {
  3082. var title,
  3083. prefix;
  3084. // It is separate from other options to allow combining prefix and customized
  3085. if (options.customizedHeaderId) {
  3086. var match = m.match(/\{([^{]+?)}\s*$/);
  3087. if (match && match[1]) {
  3088. m = match[1];
  3089. }
  3090. }
  3091. title = m;
  3092. // Prefix id to prevent causing inadvertent pre-existing style matches.
  3093. if (showdown.helper.isString(options.prefixHeaderId)) {
  3094. prefix = options.prefixHeaderId;
  3095. } else if (options.prefixHeaderId === true) {
  3096. prefix = 'section-';
  3097. } else {
  3098. prefix = '';
  3099. }
  3100. if (!options.rawPrefixHeaderId) {
  3101. title = prefix + title;
  3102. }
  3103. if (options.ghCompatibleHeaderId) {
  3104. title = title
  3105. .replace(/ /g, '-')
  3106. // replace previously escaped chars (&, ¨ and $)
  3107. .replace(/&amp;/g, '')
  3108. .replace(/¨T/g, '')
  3109. .replace(/¨D/g, '')
  3110. // replace rest of the chars (&~$ are repeated as they might have been escaped)
  3111. // borrowed from github's redcarpet (some they should produce similar results)
  3112. .replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '')
  3113. .toLowerCase();
  3114. } else if (options.rawHeaderId) {
  3115. title = title
  3116. .replace(/ /g, '-')
  3117. // replace previously escaped chars (&, ¨ and $)
  3118. .replace(/&amp;/g, '&')
  3119. .replace(/¨T/g, '¨')
  3120. .replace(/¨D/g, '$')
  3121. // replace " and '
  3122. .replace(/["']/g, '-')
  3123. .toLowerCase();
  3124. } else {
  3125. title = title
  3126. .replace(/[^\w]/g, '')
  3127. .toLowerCase();
  3128. }
  3129. if (options.rawPrefixHeaderId) {
  3130. title = prefix + title;
  3131. }
  3132. if (globals.hashLinkCounts[title]) {
  3133. title = title + '-' + (globals.hashLinkCounts[title]++);
  3134. } else {
  3135. globals.hashLinkCounts[title] = 1;
  3136. }
  3137. return title;
  3138. }
  3139. text = globals.converter._dispatch('headers.after', text, options, globals);
  3140. return text;
  3141. });
  3142. /**
  3143. * Turn Markdown link shortcuts into XHTML <a> tags.
  3144. */
  3145. showdown.subParser('horizontalRule', function (text, options, globals) {
  3146. 'use strict';
  3147. text = globals.converter._dispatch('horizontalRule.before', text, options, globals);
  3148. var key = showdown.subParser('hashBlock')('<hr />', options, globals);
  3149. text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
  3150. text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
  3151. text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
  3152. text = globals.converter._dispatch('horizontalRule.after', text, options, globals);
  3153. return text;
  3154. });
  3155. /**
  3156. * Turn Markdown image shortcuts into <img> tags.
  3157. */
  3158. showdown.subParser('images', function (text, options, globals) {
  3159. 'use strict';
  3160. text = globals.converter._dispatch('images.before', text, options, globals);
  3161. var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
  3162. crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
  3163. base64RegExp = /!\[([^\]]*?)][ \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,
  3164. referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
  3165. refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
  3166. function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
  3167. url = url.replace(/\s/g, '');
  3168. return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
  3169. }
  3170. function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
  3171. var gUrls = globals.gUrls,
  3172. gTitles = globals.gTitles,
  3173. gDims = globals.gDimensions;
  3174. linkId = linkId.toLowerCase();
  3175. if (!title) {
  3176. title = '';
  3177. }
  3178. // Special case for explicit empty url
  3179. if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
  3180. url = '';
  3181. } else if (url === '' || url === null) {
  3182. if (linkId === '' || linkId === null) {
  3183. // lower-case and turn embedded newlines into spaces
  3184. linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
  3185. }
  3186. url = '#' + linkId;
  3187. if (!showdown.helper.isUndefined(gUrls[linkId])) {
  3188. url = gUrls[linkId];
  3189. if (!showdown.helper.isUndefined(gTitles[linkId])) {
  3190. title = gTitles[linkId];
  3191. }
  3192. if (!showdown.helper.isUndefined(gDims[linkId])) {
  3193. width = gDims[linkId].width;
  3194. height = gDims[linkId].height;
  3195. }
  3196. } else {
  3197. return wholeMatch;
  3198. }
  3199. }
  3200. altText = altText
  3201. .replace(/"/g, '&quot;')
  3202. //altText = showdown.helper.escapeCharacters(altText, '*_', false);
  3203. .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
  3204. //url = showdown.helper.escapeCharacters(url, '*_', false);
  3205. url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
  3206. var result = '<img src="' + url + '" alt="' + altText + '"';
  3207. if (title) {
  3208. title = title
  3209. .replace(/"/g, '&quot;')
  3210. //title = showdown.helper.escapeCharacters(title, '*_', false);
  3211. .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
  3212. result += ' title="' + title + '"';
  3213. }
  3214. if (width && height) {
  3215. width = (width === '*') ? 'auto' : width;
  3216. height = (height === '*') ? 'auto' : height;
  3217. result += ' width="' + width + '"';
  3218. result += ' height="' + height + '"';
  3219. }
  3220. result += ' />';
  3221. return result;
  3222. }
  3223. // First, handle reference-style labeled images: ![alt text][id]
  3224. text = text.replace(referenceRegExp, writeImageTag);
  3225. // Next, handle inline images: ![alt text](url =<width>x<height> "optional title")
  3226. // base64 encoded images
  3227. text = text.replace(base64RegExp, writeImageTagBase64);
  3228. // cases with crazy urls like ./image/cat1).png
  3229. text = text.replace(crazyRegExp, writeImageTag);
  3230. // normal cases
  3231. text = text.replace(inlineRegExp, writeImageTag);
  3232. // handle reference-style shortcuts: ![img text]
  3233. text = text.replace(refShortcutRegExp, writeImageTag);
  3234. text = globals.converter._dispatch('images.after', text, options, globals);
  3235. return text;
  3236. });
  3237. showdown.subParser('italicsAndBold', function (text, options, globals) {
  3238. 'use strict';
  3239. text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);
  3240. // it's faster to have 3 separate regexes for each case than have just one
  3241. // because of backtracing, in some cases, it could lead to an exponential effect
  3242. // called "catastrophic backtrace". Ominous!
  3243. function parseInside (txt, left, right) {
  3244. /*
  3245. if (options.simplifiedAutoLink) {
  3246. txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
  3247. }
  3248. */
  3249. return left + txt + right;
  3250. }
  3251. // Parse underscores
  3252. if (options.literalMidWordUnderscores) {
  3253. text = text.replace(/\b___(\S[\s\S]*)___\b/g, function (wm, txt) {
  3254. return parseInside (txt, '<strong><em>', '</em></strong>');
  3255. });
  3256. text = text.replace(/\b__(\S[\s\S]*)__\b/g, function (wm, txt) {
  3257. return parseInside (txt, '<strong>', '</strong>');
  3258. });
  3259. text = text.replace(/\b_(\S[\s\S]*?)_\b/g, function (wm, txt) {
  3260. return parseInside (txt, '<em>', '</em>');
  3261. });
  3262. } else {
  3263. text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
  3264. return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
  3265. });
  3266. text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
  3267. return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
  3268. });
  3269. text = text.replace(/_([^\s_][\s\S]*?)_/g, function (wm, m) {
  3270. // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it)
  3271. return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
  3272. });
  3273. }
  3274. // Now parse asterisks
  3275. if (options.literalMidWordAsterisks) {
  3276. text = text.trim().replace(/(^| )\*{3}(\S[\s\S]*?)\*{3}([ ,;!?.]|$)/g, function (wm, lead, txt, trail) {
  3277. return parseInside (txt, lead + '<strong><em>', '</em></strong>' + trail);
  3278. });
  3279. text = text.trim().replace(/(^| )\*{2}(\S[\s\S]*?)\*{2}([ ,;!?.]|$)/g, function (wm, lead, txt, trail) {
  3280. return parseInside (txt, lead + '<strong>', '</strong>' + trail);
  3281. });
  3282. text = text.trim().replace(/(^| )\*(\S[\s\S]*?)\*([ ,;!?.]|$)/g, function (wm, lead, txt, trail) {
  3283. return parseInside (txt, lead + '<em>', '</em>' + trail);
  3284. });
  3285. } else {
  3286. text = text.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function (wm, m) {
  3287. return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
  3288. });
  3289. text = text.replace(/\*\*(\S[\s\S]*?)\*\*/g, function (wm, m) {
  3290. return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
  3291. });
  3292. text = text.replace(/\*([^\s*][\s\S]*?)\*/g, function (wm, m) {
  3293. // !/^\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it)
  3294. return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
  3295. });
  3296. }
  3297. text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);
  3298. return text;
  3299. });
  3300. /**
  3301. * Form HTML ordered (numbered) and unordered (bulleted) lists.
  3302. */
  3303. showdown.subParser('lists', function (text, options, globals) {
  3304. 'use strict';
  3305. /**
  3306. * Process the contents of a single ordered or unordered list, splitting it
  3307. * into individual list items.
  3308. * @param {string} listStr
  3309. * @param {boolean} trimTrailing
  3310. * @returns {string}
  3311. */
  3312. function processListItems (listStr, trimTrailing) {
  3313. // The $g_list_level global keeps track of when we're inside a list.
  3314. // Each time we enter a list, we increment it; when we leave a list,
  3315. // we decrement. If it's zero, we're not in a list anymore.
  3316. //
  3317. // We do this because when we're not inside a list, we want to treat
  3318. // something like this:
  3319. //
  3320. // I recommend upgrading to version
  3321. // 8. Oops, now this line is treated
  3322. // as a sub-list.
  3323. //
  3324. // As a single paragraph, despite the fact that the second line starts
  3325. // with a digit-period-space sequence.
  3326. //
  3327. // Whereas when we're inside a list (or sub-list), that line will be
  3328. // treated as the start of a sub-list. What a kludge, huh? This is
  3329. // an aspect of Markdown's syntax that's hard to parse perfectly
  3330. // without resorting to mind-reading. Perhaps the solution is to
  3331. // change the syntax rules such that sub-lists must start with a
  3332. // starting cardinal number; e.g. "1." or "a.".
  3333. globals.gListLevel++;
  3334. // trim trailing blank lines:
  3335. listStr = listStr.replace(/\n{2,}$/, '\n');
  3336. // attacklab: add sentinel to emulate \z
  3337. listStr += '¨0';
  3338. var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
  3339. isParagraphed = (/\n[ \t]*\n(?!¨0)/.test(listStr));
  3340. // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation,
  3341. // which is a syntax breaking change
  3342. // activating this option reverts to old behavior
  3343. if (options.disableForced4SpacesIndentedSublists) {
  3344. rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm;
  3345. }
  3346. listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
  3347. checked = (checked && checked.trim() !== '');
  3348. var item = showdown.subParser('outdent')(m4, options, globals),
  3349. bulletStyle = '';
  3350. // Support for github tasklists
  3351. if (taskbtn && options.tasklists) {
  3352. bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
  3353. item = item.replace(/^[ \t]*\[(x|X| )?]/m, function () {
  3354. var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
  3355. if (checked) {
  3356. otp += ' checked';
  3357. }
  3358. otp += '>';
  3359. return otp;
  3360. });
  3361. }
  3362. // ISSUE #312
  3363. // This input: - - - a
  3364. // causes trouble to the parser, since it interprets it as:
  3365. // <ul><li><li><li>a</li></li></li></ul>
  3366. // instead of:
  3367. // <ul><li>- - a</li></ul>
  3368. // So, to prevent it, we will put a marker (¨A)in the beginning of the line
  3369. // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
  3370. item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
  3371. return '¨A' + wm2;
  3372. });
  3373. // m1 - Leading line or
  3374. // Has a double return (multi paragraph) or
  3375. // Has sublist
  3376. if (m1 || (item.search(/\n{2,}/) > -1)) {
  3377. item = showdown.subParser('githubCodeBlocks')(item, options, globals);
  3378. item = showdown.subParser('blockGamut')(item, options, globals);
  3379. } else {
  3380. // Recursion for sub-lists:
  3381. item = showdown.subParser('lists')(item, options, globals);
  3382. item = item.replace(/\n$/, ''); // chomp(item)
  3383. item = showdown.subParser('hashHTMLBlocks')(item, options, globals);
  3384. // Colapse double linebreaks
  3385. item = item.replace(/\n\n+/g, '\n\n');
  3386. if (isParagraphed) {
  3387. item = showdown.subParser('paragraphs')(item, options, globals);
  3388. } else {
  3389. item = showdown.subParser('spanGamut')(item, options, globals);
  3390. }
  3391. }
  3392. // now we need to remove the marker (¨A)
  3393. item = item.replace('¨A', '');
  3394. // we can finally wrap the line in list item tags
  3395. item = '<li' + bulletStyle + '>' + item + '</li>\n';
  3396. return item;
  3397. });
  3398. // attacklab: strip sentinel
  3399. listStr = listStr.replace(/¨0/g, '');
  3400. globals.gListLevel--;
  3401. if (trimTrailing) {
  3402. listStr = listStr.replace(/\s+$/, '');
  3403. }
  3404. return listStr;
  3405. }
  3406. function styleStartNumber (list, listType) {
  3407. // check if ol and starts by a number different than 1
  3408. if (listType === 'ol') {
  3409. var res = list.match(/^ *(\d+)\./);
  3410. if (res && res[1] !== '1') {
  3411. return ' start="' + res[1] + '"';
  3412. }
  3413. }
  3414. return '';
  3415. }
  3416. /**
  3417. * Check and parse consecutive lists (better fix for issue #142)
  3418. * @param {string} list
  3419. * @param {string} listType
  3420. * @param {boolean} trimTrailing
  3421. * @returns {string}
  3422. */
  3423. function parseConsecutiveLists (list, listType, trimTrailing) {
  3424. // check if we caught 2 or more consecutive lists by mistake
  3425. // we use the counterRgx, meaning if listType is UL we look for OL and vice versa
  3426. var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm,
  3427. ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm,
  3428. counterRxg = (listType === 'ul') ? olRgx : ulRgx,
  3429. result = '';
  3430. if (list.search(counterRxg) !== -1) {
  3431. (function parseCL (txt) {
  3432. var pos = txt.search(counterRxg),
  3433. style = styleStartNumber(list, listType);
  3434. if (pos !== -1) {
  3435. // slice
  3436. result += '\n<' + listType + style + '>\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\n';
  3437. // invert counterType and listType
  3438. listType = (listType === 'ul') ? 'ol' : 'ul';
  3439. counterRxg = (listType === 'ul') ? olRgx : ulRgx;
  3440. //recurse
  3441. parseCL(txt.slice(pos));
  3442. } else {
  3443. result += '\n<' + listType + style + '>\n' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\n';
  3444. }
  3445. })(list);
  3446. } else {
  3447. var style = styleStartNumber(list, listType);
  3448. result = '\n<' + listType + style + '>\n' + processListItems(list, !!trimTrailing) + '</' + listType + '>\n';
  3449. }
  3450. return result;
  3451. }
  3452. /** Start of list parsing **/
  3453. text = globals.converter._dispatch('lists.before', text, options, globals);
  3454. // add sentinel to hack around khtml/safari bug:
  3455. // http://bugs.webkit.org/show_bug.cgi?id=11231
  3456. text += '¨0';
  3457. if (globals.gListLevel) {
  3458. text = text.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
  3459. function (wholeMatch, list, m2) {
  3460. var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
  3461. return parseConsecutiveLists(list, listType, true);
  3462. }
  3463. );
  3464. } else {
  3465. text = text.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
  3466. function (wholeMatch, m1, list, m3) {
  3467. var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
  3468. return parseConsecutiveLists(list, listType, false);
  3469. }
  3470. );
  3471. }
  3472. // strip sentinel
  3473. text = text.replace(/¨0/, '');
  3474. text = globals.converter._dispatch('lists.after', text, options, globals);
  3475. return text;
  3476. });
  3477. /**
  3478. * Remove one level of line-leading tabs or spaces
  3479. */
  3480. showdown.subParser('outdent', function (text, options, globals) {
  3481. 'use strict';
  3482. text = globals.converter._dispatch('outdent.before', text, options, globals);
  3483. // attacklab: hack around Konqueror 3.5.4 bug:
  3484. // "----------bug".replace(/^-/g,"") == "bug"
  3485. text = text.replace(/^(\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width
  3486. // attacklab: clean up hack
  3487. text = text.replace(/¨0/g, '');
  3488. text = globals.converter._dispatch('outdent.after', text, options, globals);
  3489. return text;
  3490. });
  3491. /**
  3492. *
  3493. */
  3494. showdown.subParser('paragraphs', function (text, options, globals) {
  3495. 'use strict';
  3496. text = globals.converter._dispatch('paragraphs.before', text, options, globals);
  3497. // Strip leading and trailing lines:
  3498. text = text.replace(/^\n+/g, '');
  3499. text = text.replace(/\n+$/g, '');
  3500. var grafs = text.split(/\n{2,}/g),
  3501. grafsOut = [],
  3502. end = grafs.length; // Wrap <p> tags
  3503. for (var i = 0; i < end; i++) {
  3504. var str = grafs[i];
  3505. // if this is an HTML marker, copy it
  3506. if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
  3507. grafsOut.push(str);
  3508. // test for presence of characters to prevent empty lines being parsed
  3509. // as paragraphs (resulting in undesired extra empty paragraphs)
  3510. } else if (str.search(/\S/) >= 0) {
  3511. str = showdown.subParser('spanGamut')(str, options, globals);
  3512. str = str.replace(/^([ \t]*)/g, '<p>');
  3513. str += '</p>';
  3514. grafsOut.push(str);
  3515. }
  3516. }
  3517. /** Unhashify HTML blocks */
  3518. end = grafsOut.length;
  3519. for (i = 0; i < end; i++) {
  3520. var blockText = '',
  3521. grafsOutIt = grafsOut[i],
  3522. codeFlag = false;
  3523. // if this is a marker for an html block...
  3524. // use RegExp.test instead of string.search because of QML bug
  3525. while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) {
  3526. var delim = RegExp.$1,
  3527. num = RegExp.$2;
  3528. if (delim === 'K') {
  3529. blockText = globals.gHtmlBlocks[num];
  3530. } else {
  3531. // we need to check if ghBlock is a false positive
  3532. if (codeFlag) {
  3533. // use encoded version of all text
  3534. blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals);
  3535. } else {
  3536. blockText = globals.ghCodeBlocks[num].codeblock;
  3537. }
  3538. }
  3539. blockText = blockText.replace(/\$/g, '$$$$'); // Escape any dollar signs
  3540. grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText);
  3541. // Check if grafsOutIt is a pre->code
  3542. if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) {
  3543. codeFlag = true;
  3544. }
  3545. }
  3546. grafsOut[i] = grafsOutIt;
  3547. }
  3548. text = grafsOut.join('\n');
  3549. // Strip leading and trailing lines:
  3550. text = text.replace(/^\n+/g, '');
  3551. text = text.replace(/\n+$/g, '');
  3552. return globals.converter._dispatch('paragraphs.after', text, options, globals);
  3553. });
  3554. /**
  3555. * Run extension
  3556. */
  3557. showdown.subParser('runExtension', function (ext, text, options, globals) {
  3558. 'use strict';
  3559. if (ext.filter) {
  3560. text = ext.filter(text, globals.converter, options);
  3561. } else if (ext.regex) {
  3562. // TODO remove this when old extension loading mechanism is deprecated
  3563. var re = ext.regex;
  3564. if (!(re instanceof RegExp)) {
  3565. re = new RegExp(re, 'g');
  3566. }
  3567. text = text.replace(re, ext.replace);
  3568. }
  3569. return text;
  3570. });
  3571. /**
  3572. * These are all the transformations that occur *within* block-level
  3573. * tags like paragraphs, headers, and list items.
  3574. */
  3575. showdown.subParser('spanGamut', function (text, options, globals) {
  3576. 'use strict';
  3577. text = globals.converter._dispatch('spanGamut.before', text, options, globals);
  3578. text = showdown.subParser('codeSpans')(text, options, globals);
  3579. text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);
  3580. text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);
  3581. // Process anchor and image tags. Images must come first,
  3582. // because ![foo][f] looks like an anchor.
  3583. text = showdown.subParser('images')(text, options, globals);
  3584. text = showdown.subParser('anchors')(text, options, globals);
  3585. // Make links out of things like `<http://example.com/>`
  3586. // Must come after anchors, because you can use < and >
  3587. // delimiters in inline links like [this](<url>).
  3588. text = showdown.subParser('autoLinks')(text, options, globals);
  3589. text = showdown.subParser('simplifiedAutoLinks')(text, options, globals);
  3590. text = showdown.subParser('emoji')(text, options, globals);
  3591. text = showdown.subParser('italicsAndBold')(text, options, globals);
  3592. text = showdown.subParser('strikethrough')(text, options, globals);
  3593. // we need to hash HTML tags inside spans
  3594. text = showdown.subParser('hashHTMLSpans')(text, options, globals);
  3595. // now we encode amps and angles
  3596. text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);
  3597. // Do hard breaks
  3598. if (options.simpleLineBreaks) {
  3599. // GFM style hard breaks
  3600. // only add line breaks if the text does not contain a block (special case for lists)
  3601. if (!/\n\n¨K/.test(text)) {
  3602. text = text.replace(/\n+/g, '<br />\n');
  3603. }
  3604. } else {
  3605. // Vanilla hard breaks
  3606. text = text.replace(/ +\n/g, '<br />\n');
  3607. }
  3608. text = globals.converter._dispatch('spanGamut.after', text, options, globals);
  3609. return text;
  3610. });
  3611. showdown.subParser('strikethrough', function (text, options, globals) {
  3612. 'use strict';
  3613. function parseInside (txt) {
  3614. if (options.simplifiedAutoLink) {
  3615. txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
  3616. }
  3617. return '<del>' + txt + '</del>';
  3618. }
  3619. if (options.strikethrough) {
  3620. text = globals.converter._dispatch('strikethrough.before', text, options, globals);
  3621. text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); });
  3622. text = globals.converter._dispatch('strikethrough.after', text, options, globals);
  3623. }
  3624. return text;
  3625. });
  3626. /**
  3627. * Strips link definitions from text, stores the URLs and titles in
  3628. * hash references.
  3629. * Link defs are in the form: ^[id]: url "optional title"
  3630. */
  3631. showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
  3632. 'use strict';
  3633. var regex = /^ {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,
  3634. base64Regex = /^ {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;
  3635. // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
  3636. text += '¨0';
  3637. var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
  3638. linkId = linkId.toLowerCase();
  3639. if (url.match(/^data:.+?\/.+?;base64,/)) {
  3640. // remove newlines
  3641. globals.gUrls[linkId] = url.replace(/\s/g, '');
  3642. } else {
  3643. globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals); // Link IDs are case-insensitive
  3644. }
  3645. if (blankLines) {
  3646. // Oops, found blank lines, so it's not a title.
  3647. // Put back the parenthetical statement we stole.
  3648. return blankLines + title;
  3649. } else {
  3650. if (title) {
  3651. globals.gTitles[linkId] = title.replace(/"|'/g, '&quot;');
  3652. }
  3653. if (options.parseImgDimensions && width && height) {
  3654. globals.gDimensions[linkId] = {
  3655. width: width,
  3656. height: height
  3657. };
  3658. }
  3659. }
  3660. // Completely remove the definition from the text
  3661. return '';
  3662. };
  3663. // first we try to find base64 link references
  3664. text = text.replace(base64Regex, replaceFunc);
  3665. text = text.replace(regex, replaceFunc);
  3666. // attacklab: strip sentinel
  3667. text = text.replace(/¨0/, '');
  3668. return text;
  3669. });
  3670. showdown.subParser('tables', function (text, options, globals) {
  3671. 'use strict';
  3672. if (!options.tables) {
  3673. return text;
  3674. }
  3675. var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|<ol|<ul|¨0)/gm,
  3676. //singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
  3677. singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|<ol|<ul|¨0)/gm;
  3678. function parseStyles (sLine) {
  3679. if (/^:[ \t]*--*$/.test(sLine)) {
  3680. return ' style="text-align:left;"';
  3681. } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
  3682. return ' style="text-align:right;"';
  3683. } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
  3684. return ' style="text-align:center;"';
  3685. } else {
  3686. return '';
  3687. }
  3688. }
  3689. function parseHeaders (header, style) {
  3690. var id = '';
  3691. header = header.trim();
  3692. // support both tablesHeaderId and tableHeaderId due to error in documention so we don't break backwards compatibility
  3693. if (options.tablesHeaderId || options.tableHeaderId) {
  3694. id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
  3695. }
  3696. header = showdown.subParser('spanGamut')(header, options, globals);
  3697. return '<th' + id + style + '>' + header + '</th>\n';
  3698. }
  3699. function parseCells (cell, style) {
  3700. var subText = showdown.subParser('spanGamut')(cell, options, globals);
  3701. return '<td' + style + '>' + subText + '</td>\n';
  3702. }
  3703. function buildTable (headers, cells) {
  3704. var tb = '<table>\n<thead>\n<tr>\n',
  3705. tblLgn = headers.length;
  3706. for (var i = 0; i < tblLgn; ++i) {
  3707. tb += headers[i];
  3708. }
  3709. tb += '</tr>\n</thead>\n<tbody>\n';
  3710. for (i = 0; i < cells.length; ++i) {
  3711. tb += '<tr>\n';
  3712. for (var ii = 0; ii < tblLgn; ++ii) {
  3713. tb += cells[i][ii];
  3714. }
  3715. tb += '</tr>\n';
  3716. }
  3717. tb += '</tbody>\n</table>\n';
  3718. return tb;
  3719. }
  3720. function parseTable (rawTable) {
  3721. var i, tableLines = rawTable.split('\n');
  3722. // strip wrong first and last column if wrapped tables are used
  3723. for (i = 0; i < tableLines.length; ++i) {
  3724. if (/^ {0,3}\|/.test(tableLines[i])) {
  3725. tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, '');
  3726. }
  3727. if (/\|[ \t]*$/.test(tableLines[i])) {
  3728. tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
  3729. }
  3730. }
  3731. var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
  3732. rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
  3733. rawCells = [],
  3734. headers = [],
  3735. styles = [],
  3736. cells = [];
  3737. tableLines.shift();
  3738. tableLines.shift();
  3739. for (i = 0; i < tableLines.length; ++i) {
  3740. if (tableLines[i].trim() === '') {
  3741. continue;
  3742. }
  3743. rawCells.push(
  3744. tableLines[i]
  3745. .split('|')
  3746. .map(function (s) {
  3747. return s.trim();
  3748. })
  3749. );
  3750. }
  3751. if (rawHeaders.length < rawStyles.length) {
  3752. return rawTable;
  3753. }
  3754. for (i = 0; i < rawStyles.length; ++i) {
  3755. styles.push(parseStyles(rawStyles[i]));
  3756. }
  3757. for (i = 0; i < rawHeaders.length; ++i) {
  3758. if (showdown.helper.isUndefined(styles[i])) {
  3759. styles[i] = '';
  3760. }
  3761. headers.push(parseHeaders(rawHeaders[i], styles[i]));
  3762. }
  3763. for (i = 0; i < rawCells.length; ++i) {
  3764. var row = [];
  3765. for (var ii = 0; ii < headers.length; ++ii) {
  3766. if (showdown.helper.isUndefined(rawCells[i][ii])) {
  3767. }
  3768. row.push(parseCells(rawCells[i][ii], styles[ii]));
  3769. }
  3770. cells.push(row);
  3771. }
  3772. return buildTable(headers, cells);
  3773. }
  3774. function hackFixTableFollowedByList (rawTable) {
  3775. var lastChars = rawTable.slice(-3);
  3776. if (lastChars === '<ol' || lastChars === '<ul') {
  3777. rawTable = rawTable.slice(0, -3) + '\n\n' + rawTable.slice(-3);
  3778. }
  3779. return rawTable;
  3780. }
  3781. text = globals.converter._dispatch('tables.before', text, options, globals);
  3782. // find escaped pipe characters
  3783. text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
  3784. // hackfix issue #443. Due to lists only having a linebreak before them, we need to manually insert a linebreak to prevent
  3785. // tables not being parsed when followed by a list
  3786. text = text.replace(tableRgx, hackFixTableFollowedByList);
  3787. text = text.replace(singeColTblRgx, hackFixTableFollowedByList);
  3788. // parse multi column tables
  3789. text = text.replace(tableRgx, parseTable);
  3790. // parse one column tables
  3791. text = text.replace(singeColTblRgx, parseTable);
  3792. text = globals.converter._dispatch('tables.after', text, options, globals);
  3793. return text;
  3794. });
  3795. /**
  3796. * Swap back in all the special characters we've hidden.
  3797. */
  3798. showdown.subParser('unescapeSpecialChars', function (text, options, globals) {
  3799. 'use strict';
  3800. text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);
  3801. text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
  3802. var charCodeToReplace = parseInt(m1);
  3803. return String.fromCharCode(charCodeToReplace);
  3804. });
  3805. text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);
  3806. return text;
  3807. });
  3808. var root = this;
  3809. // AMD Loader
  3810. if (typeof define === 'function' && define.amd) {
  3811. define(function () {
  3812. 'use strict';
  3813. return showdown;
  3814. });
  3815. // CommonJS/nodeJS Loader
  3816. } else if (typeof module !== 'undefined' && module.exports) {
  3817. module.exports = showdown;
  3818. // Regular Browser loader
  3819. } else {
  3820. root.showdown = showdown;
  3821. }
  3822. }).call(this);
  3823. //# sourceMappingURL=showdown.js.map