showdown.js 164 KB

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