showdown.js 169 KB

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