showdown.js 165 KB

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