showdown.js 179 KB

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