markdown-it.js 263 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154
  1. /*! markdown-it 10.0.0 https://github.com//markdown-it/markdown-it @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownit = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  2. // HTML5 entities map: { name -> utf16string }
  3. //
  4. 'use strict';
  5. /*eslint quotes:0*/
  6. module.exports = require('entities/lib/maps/entities.json');
  7. },{"entities/lib/maps/entities.json":52}],2:[function(require,module,exports){
  8. // List of valid html blocks names, accorting to commonmark spec
  9. // http://jgm.github.io/CommonMark/spec.html#html-blocks
  10. 'use strict';
  11. module.exports = [
  12. 'address',
  13. 'article',
  14. 'aside',
  15. 'base',
  16. 'basefont',
  17. 'blockquote',
  18. 'body',
  19. 'caption',
  20. 'center',
  21. 'col',
  22. 'colgroup',
  23. 'dd',
  24. 'details',
  25. 'dialog',
  26. 'dir',
  27. 'div',
  28. 'dl',
  29. 'dt',
  30. 'fieldset',
  31. 'figcaption',
  32. 'figure',
  33. 'footer',
  34. 'form',
  35. 'frame',
  36. 'frameset',
  37. 'h1',
  38. 'h2',
  39. 'h3',
  40. 'h4',
  41. 'h5',
  42. 'h6',
  43. 'head',
  44. 'header',
  45. 'hr',
  46. 'html',
  47. 'iframe',
  48. 'legend',
  49. 'li',
  50. 'link',
  51. 'main',
  52. 'menu',
  53. 'menuitem',
  54. 'meta',
  55. 'nav',
  56. 'noframes',
  57. 'ol',
  58. 'optgroup',
  59. 'option',
  60. 'p',
  61. 'param',
  62. 'section',
  63. 'source',
  64. 'summary',
  65. 'table',
  66. 'tbody',
  67. 'td',
  68. 'tfoot',
  69. 'th',
  70. 'thead',
  71. 'title',
  72. 'tr',
  73. 'track',
  74. 'ul'
  75. ];
  76. },{}],3:[function(require,module,exports){
  77. // Regexps to match html elements
  78. 'use strict';
  79. var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
  80. var unquoted = '[^"\'=<>`\\x00-\\x20]+';
  81. var single_quoted = "'[^']*'";
  82. var double_quoted = '"[^"]*"';
  83. var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';
  84. var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)';
  85. var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
  86. var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
  87. var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
  88. var processing = '<[?].*?[?]>';
  89. var declaration = '<![A-Z]+\\s+[^>]*>';
  90. var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
  91. var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +
  92. '|' + processing + '|' + declaration + '|' + cdata + ')');
  93. var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');
  94. module.exports.HTML_TAG_RE = HTML_TAG_RE;
  95. module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
  96. },{}],4:[function(require,module,exports){
  97. // Utilities
  98. //
  99. 'use strict';
  100. function _class(obj) { return Object.prototype.toString.call(obj); }
  101. function isString(obj) { return _class(obj) === '[object String]'; }
  102. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  103. function has(object, key) {
  104. return _hasOwnProperty.call(object, key);
  105. }
  106. // Merge objects
  107. //
  108. function assign(obj /*from1, from2, from3, ...*/) {
  109. var sources = Array.prototype.slice.call(arguments, 1);
  110. sources.forEach(function (source) {
  111. if (!source) { return; }
  112. if (typeof source !== 'object') {
  113. throw new TypeError(source + 'must be object');
  114. }
  115. Object.keys(source).forEach(function (key) {
  116. obj[key] = source[key];
  117. });
  118. });
  119. return obj;
  120. }
  121. // Remove element from array and put another array at those position.
  122. // Useful for some operations with tokens
  123. function arrayReplaceAt(src, pos, newElements) {
  124. return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
  125. }
  126. ////////////////////////////////////////////////////////////////////////////////
  127. function isValidEntityCode(c) {
  128. /*eslint no-bitwise:0*/
  129. // broken sequence
  130. if (c >= 0xD800 && c <= 0xDFFF) { return false; }
  131. // never used
  132. if (c >= 0xFDD0 && c <= 0xFDEF) { return false; }
  133. if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; }
  134. // control codes
  135. if (c >= 0x00 && c <= 0x08) { return false; }
  136. if (c === 0x0B) { return false; }
  137. if (c >= 0x0E && c <= 0x1F) { return false; }
  138. if (c >= 0x7F && c <= 0x9F) { return false; }
  139. // out of range
  140. if (c > 0x10FFFF) { return false; }
  141. return true;
  142. }
  143. function fromCodePoint(c) {
  144. /*eslint no-bitwise:0*/
  145. if (c > 0xffff) {
  146. c -= 0x10000;
  147. var surrogate1 = 0xd800 + (c >> 10),
  148. surrogate2 = 0xdc00 + (c & 0x3ff);
  149. return String.fromCharCode(surrogate1, surrogate2);
  150. }
  151. return String.fromCharCode(c);
  152. }
  153. var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
  154. var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
  155. var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi');
  156. var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
  157. var entities = require('./entities');
  158. function replaceEntityPattern(match, name) {
  159. var code = 0;
  160. if (has(entities, name)) {
  161. return entities[name];
  162. }
  163. if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {
  164. code = name[1].toLowerCase() === 'x' ?
  165. parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);
  166. if (isValidEntityCode(code)) {
  167. return fromCodePoint(code);
  168. }
  169. }
  170. return match;
  171. }
  172. /*function replaceEntities(str) {
  173. if (str.indexOf('&') < 0) { return str; }
  174. return str.replace(ENTITY_RE, replaceEntityPattern);
  175. }*/
  176. function unescapeMd(str) {
  177. if (str.indexOf('\\') < 0) { return str; }
  178. return str.replace(UNESCAPE_MD_RE, '$1');
  179. }
  180. function unescapeAll(str) {
  181. if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; }
  182. return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {
  183. if (escaped) { return escaped; }
  184. return replaceEntityPattern(match, entity);
  185. });
  186. }
  187. ////////////////////////////////////////////////////////////////////////////////
  188. var HTML_ESCAPE_TEST_RE = /[&<>"]/;
  189. var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
  190. var HTML_REPLACEMENTS = {
  191. '&': '&amp;',
  192. '<': '&lt;',
  193. '>': '&gt;',
  194. '"': '&quot;'
  195. };
  196. function replaceUnsafeChar(ch) {
  197. return HTML_REPLACEMENTS[ch];
  198. }
  199. function escapeHtml(str) {
  200. if (HTML_ESCAPE_TEST_RE.test(str)) {
  201. return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
  202. }
  203. return str;
  204. }
  205. ////////////////////////////////////////////////////////////////////////////////
  206. var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
  207. function escapeRE(str) {
  208. return str.replace(REGEXP_ESCAPE_RE, '\\$&');
  209. }
  210. ////////////////////////////////////////////////////////////////////////////////
  211. function isSpace(code) {
  212. switch (code) {
  213. case 0x09:
  214. case 0x20:
  215. return true;
  216. }
  217. return false;
  218. }
  219. // Zs (unicode class) || [\t\f\v\r\n]
  220. function isWhiteSpace(code) {
  221. if (code >= 0x2000 && code <= 0x200A) { return true; }
  222. switch (code) {
  223. case 0x09: // \t
  224. case 0x0A: // \n
  225. case 0x0B: // \v
  226. case 0x0C: // \f
  227. case 0x0D: // \r
  228. case 0x20:
  229. case 0xA0:
  230. case 0x1680:
  231. case 0x202F:
  232. case 0x205F:
  233. case 0x3000:
  234. return true;
  235. }
  236. return false;
  237. }
  238. ////////////////////////////////////////////////////////////////////////////////
  239. /*eslint-disable max-len*/
  240. var UNICODE_PUNCT_RE = require('uc.micro/categories/P/regex');
  241. // Currently without astral characters support.
  242. function isPunctChar(ch) {
  243. return UNICODE_PUNCT_RE.test(ch);
  244. }
  245. // Markdown ASCII punctuation characters.
  246. //
  247. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  248. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  249. //
  250. // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
  251. //
  252. function isMdAsciiPunct(ch) {
  253. switch (ch) {
  254. case 0x21/* ! */:
  255. case 0x22/* " */:
  256. case 0x23/* # */:
  257. case 0x24/* $ */:
  258. case 0x25/* % */:
  259. case 0x26/* & */:
  260. case 0x27/* ' */:
  261. case 0x28/* ( */:
  262. case 0x29/* ) */:
  263. case 0x2A/* * */:
  264. case 0x2B/* + */:
  265. case 0x2C/* , */:
  266. case 0x2D/* - */:
  267. case 0x2E/* . */:
  268. case 0x2F/* / */:
  269. case 0x3A/* : */:
  270. case 0x3B/* ; */:
  271. case 0x3C/* < */:
  272. case 0x3D/* = */:
  273. case 0x3E/* > */:
  274. case 0x3F/* ? */:
  275. case 0x40/* @ */:
  276. case 0x5B/* [ */:
  277. case 0x5C/* \ */:
  278. case 0x5D/* ] */:
  279. case 0x5E/* ^ */:
  280. case 0x5F/* _ */:
  281. case 0x60/* ` */:
  282. case 0x7B/* { */:
  283. case 0x7C/* | */:
  284. case 0x7D/* } */:
  285. case 0x7E/* ~ */:
  286. return true;
  287. default:
  288. return false;
  289. }
  290. }
  291. // Hepler to unify [reference labels].
  292. //
  293. function normalizeReference(str) {
  294. // Trim and collapse whitespace
  295. //
  296. str = str.trim().replace(/\s+/g, ' ');
  297. // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug
  298. // fixed in v12 (couldn't find any details).
  299. //
  300. // So treat this one as a special case
  301. // (remove this when node v10 is no longer supported).
  302. //
  303. if ('ẞ'.toLowerCase() === 'Ṿ') {
  304. str = str.replace(/ẞ/g, 'ß');
  305. }
  306. // .toLowerCase().toUpperCase() should get rid of all differences
  307. // between letter variants.
  308. //
  309. // Simple .toLowerCase() doesn't normalize 125 code points correctly,
  310. // and .toUpperCase doesn't normalize 6 of them (list of exceptions:
  311. // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently
  312. // uppercased versions).
  313. //
  314. // Here's an example showing how it happens. Lets take greek letter omega:
  315. // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ)
  316. //
  317. // Unicode entries:
  318. // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;
  319. // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398
  320. // 03D1;GREEK THETA SYMBOL;Ll;0;L;<compat> 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398
  321. // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L;<compat> 0398;;;;N;;;;03B8;
  322. //
  323. // Case-insensitive comparison should treat all of them as equivalent.
  324. //
  325. // But .toLowerCase() doesn't change ϑ (it's already lowercase),
  326. // and .toUpperCase() doesn't change ϴ (already uppercase).
  327. //
  328. // Applying first lower then upper case normalizes any character:
  329. // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398'
  330. //
  331. // Note: this is equivalent to unicode case folding; unicode normalization
  332. // is a different step that is not required here.
  333. //
  334. // Final result should be uppercased, because it's later stored in an object
  335. // (this avoid a conflict with Object.prototype members,
  336. // most notably, `__proto__`)
  337. //
  338. return str.toLowerCase().toUpperCase();
  339. }
  340. ////////////////////////////////////////////////////////////////////////////////
  341. // Re-export libraries commonly used in both markdown-it and its plugins,
  342. // so plugins won't have to depend on them explicitly, which reduces their
  343. // bundled size (e.g. a browser build).
  344. //
  345. exports.lib = {};
  346. exports.lib.mdurl = require('mdurl');
  347. exports.lib.ucmicro = require('uc.micro');
  348. exports.assign = assign;
  349. exports.isString = isString;
  350. exports.has = has;
  351. exports.unescapeMd = unescapeMd;
  352. exports.unescapeAll = unescapeAll;
  353. exports.isValidEntityCode = isValidEntityCode;
  354. exports.fromCodePoint = fromCodePoint;
  355. // exports.replaceEntities = replaceEntities;
  356. exports.escapeHtml = escapeHtml;
  357. exports.arrayReplaceAt = arrayReplaceAt;
  358. exports.isSpace = isSpace;
  359. exports.isWhiteSpace = isWhiteSpace;
  360. exports.isMdAsciiPunct = isMdAsciiPunct;
  361. exports.isPunctChar = isPunctChar;
  362. exports.escapeRE = escapeRE;
  363. exports.normalizeReference = normalizeReference;
  364. },{"./entities":1,"mdurl":58,"uc.micro":65,"uc.micro/categories/P/regex":63}],5:[function(require,module,exports){
  365. // Just a shortcut for bulk export
  366. 'use strict';
  367. exports.parseLinkLabel = require('./parse_link_label');
  368. exports.parseLinkDestination = require('./parse_link_destination');
  369. exports.parseLinkTitle = require('./parse_link_title');
  370. },{"./parse_link_destination":6,"./parse_link_label":7,"./parse_link_title":8}],6:[function(require,module,exports){
  371. // Parse link destination
  372. //
  373. 'use strict';
  374. var unescapeAll = require('../common/utils').unescapeAll;
  375. module.exports = function parseLinkDestination(str, pos, max) {
  376. var code, level,
  377. lines = 0,
  378. start = pos,
  379. result = {
  380. ok: false,
  381. pos: 0,
  382. lines: 0,
  383. str: ''
  384. };
  385. if (str.charCodeAt(pos) === 0x3C /* < */) {
  386. pos++;
  387. while (pos < max) {
  388. code = str.charCodeAt(pos);
  389. if (code === 0x0A /* \n */) { return result; }
  390. if (code === 0x3E /* > */) {
  391. result.pos = pos + 1;
  392. result.str = unescapeAll(str.slice(start + 1, pos));
  393. result.ok = true;
  394. return result;
  395. }
  396. if (code === 0x5C /* \ */ && pos + 1 < max) {
  397. pos += 2;
  398. continue;
  399. }
  400. pos++;
  401. }
  402. // no closing '>'
  403. return result;
  404. }
  405. // this should be ... } else { ... branch
  406. level = 0;
  407. while (pos < max) {
  408. code = str.charCodeAt(pos);
  409. if (code === 0x20) { break; }
  410. // ascii control characters
  411. if (code < 0x20 || code === 0x7F) { break; }
  412. if (code === 0x5C /* \ */ && pos + 1 < max) {
  413. pos += 2;
  414. continue;
  415. }
  416. if (code === 0x28 /* ( */) {
  417. level++;
  418. }
  419. if (code === 0x29 /* ) */) {
  420. if (level === 0) { break; }
  421. level--;
  422. }
  423. pos++;
  424. }
  425. if (start === pos) { return result; }
  426. if (level !== 0) { return result; }
  427. result.str = unescapeAll(str.slice(start, pos));
  428. result.lines = lines;
  429. result.pos = pos;
  430. result.ok = true;
  431. return result;
  432. };
  433. },{"../common/utils":4}],7:[function(require,module,exports){
  434. // Parse link label
  435. //
  436. // this function assumes that first character ("[") already matches;
  437. // returns the end of the label
  438. //
  439. 'use strict';
  440. module.exports = function parseLinkLabel(state, start, disableNested) {
  441. var level, found, marker, prevPos,
  442. labelEnd = -1,
  443. max = state.posMax,
  444. oldPos = state.pos;
  445. state.pos = start + 1;
  446. level = 1;
  447. while (state.pos < max) {
  448. marker = state.src.charCodeAt(state.pos);
  449. if (marker === 0x5D /* ] */) {
  450. level--;
  451. if (level === 0) {
  452. found = true;
  453. break;
  454. }
  455. }
  456. prevPos = state.pos;
  457. state.md.inline.skipToken(state);
  458. if (marker === 0x5B /* [ */) {
  459. if (prevPos === state.pos - 1) {
  460. // increase level if we find text `[`, which is not a part of any token
  461. level++;
  462. } else if (disableNested) {
  463. state.pos = oldPos;
  464. return -1;
  465. }
  466. }
  467. }
  468. if (found) {
  469. labelEnd = state.pos;
  470. }
  471. // restore old state
  472. state.pos = oldPos;
  473. return labelEnd;
  474. };
  475. },{}],8:[function(require,module,exports){
  476. // Parse link title
  477. //
  478. 'use strict';
  479. var unescapeAll = require('../common/utils').unescapeAll;
  480. module.exports = function parseLinkTitle(str, pos, max) {
  481. var code,
  482. marker,
  483. lines = 0,
  484. start = pos,
  485. result = {
  486. ok: false,
  487. pos: 0,
  488. lines: 0,
  489. str: ''
  490. };
  491. if (pos >= max) { return result; }
  492. marker = str.charCodeAt(pos);
  493. if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
  494. pos++;
  495. // if opening marker is "(", switch it to closing marker ")"
  496. if (marker === 0x28) { marker = 0x29; }
  497. while (pos < max) {
  498. code = str.charCodeAt(pos);
  499. if (code === marker) {
  500. result.pos = pos + 1;
  501. result.lines = lines;
  502. result.str = unescapeAll(str.slice(start + 1, pos));
  503. result.ok = true;
  504. return result;
  505. } else if (code === 0x0A) {
  506. lines++;
  507. } else if (code === 0x5C /* \ */ && pos + 1 < max) {
  508. pos++;
  509. if (str.charCodeAt(pos) === 0x0A) {
  510. lines++;
  511. }
  512. }
  513. pos++;
  514. }
  515. return result;
  516. };
  517. },{"../common/utils":4}],9:[function(require,module,exports){
  518. // Main parser class
  519. 'use strict';
  520. var utils = require('./common/utils');
  521. var helpers = require('./helpers');
  522. var Renderer = require('./renderer');
  523. var ParserCore = require('./parser_core');
  524. var ParserBlock = require('./parser_block');
  525. var ParserInline = require('./parser_inline');
  526. var LinkifyIt = require('linkify-it');
  527. var mdurl = require('mdurl');
  528. var punycode = require('punycode');
  529. var config = {
  530. 'default': require('./presets/default'),
  531. zero: require('./presets/zero'),
  532. commonmark: require('./presets/commonmark')
  533. };
  534. ////////////////////////////////////////////////////////////////////////////////
  535. //
  536. // This validator can prohibit more than really needed to prevent XSS. It's a
  537. // tradeoff to keep code simple and to be secure by default.
  538. //
  539. // If you need different setup - override validator method as you wish. Or
  540. // replace it with dummy function and use external sanitizer.
  541. //
  542. var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
  543. var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
  544. function validateLink(url) {
  545. // url should be normalized at this point, and existing entities are decoded
  546. var str = url.trim().toLowerCase();
  547. return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
  548. }
  549. ////////////////////////////////////////////////////////////////////////////////
  550. var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
  551. function normalizeLink(url) {
  552. var parsed = mdurl.parse(url, true);
  553. if (parsed.hostname) {
  554. // Encode hostnames in urls like:
  555. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  556. //
  557. // We don't encode unknown schemas, because it's likely that we encode
  558. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  559. //
  560. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  561. try {
  562. parsed.hostname = punycode.toASCII(parsed.hostname);
  563. } catch (er) { /**/ }
  564. }
  565. }
  566. return mdurl.encode(mdurl.format(parsed));
  567. }
  568. function normalizeLinkText(url) {
  569. var parsed = mdurl.parse(url, true);
  570. if (parsed.hostname) {
  571. // Encode hostnames in urls like:
  572. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  573. //
  574. // We don't encode unknown schemas, because it's likely that we encode
  575. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  576. //
  577. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  578. try {
  579. parsed.hostname = punycode.toUnicode(parsed.hostname);
  580. } catch (er) { /**/ }
  581. }
  582. }
  583. return mdurl.decode(mdurl.format(parsed));
  584. }
  585. /**
  586. * class MarkdownIt
  587. *
  588. * Main parser/renderer class.
  589. *
  590. * ##### Usage
  591. *
  592. * ```javascript
  593. * // node.js, "classic" way:
  594. * var MarkdownIt = require('markdown-it'),
  595. * md = new MarkdownIt();
  596. * var result = md.render('# markdown-it rulezz!');
  597. *
  598. * // node.js, the same, but with sugar:
  599. * var md = require('markdown-it')();
  600. * var result = md.render('# markdown-it rulezz!');
  601. *
  602. * // browser without AMD, added to "window" on script load
  603. * // Note, there are no dash.
  604. * var md = window.markdownit();
  605. * var result = md.render('# markdown-it rulezz!');
  606. * ```
  607. *
  608. * Single line rendering, without paragraph wrap:
  609. *
  610. * ```javascript
  611. * var md = require('markdown-it')();
  612. * var result = md.renderInline('__markdown-it__ rulezz!');
  613. * ```
  614. **/
  615. /**
  616. * new MarkdownIt([presetName, options])
  617. * - presetName (String): optional, `commonmark` / `zero`
  618. * - options (Object)
  619. *
  620. * Creates parser instanse with given config. Can be called without `new`.
  621. *
  622. * ##### presetName
  623. *
  624. * MarkdownIt provides named presets as a convenience to quickly
  625. * enable/disable active syntax rules and options for common use cases.
  626. *
  627. * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
  628. * configures parser to strict [CommonMark](http://commonmark.org/) mode.
  629. * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
  630. * similar to GFM, used when no preset name given. Enables all available rules,
  631. * but still without html, typographer & autolinker.
  632. * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
  633. * all rules disabled. Useful to quickly setup your config via `.enable()`.
  634. * For example, when you need only `bold` and `italic` markup and nothing else.
  635. *
  636. * ##### options:
  637. *
  638. * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
  639. * That's not safe! You may need external sanitizer to protect output from XSS.
  640. * It's better to extend features via plugins, instead of enabling HTML.
  641. * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
  642. * (`<br />`). This is needed only for full CommonMark compatibility. In real
  643. * world you will need HTML output.
  644. * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
  645. * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
  646. * Can be useful for external highlighters.
  647. * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
  648. * - __typographer__ - `false`. Set `true` to enable [some language-neutral
  649. * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
  650. * quotes beautification (smartquotes).
  651. * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
  652. * pairs, when typographer enabled and smartquotes on. For example, you can
  653. * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
  654. * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
  655. * - __highlight__ - `null`. Highlighter function for fenced code blocks.
  656. * Highlighter `function (str, lang)` should return escaped HTML. It can also
  657. * return empty string if the source was not changed and should be escaped
  658. * externaly. If result starts with <pre... internal wrapper is skipped.
  659. *
  660. * ##### Example
  661. *
  662. * ```javascript
  663. * // commonmark mode
  664. * var md = require('markdown-it')('commonmark');
  665. *
  666. * // default mode
  667. * var md = require('markdown-it')();
  668. *
  669. * // enable everything
  670. * var md = require('markdown-it')({
  671. * html: true,
  672. * linkify: true,
  673. * typographer: true
  674. * });
  675. * ```
  676. *
  677. * ##### Syntax highlighting
  678. *
  679. * ```js
  680. * var hljs = require('highlight.js') // https://highlightjs.org/
  681. *
  682. * var md = require('markdown-it')({
  683. * highlight: function (str, lang) {
  684. * if (lang && hljs.getLanguage(lang)) {
  685. * try {
  686. * return hljs.highlight(lang, str, true).value;
  687. * } catch (__) {}
  688. * }
  689. *
  690. * return ''; // use external default escaping
  691. * }
  692. * });
  693. * ```
  694. *
  695. * Or with full wrapper override (if you need assign class to `<pre>`):
  696. *
  697. * ```javascript
  698. * var hljs = require('highlight.js') // https://highlightjs.org/
  699. *
  700. * // Actual default values
  701. * var md = require('markdown-it')({
  702. * highlight: function (str, lang) {
  703. * if (lang && hljs.getLanguage(lang)) {
  704. * try {
  705. * return '<pre class="hljs"><code>' +
  706. * hljs.highlight(lang, str, true).value +
  707. * '</code></pre>';
  708. * } catch (__) {}
  709. * }
  710. *
  711. * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
  712. * }
  713. * });
  714. * ```
  715. *
  716. **/
  717. function MarkdownIt(presetName, options) {
  718. if (!(this instanceof MarkdownIt)) {
  719. return new MarkdownIt(presetName, options);
  720. }
  721. if (!options) {
  722. if (!utils.isString(presetName)) {
  723. options = presetName || {};
  724. presetName = 'default';
  725. }
  726. }
  727. /**
  728. * MarkdownIt#inline -> ParserInline
  729. *
  730. * Instance of [[ParserInline]]. You may need it to add new rules when
  731. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  732. * [[MarkdownIt.enable]].
  733. **/
  734. this.inline = new ParserInline();
  735. /**
  736. * MarkdownIt#block -> ParserBlock
  737. *
  738. * Instance of [[ParserBlock]]. You may need it to add new rules when
  739. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  740. * [[MarkdownIt.enable]].
  741. **/
  742. this.block = new ParserBlock();
  743. /**
  744. * MarkdownIt#core -> Core
  745. *
  746. * Instance of [[Core]] chain executor. You may need it to add new rules when
  747. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  748. * [[MarkdownIt.enable]].
  749. **/
  750. this.core = new ParserCore();
  751. /**
  752. * MarkdownIt#renderer -> Renderer
  753. *
  754. * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
  755. * rules for new token types, generated by plugins.
  756. *
  757. * ##### Example
  758. *
  759. * ```javascript
  760. * var md = require('markdown-it')();
  761. *
  762. * function myToken(tokens, idx, options, env, self) {
  763. * //...
  764. * return result;
  765. * };
  766. *
  767. * md.renderer.rules['my_token'] = myToken
  768. * ```
  769. *
  770. * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
  771. **/
  772. this.renderer = new Renderer();
  773. /**
  774. * MarkdownIt#linkify -> LinkifyIt
  775. *
  776. * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
  777. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
  778. * rule.
  779. **/
  780. this.linkify = new LinkifyIt();
  781. /**
  782. * MarkdownIt#validateLink(url) -> Boolean
  783. *
  784. * Link validation function. CommonMark allows too much in links. By default
  785. * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
  786. * except some embedded image types.
  787. *
  788. * You can change this behaviour:
  789. *
  790. * ```javascript
  791. * var md = require('markdown-it')();
  792. * // enable everything
  793. * md.validateLink = function () { return true; }
  794. * ```
  795. **/
  796. this.validateLink = validateLink;
  797. /**
  798. * MarkdownIt#normalizeLink(url) -> String
  799. *
  800. * Function used to encode link url to a machine-readable format,
  801. * which includes url-encoding, punycode, etc.
  802. **/
  803. this.normalizeLink = normalizeLink;
  804. /**
  805. * MarkdownIt#normalizeLinkText(url) -> String
  806. *
  807. * Function used to decode link url to a human-readable format`
  808. **/
  809. this.normalizeLinkText = normalizeLinkText;
  810. // Expose utils & helpers for easy acces from plugins
  811. /**
  812. * MarkdownIt#utils -> utils
  813. *
  814. * Assorted utility functions, useful to write plugins. See details
  815. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
  816. **/
  817. this.utils = utils;
  818. /**
  819. * MarkdownIt#helpers -> helpers
  820. *
  821. * Link components parser functions, useful to write plugins. See details
  822. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
  823. **/
  824. this.helpers = utils.assign({}, helpers);
  825. this.options = {};
  826. this.configure(presetName);
  827. if (options) { this.set(options); }
  828. }
  829. /** chainable
  830. * MarkdownIt.set(options)
  831. *
  832. * Set parser options (in the same format as in constructor). Probably, you
  833. * will never need it, but you can change options after constructor call.
  834. *
  835. * ##### Example
  836. *
  837. * ```javascript
  838. * var md = require('markdown-it')()
  839. * .set({ html: true, breaks: true })
  840. * .set({ typographer, true });
  841. * ```
  842. *
  843. * __Note:__ To achieve the best possible performance, don't modify a
  844. * `markdown-it` instance options on the fly. If you need multiple configurations
  845. * it's best to create multiple instances and initialize each with separate
  846. * config.
  847. **/
  848. MarkdownIt.prototype.set = function (options) {
  849. utils.assign(this.options, options);
  850. return this;
  851. };
  852. /** chainable, internal
  853. * MarkdownIt.configure(presets)
  854. *
  855. * Batch load of all options and compenent settings. This is internal method,
  856. * and you probably will not need it. But if you with - see available presets
  857. * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
  858. *
  859. * We strongly recommend to use presets instead of direct config loads. That
  860. * will give better compatibility with next versions.
  861. **/
  862. MarkdownIt.prototype.configure = function (presets) {
  863. var self = this, presetName;
  864. if (utils.isString(presets)) {
  865. presetName = presets;
  866. presets = config[presetName];
  867. if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
  868. }
  869. if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
  870. if (presets.options) { self.set(presets.options); }
  871. if (presets.components) {
  872. Object.keys(presets.components).forEach(function (name) {
  873. if (presets.components[name].rules) {
  874. self[name].ruler.enableOnly(presets.components[name].rules);
  875. }
  876. if (presets.components[name].rules2) {
  877. self[name].ruler2.enableOnly(presets.components[name].rules2);
  878. }
  879. });
  880. }
  881. return this;
  882. };
  883. /** chainable
  884. * MarkdownIt.enable(list, ignoreInvalid)
  885. * - list (String|Array): rule name or list of rule names to enable
  886. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  887. *
  888. * Enable list or rules. It will automatically find appropriate components,
  889. * containing rules with given names. If rule not found, and `ignoreInvalid`
  890. * not set - throws exception.
  891. *
  892. * ##### Example
  893. *
  894. * ```javascript
  895. * var md = require('markdown-it')()
  896. * .enable(['sub', 'sup'])
  897. * .disable('smartquotes');
  898. * ```
  899. **/
  900. MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
  901. var result = [];
  902. if (!Array.isArray(list)) { list = [ list ]; }
  903. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  904. result = result.concat(this[chain].ruler.enable(list, true));
  905. }, this);
  906. result = result.concat(this.inline.ruler2.enable(list, true));
  907. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  908. if (missed.length && !ignoreInvalid) {
  909. throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
  910. }
  911. return this;
  912. };
  913. /** chainable
  914. * MarkdownIt.disable(list, ignoreInvalid)
  915. * - list (String|Array): rule name or list of rule names to disable.
  916. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  917. *
  918. * The same as [[MarkdownIt.enable]], but turn specified rules off.
  919. **/
  920. MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
  921. var result = [];
  922. if (!Array.isArray(list)) { list = [ list ]; }
  923. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  924. result = result.concat(this[chain].ruler.disable(list, true));
  925. }, this);
  926. result = result.concat(this.inline.ruler2.disable(list, true));
  927. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  928. if (missed.length && !ignoreInvalid) {
  929. throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
  930. }
  931. return this;
  932. };
  933. /** chainable
  934. * MarkdownIt.use(plugin, params)
  935. *
  936. * Load specified plugin with given params into current parser instance.
  937. * It's just a sugar to call `plugin(md, params)` with curring.
  938. *
  939. * ##### Example
  940. *
  941. * ```javascript
  942. * var iterator = require('markdown-it-for-inline');
  943. * var md = require('markdown-it')()
  944. * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
  945. * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
  946. * });
  947. * ```
  948. **/
  949. MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
  950. var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
  951. plugin.apply(plugin, args);
  952. return this;
  953. };
  954. /** internal
  955. * MarkdownIt.parse(src, env) -> Array
  956. * - src (String): source string
  957. * - env (Object): environment sandbox
  958. *
  959. * Parse input string and returns list of block tokens (special token type
  960. * "inline" will contain list of inline tokens). You should not call this
  961. * method directly, until you write custom renderer (for example, to produce
  962. * AST).
  963. *
  964. * `env` is used to pass data between "distributed" rules and return additional
  965. * metadata like reference info, needed for the renderer. It also can be used to
  966. * inject data in specific cases. Usually, you will be ok to pass `{}`,
  967. * and then pass updated object to renderer.
  968. **/
  969. MarkdownIt.prototype.parse = function (src, env) {
  970. if (typeof src !== 'string') {
  971. throw new Error('Input data should be a String');
  972. }
  973. var state = new this.core.State(src, this, env);
  974. this.core.process(state);
  975. return state.tokens;
  976. };
  977. /**
  978. * MarkdownIt.render(src [, env]) -> String
  979. * - src (String): source string
  980. * - env (Object): environment sandbox
  981. *
  982. * Render markdown string into html. It does all magic for you :).
  983. *
  984. * `env` can be used to inject additional metadata (`{}` by default).
  985. * But you will not need it with high probability. See also comment
  986. * in [[MarkdownIt.parse]].
  987. **/
  988. MarkdownIt.prototype.render = function (src, env) {
  989. env = env || {};
  990. return this.renderer.render(this.parse(src, env), this.options, env);
  991. };
  992. /** internal
  993. * MarkdownIt.parseInline(src, env) -> Array
  994. * - src (String): source string
  995. * - env (Object): environment sandbox
  996. *
  997. * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
  998. * block tokens list with the single `inline` element, containing parsed inline
  999. * tokens in `children` property. Also updates `env` object.
  1000. **/
  1001. MarkdownIt.prototype.parseInline = function (src, env) {
  1002. var state = new this.core.State(src, this, env);
  1003. state.inlineMode = true;
  1004. this.core.process(state);
  1005. return state.tokens;
  1006. };
  1007. /**
  1008. * MarkdownIt.renderInline(src [, env]) -> String
  1009. * - src (String): source string
  1010. * - env (Object): environment sandbox
  1011. *
  1012. * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
  1013. * will NOT be wrapped into `<p>` tags.
  1014. **/
  1015. MarkdownIt.prototype.renderInline = function (src, env) {
  1016. env = env || {};
  1017. return this.renderer.render(this.parseInline(src, env), this.options, env);
  1018. };
  1019. module.exports = MarkdownIt;
  1020. },{"./common/utils":4,"./helpers":5,"./parser_block":10,"./parser_core":11,"./parser_inline":12,"./presets/commonmark":13,"./presets/default":14,"./presets/zero":15,"./renderer":16,"linkify-it":53,"mdurl":58,"punycode":60}],10:[function(require,module,exports){
  1021. /** internal
  1022. * class ParserBlock
  1023. *
  1024. * Block-level tokenizer.
  1025. **/
  1026. 'use strict';
  1027. var Ruler = require('./ruler');
  1028. var _rules = [
  1029. // First 2 params - rule name & source. Secondary array - list of rules,
  1030. // which can be terminated by this one.
  1031. [ 'table', require('./rules_block/table'), [ 'paragraph', 'reference' ] ],
  1032. [ 'code', require('./rules_block/code') ],
  1033. [ 'fence', require('./rules_block/fence'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  1034. [ 'blockquote', require('./rules_block/blockquote'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  1035. [ 'hr', require('./rules_block/hr'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  1036. [ 'list', require('./rules_block/list'), [ 'paragraph', 'reference', 'blockquote' ] ],
  1037. [ 'reference', require('./rules_block/reference') ],
  1038. [ 'heading', require('./rules_block/heading'), [ 'paragraph', 'reference', 'blockquote' ] ],
  1039. [ 'lheading', require('./rules_block/lheading') ],
  1040. [ 'html_block', require('./rules_block/html_block'), [ 'paragraph', 'reference', 'blockquote' ] ],
  1041. [ 'paragraph', require('./rules_block/paragraph') ]
  1042. ];
  1043. /**
  1044. * new ParserBlock()
  1045. **/
  1046. function ParserBlock() {
  1047. /**
  1048. * ParserBlock#ruler -> Ruler
  1049. *
  1050. * [[Ruler]] instance. Keep configuration of block rules.
  1051. **/
  1052. this.ruler = new Ruler();
  1053. for (var i = 0; i < _rules.length; i++) {
  1054. this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
  1055. }
  1056. }
  1057. // Generate tokens for input range
  1058. //
  1059. ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
  1060. var ok, i,
  1061. rules = this.ruler.getRules(''),
  1062. len = rules.length,
  1063. line = startLine,
  1064. hasEmptyLines = false,
  1065. maxNesting = state.md.options.maxNesting;
  1066. while (line < endLine) {
  1067. state.line = line = state.skipEmptyLines(line);
  1068. if (line >= endLine) { break; }
  1069. // Termination condition for nested calls.
  1070. // Nested calls currently used for blockquotes & lists
  1071. if (state.sCount[line] < state.blkIndent) { break; }
  1072. // If nesting level exceeded - skip tail to the end. That's not ordinary
  1073. // situation and we should not care about content.
  1074. if (state.level >= maxNesting) {
  1075. state.line = endLine;
  1076. break;
  1077. }
  1078. // Try all possible rules.
  1079. // On success, rule should:
  1080. //
  1081. // - update `state.line`
  1082. // - update `state.tokens`
  1083. // - return true
  1084. for (i = 0; i < len; i++) {
  1085. ok = rules[i](state, line, endLine, false);
  1086. if (ok) { break; }
  1087. }
  1088. // set state.tight if we had an empty line before current tag
  1089. // i.e. latest empty line should not count
  1090. state.tight = !hasEmptyLines;
  1091. // paragraph might "eat" one newline after it in nested lists
  1092. if (state.isEmpty(state.line - 1)) {
  1093. hasEmptyLines = true;
  1094. }
  1095. line = state.line;
  1096. if (line < endLine && state.isEmpty(line)) {
  1097. hasEmptyLines = true;
  1098. line++;
  1099. state.line = line;
  1100. }
  1101. }
  1102. };
  1103. /**
  1104. * ParserBlock.parse(str, md, env, outTokens)
  1105. *
  1106. * Process input string and push block tokens into `outTokens`
  1107. **/
  1108. ParserBlock.prototype.parse = function (src, md, env, outTokens) {
  1109. var state;
  1110. if (!src) { return; }
  1111. state = new this.State(src, md, env, outTokens);
  1112. this.tokenize(state, state.line, state.lineMax);
  1113. };
  1114. ParserBlock.prototype.State = require('./rules_block/state_block');
  1115. module.exports = ParserBlock;
  1116. },{"./ruler":17,"./rules_block/blockquote":18,"./rules_block/code":19,"./rules_block/fence":20,"./rules_block/heading":21,"./rules_block/hr":22,"./rules_block/html_block":23,"./rules_block/lheading":24,"./rules_block/list":25,"./rules_block/paragraph":26,"./rules_block/reference":27,"./rules_block/state_block":28,"./rules_block/table":29}],11:[function(require,module,exports){
  1117. /** internal
  1118. * class Core
  1119. *
  1120. * Top-level rules executor. Glues block/inline parsers and does intermediate
  1121. * transformations.
  1122. **/
  1123. 'use strict';
  1124. var Ruler = require('./ruler');
  1125. var _rules = [
  1126. [ 'normalize', require('./rules_core/normalize') ],
  1127. [ 'block', require('./rules_core/block') ],
  1128. [ 'inline', require('./rules_core/inline') ],
  1129. [ 'linkify', require('./rules_core/linkify') ],
  1130. [ 'replacements', require('./rules_core/replacements') ],
  1131. [ 'smartquotes', require('./rules_core/smartquotes') ]
  1132. ];
  1133. /**
  1134. * new Core()
  1135. **/
  1136. function Core() {
  1137. /**
  1138. * Core#ruler -> Ruler
  1139. *
  1140. * [[Ruler]] instance. Keep configuration of core rules.
  1141. **/
  1142. this.ruler = new Ruler();
  1143. for (var i = 0; i < _rules.length; i++) {
  1144. this.ruler.push(_rules[i][0], _rules[i][1]);
  1145. }
  1146. }
  1147. /**
  1148. * Core.process(state)
  1149. *
  1150. * Executes core chain rules.
  1151. **/
  1152. Core.prototype.process = function (state) {
  1153. var i, l, rules;
  1154. rules = this.ruler.getRules('');
  1155. for (i = 0, l = rules.length; i < l; i++) {
  1156. rules[i](state);
  1157. }
  1158. };
  1159. Core.prototype.State = require('./rules_core/state_core');
  1160. module.exports = Core;
  1161. },{"./ruler":17,"./rules_core/block":30,"./rules_core/inline":31,"./rules_core/linkify":32,"./rules_core/normalize":33,"./rules_core/replacements":34,"./rules_core/smartquotes":35,"./rules_core/state_core":36}],12:[function(require,module,exports){
  1162. /** internal
  1163. * class ParserInline
  1164. *
  1165. * Tokenizes paragraph content.
  1166. **/
  1167. 'use strict';
  1168. var Ruler = require('./ruler');
  1169. ////////////////////////////////////////////////////////////////////////////////
  1170. // Parser rules
  1171. var _rules = [
  1172. [ 'text', require('./rules_inline/text') ],
  1173. [ 'newline', require('./rules_inline/newline') ],
  1174. [ 'escape', require('./rules_inline/escape') ],
  1175. [ 'backticks', require('./rules_inline/backticks') ],
  1176. [ 'strikethrough', require('./rules_inline/strikethrough').tokenize ],
  1177. [ 'emphasis', require('./rules_inline/emphasis').tokenize ],
  1178. [ 'link', require('./rules_inline/link') ],
  1179. [ 'image', require('./rules_inline/image') ],
  1180. [ 'autolink', require('./rules_inline/autolink') ],
  1181. [ 'html_inline', require('./rules_inline/html_inline') ],
  1182. [ 'entity', require('./rules_inline/entity') ]
  1183. ];
  1184. var _rules2 = [
  1185. [ 'balance_pairs', require('./rules_inline/balance_pairs') ],
  1186. [ 'strikethrough', require('./rules_inline/strikethrough').postProcess ],
  1187. [ 'emphasis', require('./rules_inline/emphasis').postProcess ],
  1188. [ 'text_collapse', require('./rules_inline/text_collapse') ]
  1189. ];
  1190. /**
  1191. * new ParserInline()
  1192. **/
  1193. function ParserInline() {
  1194. var i;
  1195. /**
  1196. * ParserInline#ruler -> Ruler
  1197. *
  1198. * [[Ruler]] instance. Keep configuration of inline rules.
  1199. **/
  1200. this.ruler = new Ruler();
  1201. for (i = 0; i < _rules.length; i++) {
  1202. this.ruler.push(_rules[i][0], _rules[i][1]);
  1203. }
  1204. /**
  1205. * ParserInline#ruler2 -> Ruler
  1206. *
  1207. * [[Ruler]] instance. Second ruler used for post-processing
  1208. * (e.g. in emphasis-like rules).
  1209. **/
  1210. this.ruler2 = new Ruler();
  1211. for (i = 0; i < _rules2.length; i++) {
  1212. this.ruler2.push(_rules2[i][0], _rules2[i][1]);
  1213. }
  1214. }
  1215. // Skip single token by running all rules in validation mode;
  1216. // returns `true` if any rule reported success
  1217. //
  1218. ParserInline.prototype.skipToken = function (state) {
  1219. var ok, i, pos = state.pos,
  1220. rules = this.ruler.getRules(''),
  1221. len = rules.length,
  1222. maxNesting = state.md.options.maxNesting,
  1223. cache = state.cache;
  1224. if (typeof cache[pos] !== 'undefined') {
  1225. state.pos = cache[pos];
  1226. return;
  1227. }
  1228. if (state.level < maxNesting) {
  1229. for (i = 0; i < len; i++) {
  1230. // Increment state.level and decrement it later to limit recursion.
  1231. // It's harmless to do here, because no tokens are created. But ideally,
  1232. // we'd need a separate private state variable for this purpose.
  1233. //
  1234. state.level++;
  1235. ok = rules[i](state, true);
  1236. state.level--;
  1237. if (ok) { break; }
  1238. }
  1239. } else {
  1240. // Too much nesting, just skip until the end of the paragraph.
  1241. //
  1242. // NOTE: this will cause links to behave incorrectly in the following case,
  1243. // when an amount of `[` is exactly equal to `maxNesting + 1`:
  1244. //
  1245. // [[[[[[[[[[[[[[[[[[[[[foo]()
  1246. //
  1247. // TODO: remove this workaround when CM standard will allow nested links
  1248. // (we can replace it by preventing links from being parsed in
  1249. // validation mode)
  1250. //
  1251. state.pos = state.posMax;
  1252. }
  1253. if (!ok) { state.pos++; }
  1254. cache[pos] = state.pos;
  1255. };
  1256. // Generate tokens for input range
  1257. //
  1258. ParserInline.prototype.tokenize = function (state) {
  1259. var ok, i,
  1260. rules = this.ruler.getRules(''),
  1261. len = rules.length,
  1262. end = state.posMax,
  1263. maxNesting = state.md.options.maxNesting;
  1264. while (state.pos < end) {
  1265. // Try all possible rules.
  1266. // On success, rule should:
  1267. //
  1268. // - update `state.pos`
  1269. // - update `state.tokens`
  1270. // - return true
  1271. if (state.level < maxNesting) {
  1272. for (i = 0; i < len; i++) {
  1273. ok = rules[i](state, false);
  1274. if (ok) { break; }
  1275. }
  1276. }
  1277. if (ok) {
  1278. if (state.pos >= end) { break; }
  1279. continue;
  1280. }
  1281. state.pending += state.src[state.pos++];
  1282. }
  1283. if (state.pending) {
  1284. state.pushPending();
  1285. }
  1286. };
  1287. /**
  1288. * ParserInline.parse(str, md, env, outTokens)
  1289. *
  1290. * Process input string and push inline tokens into `outTokens`
  1291. **/
  1292. ParserInline.prototype.parse = function (str, md, env, outTokens) {
  1293. var i, rules, len;
  1294. var state = new this.State(str, md, env, outTokens);
  1295. this.tokenize(state);
  1296. rules = this.ruler2.getRules('');
  1297. len = rules.length;
  1298. for (i = 0; i < len; i++) {
  1299. rules[i](state);
  1300. }
  1301. };
  1302. ParserInline.prototype.State = require('./rules_inline/state_inline');
  1303. module.exports = ParserInline;
  1304. },{"./ruler":17,"./rules_inline/autolink":37,"./rules_inline/backticks":38,"./rules_inline/balance_pairs":39,"./rules_inline/emphasis":40,"./rules_inline/entity":41,"./rules_inline/escape":42,"./rules_inline/html_inline":43,"./rules_inline/image":44,"./rules_inline/link":45,"./rules_inline/newline":46,"./rules_inline/state_inline":47,"./rules_inline/strikethrough":48,"./rules_inline/text":49,"./rules_inline/text_collapse":50}],13:[function(require,module,exports){
  1305. // Commonmark default options
  1306. 'use strict';
  1307. module.exports = {
  1308. options: {
  1309. html: true, // Enable HTML tags in source
  1310. xhtmlOut: true, // Use '/' to close single tags (<br />)
  1311. breaks: false, // Convert '\n' in paragraphs into <br>
  1312. langPrefix: 'language-', // CSS language prefix for fenced blocks
  1313. linkify: false, // autoconvert URL-like texts to links
  1314. // Enable some language-neutral replacements + quotes beautification
  1315. typographer: false,
  1316. // Double + single quotes replacement pairs, when typographer enabled,
  1317. // and smartquotes on. Could be either a String or an Array.
  1318. //
  1319. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  1320. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  1321. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  1322. // Highlighter function. Should return escaped HTML,
  1323. // or '' if the source string is not changed and should be escaped externaly.
  1324. // If result starts with <pre... internal wrapper is skipped.
  1325. //
  1326. // function (/*str, lang*/) { return ''; }
  1327. //
  1328. highlight: null,
  1329. maxNesting: 20 // Internal protection, recursion limit
  1330. },
  1331. components: {
  1332. core: {
  1333. rules: [
  1334. 'normalize',
  1335. 'block',
  1336. 'inline'
  1337. ]
  1338. },
  1339. block: {
  1340. rules: [
  1341. 'blockquote',
  1342. 'code',
  1343. 'fence',
  1344. 'heading',
  1345. 'hr',
  1346. 'html_block',
  1347. 'lheading',
  1348. 'list',
  1349. 'reference',
  1350. 'paragraph'
  1351. ]
  1352. },
  1353. inline: {
  1354. rules: [
  1355. 'autolink',
  1356. 'backticks',
  1357. 'emphasis',
  1358. 'entity',
  1359. 'escape',
  1360. 'html_inline',
  1361. 'image',
  1362. 'link',
  1363. 'newline',
  1364. 'text'
  1365. ],
  1366. rules2: [
  1367. 'balance_pairs',
  1368. 'emphasis',
  1369. 'text_collapse'
  1370. ]
  1371. }
  1372. }
  1373. };
  1374. },{}],14:[function(require,module,exports){
  1375. // markdown-it default options
  1376. 'use strict';
  1377. module.exports = {
  1378. options: {
  1379. html: false, // Enable HTML tags in source
  1380. xhtmlOut: false, // Use '/' to close single tags (<br />)
  1381. breaks: false, // Convert '\n' in paragraphs into <br>
  1382. langPrefix: 'language-', // CSS language prefix for fenced blocks
  1383. linkify: false, // autoconvert URL-like texts to links
  1384. // Enable some language-neutral replacements + quotes beautification
  1385. typographer: false,
  1386. // Double + single quotes replacement pairs, when typographer enabled,
  1387. // and smartquotes on. Could be either a String or an Array.
  1388. //
  1389. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  1390. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  1391. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  1392. // Highlighter function. Should return escaped HTML,
  1393. // or '' if the source string is not changed and should be escaped externaly.
  1394. // If result starts with <pre... internal wrapper is skipped.
  1395. //
  1396. // function (/*str, lang*/) { return ''; }
  1397. //
  1398. highlight: null,
  1399. maxNesting: 100 // Internal protection, recursion limit
  1400. },
  1401. components: {
  1402. core: {},
  1403. block: {},
  1404. inline: {}
  1405. }
  1406. };
  1407. },{}],15:[function(require,module,exports){
  1408. // "Zero" preset, with nothing enabled. Useful for manual configuring of simple
  1409. // modes. For example, to parse bold/italic only.
  1410. 'use strict';
  1411. module.exports = {
  1412. options: {
  1413. html: false, // Enable HTML tags in source
  1414. xhtmlOut: false, // Use '/' to close single tags (<br />)
  1415. breaks: false, // Convert '\n' in paragraphs into <br>
  1416. langPrefix: 'language-', // CSS language prefix for fenced blocks
  1417. linkify: false, // autoconvert URL-like texts to links
  1418. // Enable some language-neutral replacements + quotes beautification
  1419. typographer: false,
  1420. // Double + single quotes replacement pairs, when typographer enabled,
  1421. // and smartquotes on. Could be either a String or an Array.
  1422. //
  1423. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  1424. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  1425. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  1426. // Highlighter function. Should return escaped HTML,
  1427. // or '' if the source string is not changed and should be escaped externaly.
  1428. // If result starts with <pre... internal wrapper is skipped.
  1429. //
  1430. // function (/*str, lang*/) { return ''; }
  1431. //
  1432. highlight: null,
  1433. maxNesting: 20 // Internal protection, recursion limit
  1434. },
  1435. components: {
  1436. core: {
  1437. rules: [
  1438. 'normalize',
  1439. 'block',
  1440. 'inline'
  1441. ]
  1442. },
  1443. block: {
  1444. rules: [
  1445. 'paragraph'
  1446. ]
  1447. },
  1448. inline: {
  1449. rules: [
  1450. 'text'
  1451. ],
  1452. rules2: [
  1453. 'balance_pairs',
  1454. 'text_collapse'
  1455. ]
  1456. }
  1457. }
  1458. };
  1459. },{}],16:[function(require,module,exports){
  1460. /**
  1461. * class Renderer
  1462. *
  1463. * Generates HTML from parsed token stream. Each instance has independent
  1464. * copy of rules. Those can be rewritten with ease. Also, you can add new
  1465. * rules if you create plugin and adds new token types.
  1466. **/
  1467. 'use strict';
  1468. var assign = require('./common/utils').assign;
  1469. var unescapeAll = require('./common/utils').unescapeAll;
  1470. var escapeHtml = require('./common/utils').escapeHtml;
  1471. ////////////////////////////////////////////////////////////////////////////////
  1472. var default_rules = {};
  1473. default_rules.code_inline = function (tokens, idx, options, env, slf) {
  1474. var token = tokens[idx];
  1475. return '<code' + slf.renderAttrs(token) + '>' +
  1476. escapeHtml(tokens[idx].content) +
  1477. '</code>';
  1478. };
  1479. default_rules.code_block = function (tokens, idx, options, env, slf) {
  1480. var token = tokens[idx];
  1481. return '<pre' + slf.renderAttrs(token) + '><code>' +
  1482. escapeHtml(tokens[idx].content) +
  1483. '</code></pre>\n';
  1484. };
  1485. default_rules.fence = function (tokens, idx, options, env, slf) {
  1486. var token = tokens[idx],
  1487. info = token.info ? unescapeAll(token.info).trim() : '',
  1488. langName = '',
  1489. highlighted, i, tmpAttrs, tmpToken;
  1490. if (info) {
  1491. langName = info.split(/\s+/g)[0];
  1492. }
  1493. if (options.highlight) {
  1494. highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
  1495. } else {
  1496. highlighted = escapeHtml(token.content);
  1497. }
  1498. if (highlighted.indexOf('<pre') === 0) {
  1499. return highlighted + '\n';
  1500. }
  1501. // If language exists, inject class gently, without modifying original token.
  1502. // May be, one day we will add .clone() for token and simplify this part, but
  1503. // now we prefer to keep things local.
  1504. if (info) {
  1505. i = token.attrIndex('class');
  1506. tmpAttrs = token.attrs ? token.attrs.slice() : [];
  1507. if (i < 0) {
  1508. tmpAttrs.push([ 'class', options.langPrefix + langName ]);
  1509. } else {
  1510. tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
  1511. }
  1512. // Fake token just to render attributes
  1513. tmpToken = {
  1514. attrs: tmpAttrs
  1515. };
  1516. return '<pre><code' + slf.renderAttrs(tmpToken) + '>'
  1517. + highlighted
  1518. + '</code></pre>\n';
  1519. }
  1520. return '<pre><code' + slf.renderAttrs(token) + '>'
  1521. + highlighted
  1522. + '</code></pre>\n';
  1523. };
  1524. default_rules.image = function (tokens, idx, options, env, slf) {
  1525. var token = tokens[idx];
  1526. // "alt" attr MUST be set, even if empty. Because it's mandatory and
  1527. // should be placed on proper position for tests.
  1528. //
  1529. // Replace content with actual value
  1530. token.attrs[token.attrIndex('alt')][1] =
  1531. slf.renderInlineAsText(token.children, options, env);
  1532. return slf.renderToken(tokens, idx, options);
  1533. };
  1534. default_rules.hardbreak = function (tokens, idx, options /*, env */) {
  1535. return options.xhtmlOut ? '<br />\n' : '<br>\n';
  1536. };
  1537. default_rules.softbreak = function (tokens, idx, options /*, env */) {
  1538. return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
  1539. };
  1540. default_rules.text = function (tokens, idx /*, options, env */) {
  1541. return escapeHtml(tokens[idx].content);
  1542. };
  1543. default_rules.html_block = function (tokens, idx /*, options, env */) {
  1544. return tokens[idx].content;
  1545. };
  1546. default_rules.html_inline = function (tokens, idx /*, options, env */) {
  1547. return tokens[idx].content;
  1548. };
  1549. /**
  1550. * new Renderer()
  1551. *
  1552. * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
  1553. **/
  1554. function Renderer() {
  1555. /**
  1556. * Renderer#rules -> Object
  1557. *
  1558. * Contains render rules for tokens. Can be updated and extended.
  1559. *
  1560. * ##### Example
  1561. *
  1562. * ```javascript
  1563. * var md = require('markdown-it')();
  1564. *
  1565. * md.renderer.rules.strong_open = function () { return '<b>'; };
  1566. * md.renderer.rules.strong_close = function () { return '</b>'; };
  1567. *
  1568. * var result = md.renderInline(...);
  1569. * ```
  1570. *
  1571. * Each rule is called as independent static function with fixed signature:
  1572. *
  1573. * ```javascript
  1574. * function my_token_render(tokens, idx, options, env, renderer) {
  1575. * // ...
  1576. * return renderedHTML;
  1577. * }
  1578. * ```
  1579. *
  1580. * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
  1581. * for more details and examples.
  1582. **/
  1583. this.rules = assign({}, default_rules);
  1584. }
  1585. /**
  1586. * Renderer.renderAttrs(token) -> String
  1587. *
  1588. * Render token attributes to string.
  1589. **/
  1590. Renderer.prototype.renderAttrs = function renderAttrs(token) {
  1591. var i, l, result;
  1592. if (!token.attrs) { return ''; }
  1593. result = '';
  1594. for (i = 0, l = token.attrs.length; i < l; i++) {
  1595. result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
  1596. }
  1597. return result;
  1598. };
  1599. /**
  1600. * Renderer.renderToken(tokens, idx, options) -> String
  1601. * - tokens (Array): list of tokens
  1602. * - idx (Numbed): token index to render
  1603. * - options (Object): params of parser instance
  1604. *
  1605. * Default token renderer. Can be overriden by custom function
  1606. * in [[Renderer#rules]].
  1607. **/
  1608. Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
  1609. var nextToken,
  1610. result = '',
  1611. needLf = false,
  1612. token = tokens[idx];
  1613. // Tight list paragraphs
  1614. if (token.hidden) {
  1615. return '';
  1616. }
  1617. // Insert a newline between hidden paragraph and subsequent opening
  1618. // block-level tag.
  1619. //
  1620. // For example, here we should insert a newline before blockquote:
  1621. // - a
  1622. // >
  1623. //
  1624. if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
  1625. result += '\n';
  1626. }
  1627. // Add token name, e.g. `<img`
  1628. result += (token.nesting === -1 ? '</' : '<') + token.tag;
  1629. // Encode attributes, e.g. `<img src="foo"`
  1630. result += this.renderAttrs(token);
  1631. // Add a slash for self-closing tags, e.g. `<img src="foo" /`
  1632. if (token.nesting === 0 && options.xhtmlOut) {
  1633. result += ' /';
  1634. }
  1635. // Check if we need to add a newline after this tag
  1636. if (token.block) {
  1637. needLf = true;
  1638. if (token.nesting === 1) {
  1639. if (idx + 1 < tokens.length) {
  1640. nextToken = tokens[idx + 1];
  1641. if (nextToken.type === 'inline' || nextToken.hidden) {
  1642. // Block-level tag containing an inline tag.
  1643. //
  1644. needLf = false;
  1645. } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
  1646. // Opening tag + closing tag of the same type. E.g. `<li></li>`.
  1647. //
  1648. needLf = false;
  1649. }
  1650. }
  1651. }
  1652. }
  1653. result += needLf ? '>\n' : '>';
  1654. return result;
  1655. };
  1656. /**
  1657. * Renderer.renderInline(tokens, options, env) -> String
  1658. * - tokens (Array): list on block tokens to renter
  1659. * - options (Object): params of parser instance
  1660. * - env (Object): additional data from parsed input (references, for example)
  1661. *
  1662. * The same as [[Renderer.render]], but for single token of `inline` type.
  1663. **/
  1664. Renderer.prototype.renderInline = function (tokens, options, env) {
  1665. var type,
  1666. result = '',
  1667. rules = this.rules;
  1668. for (var i = 0, len = tokens.length; i < len; i++) {
  1669. type = tokens[i].type;
  1670. if (typeof rules[type] !== 'undefined') {
  1671. result += rules[type](tokens, i, options, env, this);
  1672. } else {
  1673. result += this.renderToken(tokens, i, options);
  1674. }
  1675. }
  1676. return result;
  1677. };
  1678. /** internal
  1679. * Renderer.renderInlineAsText(tokens, options, env) -> String
  1680. * - tokens (Array): list on block tokens to renter
  1681. * - options (Object): params of parser instance
  1682. * - env (Object): additional data from parsed input (references, for example)
  1683. *
  1684. * Special kludge for image `alt` attributes to conform CommonMark spec.
  1685. * Don't try to use it! Spec requires to show `alt` content with stripped markup,
  1686. * instead of simple escaping.
  1687. **/
  1688. Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
  1689. var result = '';
  1690. for (var i = 0, len = tokens.length; i < len; i++) {
  1691. if (tokens[i].type === 'text') {
  1692. result += tokens[i].content;
  1693. } else if (tokens[i].type === 'image') {
  1694. result += this.renderInlineAsText(tokens[i].children, options, env);
  1695. }
  1696. }
  1697. return result;
  1698. };
  1699. /**
  1700. * Renderer.render(tokens, options, env) -> String
  1701. * - tokens (Array): list on block tokens to renter
  1702. * - options (Object): params of parser instance
  1703. * - env (Object): additional data from parsed input (references, for example)
  1704. *
  1705. * Takes token stream and generates HTML. Probably, you will never need to call
  1706. * this method directly.
  1707. **/
  1708. Renderer.prototype.render = function (tokens, options, env) {
  1709. var i, len, type,
  1710. result = '',
  1711. rules = this.rules;
  1712. for (i = 0, len = tokens.length; i < len; i++) {
  1713. type = tokens[i].type;
  1714. if (type === 'inline') {
  1715. result += this.renderInline(tokens[i].children, options, env);
  1716. } else if (typeof rules[type] !== 'undefined') {
  1717. result += rules[tokens[i].type](tokens, i, options, env, this);
  1718. } else {
  1719. result += this.renderToken(tokens, i, options, env);
  1720. }
  1721. }
  1722. return result;
  1723. };
  1724. module.exports = Renderer;
  1725. },{"./common/utils":4}],17:[function(require,module,exports){
  1726. /**
  1727. * class Ruler
  1728. *
  1729. * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
  1730. * [[MarkdownIt#inline]] to manage sequences of functions (rules):
  1731. *
  1732. * - keep rules in defined order
  1733. * - assign the name to each rule
  1734. * - enable/disable rules
  1735. * - add/replace rules
  1736. * - allow assign rules to additional named chains (in the same)
  1737. * - cacheing lists of active rules
  1738. *
  1739. * You will not need use this class directly until write plugins. For simple
  1740. * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
  1741. * [[MarkdownIt.use]].
  1742. **/
  1743. 'use strict';
  1744. /**
  1745. * new Ruler()
  1746. **/
  1747. function Ruler() {
  1748. // List of added rules. Each element is:
  1749. //
  1750. // {
  1751. // name: XXX,
  1752. // enabled: Boolean,
  1753. // fn: Function(),
  1754. // alt: [ name2, name3 ]
  1755. // }
  1756. //
  1757. this.__rules__ = [];
  1758. // Cached rule chains.
  1759. //
  1760. // First level - chain name, '' for default.
  1761. // Second level - diginal anchor for fast filtering by charcodes.
  1762. //
  1763. this.__cache__ = null;
  1764. }
  1765. ////////////////////////////////////////////////////////////////////////////////
  1766. // Helper methods, should not be used directly
  1767. // Find rule index by name
  1768. //
  1769. Ruler.prototype.__find__ = function (name) {
  1770. for (var i = 0; i < this.__rules__.length; i++) {
  1771. if (this.__rules__[i].name === name) {
  1772. return i;
  1773. }
  1774. }
  1775. return -1;
  1776. };
  1777. // Build rules lookup cache
  1778. //
  1779. Ruler.prototype.__compile__ = function () {
  1780. var self = this;
  1781. var chains = [ '' ];
  1782. // collect unique names
  1783. self.__rules__.forEach(function (rule) {
  1784. if (!rule.enabled) { return; }
  1785. rule.alt.forEach(function (altName) {
  1786. if (chains.indexOf(altName) < 0) {
  1787. chains.push(altName);
  1788. }
  1789. });
  1790. });
  1791. self.__cache__ = {};
  1792. chains.forEach(function (chain) {
  1793. self.__cache__[chain] = [];
  1794. self.__rules__.forEach(function (rule) {
  1795. if (!rule.enabled) { return; }
  1796. if (chain && rule.alt.indexOf(chain) < 0) { return; }
  1797. self.__cache__[chain].push(rule.fn);
  1798. });
  1799. });
  1800. };
  1801. /**
  1802. * Ruler.at(name, fn [, options])
  1803. * - name (String): rule name to replace.
  1804. * - fn (Function): new rule function.
  1805. * - options (Object): new rule options (not mandatory).
  1806. *
  1807. * Replace rule by name with new function & options. Throws error if name not
  1808. * found.
  1809. *
  1810. * ##### Options:
  1811. *
  1812. * - __alt__ - array with names of "alternate" chains.
  1813. *
  1814. * ##### Example
  1815. *
  1816. * Replace existing typographer replacement rule with new one:
  1817. *
  1818. * ```javascript
  1819. * var md = require('markdown-it')();
  1820. *
  1821. * md.core.ruler.at('replacements', function replace(state) {
  1822. * //...
  1823. * });
  1824. * ```
  1825. **/
  1826. Ruler.prototype.at = function (name, fn, options) {
  1827. var index = this.__find__(name);
  1828. var opt = options || {};
  1829. if (index === -1) { throw new Error('Parser rule not found: ' + name); }
  1830. this.__rules__[index].fn = fn;
  1831. this.__rules__[index].alt = opt.alt || [];
  1832. this.__cache__ = null;
  1833. };
  1834. /**
  1835. * Ruler.before(beforeName, ruleName, fn [, options])
  1836. * - beforeName (String): new rule will be added before this one.
  1837. * - ruleName (String): name of added rule.
  1838. * - fn (Function): rule function.
  1839. * - options (Object): rule options (not mandatory).
  1840. *
  1841. * Add new rule to chain before one with given name. See also
  1842. * [[Ruler.after]], [[Ruler.push]].
  1843. *
  1844. * ##### Options:
  1845. *
  1846. * - __alt__ - array with names of "alternate" chains.
  1847. *
  1848. * ##### Example
  1849. *
  1850. * ```javascript
  1851. * var md = require('markdown-it')();
  1852. *
  1853. * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
  1854. * //...
  1855. * });
  1856. * ```
  1857. **/
  1858. Ruler.prototype.before = function (beforeName, ruleName, fn, options) {
  1859. var index = this.__find__(beforeName);
  1860. var opt = options || {};
  1861. if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }
  1862. this.__rules__.splice(index, 0, {
  1863. name: ruleName,
  1864. enabled: true,
  1865. fn: fn,
  1866. alt: opt.alt || []
  1867. });
  1868. this.__cache__ = null;
  1869. };
  1870. /**
  1871. * Ruler.after(afterName, ruleName, fn [, options])
  1872. * - afterName (String): new rule will be added after this one.
  1873. * - ruleName (String): name of added rule.
  1874. * - fn (Function): rule function.
  1875. * - options (Object): rule options (not mandatory).
  1876. *
  1877. * Add new rule to chain after one with given name. See also
  1878. * [[Ruler.before]], [[Ruler.push]].
  1879. *
  1880. * ##### Options:
  1881. *
  1882. * - __alt__ - array with names of "alternate" chains.
  1883. *
  1884. * ##### Example
  1885. *
  1886. * ```javascript
  1887. * var md = require('markdown-it')();
  1888. *
  1889. * md.inline.ruler.after('text', 'my_rule', function replace(state) {
  1890. * //...
  1891. * });
  1892. * ```
  1893. **/
  1894. Ruler.prototype.after = function (afterName, ruleName, fn, options) {
  1895. var index = this.__find__(afterName);
  1896. var opt = options || {};
  1897. if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }
  1898. this.__rules__.splice(index + 1, 0, {
  1899. name: ruleName,
  1900. enabled: true,
  1901. fn: fn,
  1902. alt: opt.alt || []
  1903. });
  1904. this.__cache__ = null;
  1905. };
  1906. /**
  1907. * Ruler.push(ruleName, fn [, options])
  1908. * - ruleName (String): name of added rule.
  1909. * - fn (Function): rule function.
  1910. * - options (Object): rule options (not mandatory).
  1911. *
  1912. * Push new rule to the end of chain. See also
  1913. * [[Ruler.before]], [[Ruler.after]].
  1914. *
  1915. * ##### Options:
  1916. *
  1917. * - __alt__ - array with names of "alternate" chains.
  1918. *
  1919. * ##### Example
  1920. *
  1921. * ```javascript
  1922. * var md = require('markdown-it')();
  1923. *
  1924. * md.core.ruler.push('my_rule', function replace(state) {
  1925. * //...
  1926. * });
  1927. * ```
  1928. **/
  1929. Ruler.prototype.push = function (ruleName, fn, options) {
  1930. var opt = options || {};
  1931. this.__rules__.push({
  1932. name: ruleName,
  1933. enabled: true,
  1934. fn: fn,
  1935. alt: opt.alt || []
  1936. });
  1937. this.__cache__ = null;
  1938. };
  1939. /**
  1940. * Ruler.enable(list [, ignoreInvalid]) -> Array
  1941. * - list (String|Array): list of rule names to enable.
  1942. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1943. *
  1944. * Enable rules with given names. If any rule name not found - throw Error.
  1945. * Errors can be disabled by second param.
  1946. *
  1947. * Returns list of found rule names (if no exception happened).
  1948. *
  1949. * See also [[Ruler.disable]], [[Ruler.enableOnly]].
  1950. **/
  1951. Ruler.prototype.enable = function (list, ignoreInvalid) {
  1952. if (!Array.isArray(list)) { list = [ list ]; }
  1953. var result = [];
  1954. // Search by name and enable
  1955. list.forEach(function (name) {
  1956. var idx = this.__find__(name);
  1957. if (idx < 0) {
  1958. if (ignoreInvalid) { return; }
  1959. throw new Error('Rules manager: invalid rule name ' + name);
  1960. }
  1961. this.__rules__[idx].enabled = true;
  1962. result.push(name);
  1963. }, this);
  1964. this.__cache__ = null;
  1965. return result;
  1966. };
  1967. /**
  1968. * Ruler.enableOnly(list [, ignoreInvalid])
  1969. * - list (String|Array): list of rule names to enable (whitelist).
  1970. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1971. *
  1972. * Enable rules with given names, and disable everything else. If any rule name
  1973. * not found - throw Error. Errors can be disabled by second param.
  1974. *
  1975. * See also [[Ruler.disable]], [[Ruler.enable]].
  1976. **/
  1977. Ruler.prototype.enableOnly = function (list, ignoreInvalid) {
  1978. if (!Array.isArray(list)) { list = [ list ]; }
  1979. this.__rules__.forEach(function (rule) { rule.enabled = false; });
  1980. this.enable(list, ignoreInvalid);
  1981. };
  1982. /**
  1983. * Ruler.disable(list [, ignoreInvalid]) -> Array
  1984. * - list (String|Array): list of rule names to disable.
  1985. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1986. *
  1987. * Disable rules with given names. If any rule name not found - throw Error.
  1988. * Errors can be disabled by second param.
  1989. *
  1990. * Returns list of found rule names (if no exception happened).
  1991. *
  1992. * See also [[Ruler.enable]], [[Ruler.enableOnly]].
  1993. **/
  1994. Ruler.prototype.disable = function (list, ignoreInvalid) {
  1995. if (!Array.isArray(list)) { list = [ list ]; }
  1996. var result = [];
  1997. // Search by name and disable
  1998. list.forEach(function (name) {
  1999. var idx = this.__find__(name);
  2000. if (idx < 0) {
  2001. if (ignoreInvalid) { return; }
  2002. throw new Error('Rules manager: invalid rule name ' + name);
  2003. }
  2004. this.__rules__[idx].enabled = false;
  2005. result.push(name);
  2006. }, this);
  2007. this.__cache__ = null;
  2008. return result;
  2009. };
  2010. /**
  2011. * Ruler.getRules(chainName) -> Array
  2012. *
  2013. * Return array of active functions (rules) for given chain name. It analyzes
  2014. * rules configuration, compiles caches if not exists and returns result.
  2015. *
  2016. * Default chain name is `''` (empty string). It can't be skipped. That's
  2017. * done intentionally, to keep signature monomorphic for high speed.
  2018. **/
  2019. Ruler.prototype.getRules = function (chainName) {
  2020. if (this.__cache__ === null) {
  2021. this.__compile__();
  2022. }
  2023. // Chain can be empty, if rules disabled. But we still have to return Array.
  2024. return this.__cache__[chainName] || [];
  2025. };
  2026. module.exports = Ruler;
  2027. },{}],18:[function(require,module,exports){
  2028. // Block quotes
  2029. 'use strict';
  2030. var isSpace = require('../common/utils').isSpace;
  2031. module.exports = function blockquote(state, startLine, endLine, silent) {
  2032. var adjustTab,
  2033. ch,
  2034. i,
  2035. initial,
  2036. l,
  2037. lastLineEmpty,
  2038. lines,
  2039. nextLine,
  2040. offset,
  2041. oldBMarks,
  2042. oldBSCount,
  2043. oldIndent,
  2044. oldParentType,
  2045. oldSCount,
  2046. oldTShift,
  2047. spaceAfterMarker,
  2048. terminate,
  2049. terminatorRules,
  2050. token,
  2051. wasOutdented,
  2052. oldLineMax = state.lineMax,
  2053. pos = state.bMarks[startLine] + state.tShift[startLine],
  2054. max = state.eMarks[startLine];
  2055. // if it's indented more than 3 spaces, it should be a code block
  2056. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  2057. // check the block quote marker
  2058. if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
  2059. // we know that it's going to be a valid blockquote,
  2060. // so no point trying to find the end of it in silent mode
  2061. if (silent) { return true; }
  2062. // skip spaces after ">" and re-calculate offset
  2063. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  2064. // skip one optional space after '>'
  2065. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  2066. // ' > test '
  2067. // ^ -- position start of line here:
  2068. pos++;
  2069. initial++;
  2070. offset++;
  2071. adjustTab = false;
  2072. spaceAfterMarker = true;
  2073. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  2074. spaceAfterMarker = true;
  2075. if ((state.bsCount[startLine] + offset) % 4 === 3) {
  2076. // ' >\t test '
  2077. // ^ -- position start of line here (tab has width===1)
  2078. pos++;
  2079. initial++;
  2080. offset++;
  2081. adjustTab = false;
  2082. } else {
  2083. // ' >\t test '
  2084. // ^ -- position start of line here + shift bsCount slightly
  2085. // to make extra space appear
  2086. adjustTab = true;
  2087. }
  2088. } else {
  2089. spaceAfterMarker = false;
  2090. }
  2091. oldBMarks = [ state.bMarks[startLine] ];
  2092. state.bMarks[startLine] = pos;
  2093. while (pos < max) {
  2094. ch = state.src.charCodeAt(pos);
  2095. if (isSpace(ch)) {
  2096. if (ch === 0x09) {
  2097. offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
  2098. } else {
  2099. offset++;
  2100. }
  2101. } else {
  2102. break;
  2103. }
  2104. pos++;
  2105. }
  2106. oldBSCount = [ state.bsCount[startLine] ];
  2107. state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
  2108. lastLineEmpty = pos >= max;
  2109. oldSCount = [ state.sCount[startLine] ];
  2110. state.sCount[startLine] = offset - initial;
  2111. oldTShift = [ state.tShift[startLine] ];
  2112. state.tShift[startLine] = pos - state.bMarks[startLine];
  2113. terminatorRules = state.md.block.ruler.getRules('blockquote');
  2114. oldParentType = state.parentType;
  2115. state.parentType = 'blockquote';
  2116. wasOutdented = false;
  2117. // Search the end of the block
  2118. //
  2119. // Block ends with either:
  2120. // 1. an empty line outside:
  2121. // ```
  2122. // > test
  2123. //
  2124. // ```
  2125. // 2. an empty line inside:
  2126. // ```
  2127. // >
  2128. // test
  2129. // ```
  2130. // 3. another tag:
  2131. // ```
  2132. // > test
  2133. // - - -
  2134. // ```
  2135. for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
  2136. // check if it's outdented, i.e. it's inside list item and indented
  2137. // less than said list item:
  2138. //
  2139. // ```
  2140. // 1. anything
  2141. // > current blockquote
  2142. // 2. checking this line
  2143. // ```
  2144. if (state.sCount[nextLine] < state.blkIndent) wasOutdented = true;
  2145. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  2146. max = state.eMarks[nextLine];
  2147. if (pos >= max) {
  2148. // Case 1: line is not inside the blockquote, and this line is empty.
  2149. break;
  2150. }
  2151. if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !wasOutdented) {
  2152. // This line is inside the blockquote.
  2153. // skip spaces after ">" and re-calculate offset
  2154. initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
  2155. // skip one optional space after '>'
  2156. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  2157. // ' > test '
  2158. // ^ -- position start of line here:
  2159. pos++;
  2160. initial++;
  2161. offset++;
  2162. adjustTab = false;
  2163. spaceAfterMarker = true;
  2164. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  2165. spaceAfterMarker = true;
  2166. if ((state.bsCount[nextLine] + offset) % 4 === 3) {
  2167. // ' >\t test '
  2168. // ^ -- position start of line here (tab has width===1)
  2169. pos++;
  2170. initial++;
  2171. offset++;
  2172. adjustTab = false;
  2173. } else {
  2174. // ' >\t test '
  2175. // ^ -- position start of line here + shift bsCount slightly
  2176. // to make extra space appear
  2177. adjustTab = true;
  2178. }
  2179. } else {
  2180. spaceAfterMarker = false;
  2181. }
  2182. oldBMarks.push(state.bMarks[nextLine]);
  2183. state.bMarks[nextLine] = pos;
  2184. while (pos < max) {
  2185. ch = state.src.charCodeAt(pos);
  2186. if (isSpace(ch)) {
  2187. if (ch === 0x09) {
  2188. offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
  2189. } else {
  2190. offset++;
  2191. }
  2192. } else {
  2193. break;
  2194. }
  2195. pos++;
  2196. }
  2197. lastLineEmpty = pos >= max;
  2198. oldBSCount.push(state.bsCount[nextLine]);
  2199. state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
  2200. oldSCount.push(state.sCount[nextLine]);
  2201. state.sCount[nextLine] = offset - initial;
  2202. oldTShift.push(state.tShift[nextLine]);
  2203. state.tShift[nextLine] = pos - state.bMarks[nextLine];
  2204. continue;
  2205. }
  2206. // Case 2: line is not inside the blockquote, and the last line was empty.
  2207. if (lastLineEmpty) { break; }
  2208. // Case 3: another tag found.
  2209. terminate = false;
  2210. for (i = 0, l = terminatorRules.length; i < l; i++) {
  2211. if (terminatorRules[i](state, nextLine, endLine, true)) {
  2212. terminate = true;
  2213. break;
  2214. }
  2215. }
  2216. if (terminate) {
  2217. // Quirk to enforce "hard termination mode" for paragraphs;
  2218. // normally if you call `tokenize(state, startLine, nextLine)`,
  2219. // paragraphs will look below nextLine for paragraph continuation,
  2220. // but if blockquote is terminated by another tag, they shouldn't
  2221. state.lineMax = nextLine;
  2222. if (state.blkIndent !== 0) {
  2223. // state.blkIndent was non-zero, we now set it to zero,
  2224. // so we need to re-calculate all offsets to appear as
  2225. // if indent wasn't changed
  2226. oldBMarks.push(state.bMarks[nextLine]);
  2227. oldBSCount.push(state.bsCount[nextLine]);
  2228. oldTShift.push(state.tShift[nextLine]);
  2229. oldSCount.push(state.sCount[nextLine]);
  2230. state.sCount[nextLine] -= state.blkIndent;
  2231. }
  2232. break;
  2233. }
  2234. oldBMarks.push(state.bMarks[nextLine]);
  2235. oldBSCount.push(state.bsCount[nextLine]);
  2236. oldTShift.push(state.tShift[nextLine]);
  2237. oldSCount.push(state.sCount[nextLine]);
  2238. // A negative indentation means that this is a paragraph continuation
  2239. //
  2240. state.sCount[nextLine] = -1;
  2241. }
  2242. oldIndent = state.blkIndent;
  2243. state.blkIndent = 0;
  2244. token = state.push('blockquote_open', 'blockquote', 1);
  2245. token.markup = '>';
  2246. token.map = lines = [ startLine, 0 ];
  2247. state.md.block.tokenize(state, startLine, nextLine);
  2248. token = state.push('blockquote_close', 'blockquote', -1);
  2249. token.markup = '>';
  2250. state.lineMax = oldLineMax;
  2251. state.parentType = oldParentType;
  2252. lines[1] = state.line;
  2253. // Restore original tShift; this might not be necessary since the parser
  2254. // has already been here, but just to make sure we can do that.
  2255. for (i = 0; i < oldTShift.length; i++) {
  2256. state.bMarks[i + startLine] = oldBMarks[i];
  2257. state.tShift[i + startLine] = oldTShift[i];
  2258. state.sCount[i + startLine] = oldSCount[i];
  2259. state.bsCount[i + startLine] = oldBSCount[i];
  2260. }
  2261. state.blkIndent = oldIndent;
  2262. return true;
  2263. };
  2264. },{"../common/utils":4}],19:[function(require,module,exports){
  2265. // Code block (4 spaces padded)
  2266. 'use strict';
  2267. module.exports = function code(state, startLine, endLine/*, silent*/) {
  2268. var nextLine, last, token;
  2269. if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
  2270. last = nextLine = startLine + 1;
  2271. while (nextLine < endLine) {
  2272. if (state.isEmpty(nextLine)) {
  2273. nextLine++;
  2274. continue;
  2275. }
  2276. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  2277. nextLine++;
  2278. last = nextLine;
  2279. continue;
  2280. }
  2281. break;
  2282. }
  2283. state.line = last;
  2284. token = state.push('code_block', 'code', 0);
  2285. token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
  2286. token.map = [ startLine, state.line ];
  2287. return true;
  2288. };
  2289. },{}],20:[function(require,module,exports){
  2290. // fences (``` lang, ~~~ lang)
  2291. 'use strict';
  2292. module.exports = function fence(state, startLine, endLine, silent) {
  2293. var marker, len, params, nextLine, mem, token, markup,
  2294. haveEndMarker = false,
  2295. pos = state.bMarks[startLine] + state.tShift[startLine],
  2296. max = state.eMarks[startLine];
  2297. // if it's indented more than 3 spaces, it should be a code block
  2298. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  2299. if (pos + 3 > max) { return false; }
  2300. marker = state.src.charCodeAt(pos);
  2301. if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
  2302. return false;
  2303. }
  2304. // scan marker length
  2305. mem = pos;
  2306. pos = state.skipChars(pos, marker);
  2307. len = pos - mem;
  2308. if (len < 3) { return false; }
  2309. markup = state.src.slice(mem, pos);
  2310. params = state.src.slice(pos, max);
  2311. if (marker === 0x60 /* ` */) {
  2312. if (params.indexOf(String.fromCharCode(marker)) >= 0) {
  2313. return false;
  2314. }
  2315. }
  2316. // Since start is found, we can report success here in validation mode
  2317. if (silent) { return true; }
  2318. // search end of block
  2319. nextLine = startLine;
  2320. for (;;) {
  2321. nextLine++;
  2322. if (nextLine >= endLine) {
  2323. // unclosed block should be autoclosed by end of document.
  2324. // also block seems to be autoclosed by end of parent
  2325. break;
  2326. }
  2327. pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
  2328. max = state.eMarks[nextLine];
  2329. if (pos < max && state.sCount[nextLine] < state.blkIndent) {
  2330. // non-empty line with negative indent should stop the list:
  2331. // - ```
  2332. // test
  2333. break;
  2334. }
  2335. if (state.src.charCodeAt(pos) !== marker) { continue; }
  2336. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  2337. // closing fence should be indented less than 4 spaces
  2338. continue;
  2339. }
  2340. pos = state.skipChars(pos, marker);
  2341. // closing code fence must be at least as long as the opening one
  2342. if (pos - mem < len) { continue; }
  2343. // make sure tail has spaces only
  2344. pos = state.skipSpaces(pos);
  2345. if (pos < max) { continue; }
  2346. haveEndMarker = true;
  2347. // found!
  2348. break;
  2349. }
  2350. // If a fence has heading spaces, they should be removed from its inner block
  2351. len = state.sCount[startLine];
  2352. state.line = nextLine + (haveEndMarker ? 1 : 0);
  2353. token = state.push('fence', 'code', 0);
  2354. token.info = params;
  2355. token.content = state.getLines(startLine + 1, nextLine, len, true);
  2356. token.markup = markup;
  2357. token.map = [ startLine, state.line ];
  2358. return true;
  2359. };
  2360. },{}],21:[function(require,module,exports){
  2361. // heading (#, ##, ...)
  2362. 'use strict';
  2363. var isSpace = require('../common/utils').isSpace;
  2364. module.exports = function heading(state, startLine, endLine, silent) {
  2365. var ch, level, tmp, token,
  2366. pos = state.bMarks[startLine] + state.tShift[startLine],
  2367. max = state.eMarks[startLine];
  2368. // if it's indented more than 3 spaces, it should be a code block
  2369. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  2370. ch = state.src.charCodeAt(pos);
  2371. if (ch !== 0x23/* # */ || pos >= max) { return false; }
  2372. // count heading level
  2373. level = 1;
  2374. ch = state.src.charCodeAt(++pos);
  2375. while (ch === 0x23/* # */ && pos < max && level <= 6) {
  2376. level++;
  2377. ch = state.src.charCodeAt(++pos);
  2378. }
  2379. if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
  2380. if (silent) { return true; }
  2381. // Let's cut tails like ' ### ' from the end of string
  2382. max = state.skipSpacesBack(max, pos);
  2383. tmp = state.skipCharsBack(max, 0x23, pos); // #
  2384. if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
  2385. max = tmp;
  2386. }
  2387. state.line = startLine + 1;
  2388. token = state.push('heading_open', 'h' + String(level), 1);
  2389. token.markup = '########'.slice(0, level);
  2390. token.map = [ startLine, state.line ];
  2391. token = state.push('inline', '', 0);
  2392. token.content = state.src.slice(pos, max).trim();
  2393. token.map = [ startLine, state.line ];
  2394. token.children = [];
  2395. token = state.push('heading_close', 'h' + String(level), -1);
  2396. token.markup = '########'.slice(0, level);
  2397. return true;
  2398. };
  2399. },{"../common/utils":4}],22:[function(require,module,exports){
  2400. // Horizontal rule
  2401. 'use strict';
  2402. var isSpace = require('../common/utils').isSpace;
  2403. module.exports = function hr(state, startLine, endLine, silent) {
  2404. var marker, cnt, ch, token,
  2405. pos = state.bMarks[startLine] + state.tShift[startLine],
  2406. max = state.eMarks[startLine];
  2407. // if it's indented more than 3 spaces, it should be a code block
  2408. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  2409. marker = state.src.charCodeAt(pos++);
  2410. // Check hr marker
  2411. if (marker !== 0x2A/* * */ &&
  2412. marker !== 0x2D/* - */ &&
  2413. marker !== 0x5F/* _ */) {
  2414. return false;
  2415. }
  2416. // markers can be mixed with spaces, but there should be at least 3 of them
  2417. cnt = 1;
  2418. while (pos < max) {
  2419. ch = state.src.charCodeAt(pos++);
  2420. if (ch !== marker && !isSpace(ch)) { return false; }
  2421. if (ch === marker) { cnt++; }
  2422. }
  2423. if (cnt < 3) { return false; }
  2424. if (silent) { return true; }
  2425. state.line = startLine + 1;
  2426. token = state.push('hr', 'hr', 0);
  2427. token.map = [ startLine, state.line ];
  2428. token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
  2429. return true;
  2430. };
  2431. },{"../common/utils":4}],23:[function(require,module,exports){
  2432. // HTML block
  2433. 'use strict';
  2434. var block_names = require('../common/html_blocks');
  2435. var HTML_OPEN_CLOSE_TAG_RE = require('../common/html_re').HTML_OPEN_CLOSE_TAG_RE;
  2436. // An array of opening and corresponding closing sequences for html tags,
  2437. // last argument defines whether it can terminate a paragraph or not
  2438. //
  2439. var HTML_SEQUENCES = [
  2440. [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
  2441. [ /^<!--/, /-->/, true ],
  2442. [ /^<\?/, /\?>/, true ],
  2443. [ /^<![A-Z]/, />/, true ],
  2444. [ /^<!\[CDATA\[/, /\]\]>/, true ],
  2445. [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
  2446. [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
  2447. ];
  2448. module.exports = function html_block(state, startLine, endLine, silent) {
  2449. var i, nextLine, token, lineText,
  2450. pos = state.bMarks[startLine] + state.tShift[startLine],
  2451. max = state.eMarks[startLine];
  2452. // if it's indented more than 3 spaces, it should be a code block
  2453. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  2454. if (!state.md.options.html) { return false; }
  2455. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  2456. lineText = state.src.slice(pos, max);
  2457. for (i = 0; i < HTML_SEQUENCES.length; i++) {
  2458. if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
  2459. }
  2460. if (i === HTML_SEQUENCES.length) { return false; }
  2461. if (silent) {
  2462. // true if this sequence can be a terminator, false otherwise
  2463. return HTML_SEQUENCES[i][2];
  2464. }
  2465. nextLine = startLine + 1;
  2466. // If we are here - we detected HTML block.
  2467. // Let's roll down till block end.
  2468. if (!HTML_SEQUENCES[i][1].test(lineText)) {
  2469. for (; nextLine < endLine; nextLine++) {
  2470. if (state.sCount[nextLine] < state.blkIndent) { break; }
  2471. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  2472. max = state.eMarks[nextLine];
  2473. lineText = state.src.slice(pos, max);
  2474. if (HTML_SEQUENCES[i][1].test(lineText)) {
  2475. if (lineText.length !== 0) { nextLine++; }
  2476. break;
  2477. }
  2478. }
  2479. }
  2480. state.line = nextLine;
  2481. token = state.push('html_block', '', 0);
  2482. token.map = [ startLine, nextLine ];
  2483. token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
  2484. return true;
  2485. };
  2486. },{"../common/html_blocks":2,"../common/html_re":3}],24:[function(require,module,exports){
  2487. // lheading (---, ===)
  2488. 'use strict';
  2489. module.exports = function lheading(state, startLine, endLine/*, silent*/) {
  2490. var content, terminate, i, l, token, pos, max, level, marker,
  2491. nextLine = startLine + 1, oldParentType,
  2492. terminatorRules = state.md.block.ruler.getRules('paragraph');
  2493. // if it's indented more than 3 spaces, it should be a code block
  2494. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  2495. oldParentType = state.parentType;
  2496. state.parentType = 'paragraph'; // use paragraph to match terminatorRules
  2497. // jump line-by-line until empty one or EOF
  2498. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  2499. // this would be a code block normally, but after paragraph
  2500. // it's considered a lazy continuation regardless of what's there
  2501. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  2502. //
  2503. // Check for underline in setext header
  2504. //
  2505. if (state.sCount[nextLine] >= state.blkIndent) {
  2506. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  2507. max = state.eMarks[nextLine];
  2508. if (pos < max) {
  2509. marker = state.src.charCodeAt(pos);
  2510. if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
  2511. pos = state.skipChars(pos, marker);
  2512. pos = state.skipSpaces(pos);
  2513. if (pos >= max) {
  2514. level = (marker === 0x3D/* = */ ? 1 : 2);
  2515. break;
  2516. }
  2517. }
  2518. }
  2519. }
  2520. // quirk for blockquotes, this line should already be checked by that rule
  2521. if (state.sCount[nextLine] < 0) { continue; }
  2522. // Some tags can terminate paragraph without empty line.
  2523. terminate = false;
  2524. for (i = 0, l = terminatorRules.length; i < l; i++) {
  2525. if (terminatorRules[i](state, nextLine, endLine, true)) {
  2526. terminate = true;
  2527. break;
  2528. }
  2529. }
  2530. if (terminate) { break; }
  2531. }
  2532. if (!level) {
  2533. // Didn't find valid underline
  2534. return false;
  2535. }
  2536. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  2537. state.line = nextLine + 1;
  2538. token = state.push('heading_open', 'h' + String(level), 1);
  2539. token.markup = String.fromCharCode(marker);
  2540. token.map = [ startLine, state.line ];
  2541. token = state.push('inline', '', 0);
  2542. token.content = content;
  2543. token.map = [ startLine, state.line - 1 ];
  2544. token.children = [];
  2545. token = state.push('heading_close', 'h' + String(level), -1);
  2546. token.markup = String.fromCharCode(marker);
  2547. state.parentType = oldParentType;
  2548. return true;
  2549. };
  2550. },{}],25:[function(require,module,exports){
  2551. // Lists
  2552. 'use strict';
  2553. var isSpace = require('../common/utils').isSpace;
  2554. // Search `[-+*][\n ]`, returns next pos after marker on success
  2555. // or -1 on fail.
  2556. function skipBulletListMarker(state, startLine) {
  2557. var marker, pos, max, ch;
  2558. pos = state.bMarks[startLine] + state.tShift[startLine];
  2559. max = state.eMarks[startLine];
  2560. marker = state.src.charCodeAt(pos++);
  2561. // Check bullet
  2562. if (marker !== 0x2A/* * */ &&
  2563. marker !== 0x2D/* - */ &&
  2564. marker !== 0x2B/* + */) {
  2565. return -1;
  2566. }
  2567. if (pos < max) {
  2568. ch = state.src.charCodeAt(pos);
  2569. if (!isSpace(ch)) {
  2570. // " -test " - is not a list item
  2571. return -1;
  2572. }
  2573. }
  2574. return pos;
  2575. }
  2576. // Search `\d+[.)][\n ]`, returns next pos after marker on success
  2577. // or -1 on fail.
  2578. function skipOrderedListMarker(state, startLine) {
  2579. var ch,
  2580. start = state.bMarks[startLine] + state.tShift[startLine],
  2581. pos = start,
  2582. max = state.eMarks[startLine];
  2583. // List marker should have at least 2 chars (digit + dot)
  2584. if (pos + 1 >= max) { return -1; }
  2585. ch = state.src.charCodeAt(pos++);
  2586. if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
  2587. for (;;) {
  2588. // EOL -> fail
  2589. if (pos >= max) { return -1; }
  2590. ch = state.src.charCodeAt(pos++);
  2591. if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
  2592. // List marker should have no more than 9 digits
  2593. // (prevents integer overflow in browsers)
  2594. if (pos - start >= 10) { return -1; }
  2595. continue;
  2596. }
  2597. // found valid marker
  2598. if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
  2599. break;
  2600. }
  2601. return -1;
  2602. }
  2603. if (pos < max) {
  2604. ch = state.src.charCodeAt(pos);
  2605. if (!isSpace(ch)) {
  2606. // " 1.test " - is not a list item
  2607. return -1;
  2608. }
  2609. }
  2610. return pos;
  2611. }
  2612. function markTightParagraphs(state, idx) {
  2613. var i, l,
  2614. level = state.level + 2;
  2615. for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
  2616. if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
  2617. state.tokens[i + 2].hidden = true;
  2618. state.tokens[i].hidden = true;
  2619. i += 2;
  2620. }
  2621. }
  2622. }
  2623. module.exports = function list(state, startLine, endLine, silent) {
  2624. var ch,
  2625. contentStart,
  2626. i,
  2627. indent,
  2628. indentAfterMarker,
  2629. initial,
  2630. isOrdered,
  2631. itemLines,
  2632. l,
  2633. listLines,
  2634. listTokIdx,
  2635. markerCharCode,
  2636. markerValue,
  2637. max,
  2638. nextLine,
  2639. offset,
  2640. oldListIndent,
  2641. oldParentType,
  2642. oldSCount,
  2643. oldTShift,
  2644. oldTight,
  2645. pos,
  2646. posAfterMarker,
  2647. prevEmptyEnd,
  2648. start,
  2649. terminate,
  2650. terminatorRules,
  2651. token,
  2652. isTerminatingParagraph = false,
  2653. tight = true;
  2654. // if it's indented more than 3 spaces, it should be a code block
  2655. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  2656. // Special case:
  2657. // - item 1
  2658. // - item 2
  2659. // - item 3
  2660. // - item 4
  2661. // - this one is a paragraph continuation
  2662. if (state.listIndent >= 0 &&
  2663. state.sCount[startLine] - state.listIndent >= 4 &&
  2664. state.sCount[startLine] < state.blkIndent) {
  2665. return false;
  2666. }
  2667. // limit conditions when list can interrupt
  2668. // a paragraph (validation mode only)
  2669. if (silent && state.parentType === 'paragraph') {
  2670. // Next list item should still terminate previous list item;
  2671. //
  2672. // This code can fail if plugins use blkIndent as well as lists,
  2673. // but I hope the spec gets fixed long before that happens.
  2674. //
  2675. if (state.tShift[startLine] >= state.blkIndent) {
  2676. isTerminatingParagraph = true;
  2677. }
  2678. }
  2679. // Detect list type and position after marker
  2680. if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
  2681. isOrdered = true;
  2682. start = state.bMarks[startLine] + state.tShift[startLine];
  2683. markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
  2684. // If we're starting a new ordered list right after
  2685. // a paragraph, it should start with 1.
  2686. if (isTerminatingParagraph && markerValue !== 1) return false;
  2687. } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
  2688. isOrdered = false;
  2689. } else {
  2690. return false;
  2691. }
  2692. // If we're starting a new unordered list right after
  2693. // a paragraph, first line should not be empty.
  2694. if (isTerminatingParagraph) {
  2695. if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
  2696. }
  2697. // We should terminate list on style change. Remember first one to compare.
  2698. markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
  2699. // For validation mode we can terminate immediately
  2700. if (silent) { return true; }
  2701. // Start list
  2702. listTokIdx = state.tokens.length;
  2703. if (isOrdered) {
  2704. token = state.push('ordered_list_open', 'ol', 1);
  2705. if (markerValue !== 1) {
  2706. token.attrs = [ [ 'start', markerValue ] ];
  2707. }
  2708. } else {
  2709. token = state.push('bullet_list_open', 'ul', 1);
  2710. }
  2711. token.map = listLines = [ startLine, 0 ];
  2712. token.markup = String.fromCharCode(markerCharCode);
  2713. //
  2714. // Iterate list items
  2715. //
  2716. nextLine = startLine;
  2717. prevEmptyEnd = false;
  2718. terminatorRules = state.md.block.ruler.getRules('list');
  2719. oldParentType = state.parentType;
  2720. state.parentType = 'list';
  2721. while (nextLine < endLine) {
  2722. pos = posAfterMarker;
  2723. max = state.eMarks[nextLine];
  2724. initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
  2725. while (pos < max) {
  2726. ch = state.src.charCodeAt(pos);
  2727. if (ch === 0x09) {
  2728. offset += 4 - (offset + state.bsCount[nextLine]) % 4;
  2729. } else if (ch === 0x20) {
  2730. offset++;
  2731. } else {
  2732. break;
  2733. }
  2734. pos++;
  2735. }
  2736. contentStart = pos;
  2737. if (contentStart >= max) {
  2738. // trimming space in "- \n 3" case, indent is 1 here
  2739. indentAfterMarker = 1;
  2740. } else {
  2741. indentAfterMarker = offset - initial;
  2742. }
  2743. // If we have more than 4 spaces, the indent is 1
  2744. // (the rest is just indented code block)
  2745. if (indentAfterMarker > 4) { indentAfterMarker = 1; }
  2746. // " - test"
  2747. // ^^^^^ - calculating total length of this thing
  2748. indent = initial + indentAfterMarker;
  2749. // Run subparser & write tokens
  2750. token = state.push('list_item_open', 'li', 1);
  2751. token.markup = String.fromCharCode(markerCharCode);
  2752. token.map = itemLines = [ startLine, 0 ];
  2753. // change current state, then restore it after parser subcall
  2754. oldTight = state.tight;
  2755. oldTShift = state.tShift[startLine];
  2756. oldSCount = state.sCount[startLine];
  2757. // - example list
  2758. // ^ listIndent position will be here
  2759. // ^ blkIndent position will be here
  2760. //
  2761. oldListIndent = state.listIndent;
  2762. state.listIndent = state.blkIndent;
  2763. state.blkIndent = indent;
  2764. state.tight = true;
  2765. state.tShift[startLine] = contentStart - state.bMarks[startLine];
  2766. state.sCount[startLine] = offset;
  2767. if (contentStart >= max && state.isEmpty(startLine + 1)) {
  2768. // workaround for this case
  2769. // (list item is empty, list terminates before "foo"):
  2770. // ~~~~~~~~
  2771. // -
  2772. //
  2773. // foo
  2774. // ~~~~~~~~
  2775. state.line = Math.min(state.line + 2, endLine);
  2776. } else {
  2777. state.md.block.tokenize(state, startLine, endLine, true);
  2778. }
  2779. // If any of list item is tight, mark list as tight
  2780. if (!state.tight || prevEmptyEnd) {
  2781. tight = false;
  2782. }
  2783. // Item become loose if finish with empty line,
  2784. // but we should filter last element, because it means list finish
  2785. prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
  2786. state.blkIndent = state.listIndent;
  2787. state.listIndent = oldListIndent;
  2788. state.tShift[startLine] = oldTShift;
  2789. state.sCount[startLine] = oldSCount;
  2790. state.tight = oldTight;
  2791. token = state.push('list_item_close', 'li', -1);
  2792. token.markup = String.fromCharCode(markerCharCode);
  2793. nextLine = startLine = state.line;
  2794. itemLines[1] = nextLine;
  2795. contentStart = state.bMarks[startLine];
  2796. if (nextLine >= endLine) { break; }
  2797. //
  2798. // Try to check if list is terminated or continued.
  2799. //
  2800. if (state.sCount[nextLine] < state.blkIndent) { break; }
  2801. // if it's indented more than 3 spaces, it should be a code block
  2802. if (state.sCount[startLine] - state.blkIndent >= 4) { break; }
  2803. // fail if terminating block found
  2804. terminate = false;
  2805. for (i = 0, l = terminatorRules.length; i < l; i++) {
  2806. if (terminatorRules[i](state, nextLine, endLine, true)) {
  2807. terminate = true;
  2808. break;
  2809. }
  2810. }
  2811. if (terminate) { break; }
  2812. // fail if list has another type
  2813. if (isOrdered) {
  2814. posAfterMarker = skipOrderedListMarker(state, nextLine);
  2815. if (posAfterMarker < 0) { break; }
  2816. } else {
  2817. posAfterMarker = skipBulletListMarker(state, nextLine);
  2818. if (posAfterMarker < 0) { break; }
  2819. }
  2820. if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
  2821. }
  2822. // Finalize list
  2823. if (isOrdered) {
  2824. token = state.push('ordered_list_close', 'ol', -1);
  2825. } else {
  2826. token = state.push('bullet_list_close', 'ul', -1);
  2827. }
  2828. token.markup = String.fromCharCode(markerCharCode);
  2829. listLines[1] = nextLine;
  2830. state.line = nextLine;
  2831. state.parentType = oldParentType;
  2832. // mark paragraphs tight if needed
  2833. if (tight) {
  2834. markTightParagraphs(state, listTokIdx);
  2835. }
  2836. return true;
  2837. };
  2838. },{"../common/utils":4}],26:[function(require,module,exports){
  2839. // Paragraph
  2840. 'use strict';
  2841. module.exports = function paragraph(state, startLine/*, endLine*/) {
  2842. var content, terminate, i, l, token, oldParentType,
  2843. nextLine = startLine + 1,
  2844. terminatorRules = state.md.block.ruler.getRules('paragraph'),
  2845. endLine = state.lineMax;
  2846. oldParentType = state.parentType;
  2847. state.parentType = 'paragraph';
  2848. // jump line-by-line until empty one or EOF
  2849. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  2850. // this would be a code block normally, but after paragraph
  2851. // it's considered a lazy continuation regardless of what's there
  2852. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  2853. // quirk for blockquotes, this line should already be checked by that rule
  2854. if (state.sCount[nextLine] < 0) { continue; }
  2855. // Some tags can terminate paragraph without empty line.
  2856. terminate = false;
  2857. for (i = 0, l = terminatorRules.length; i < l; i++) {
  2858. if (terminatorRules[i](state, nextLine, endLine, true)) {
  2859. terminate = true;
  2860. break;
  2861. }
  2862. }
  2863. if (terminate) { break; }
  2864. }
  2865. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  2866. state.line = nextLine;
  2867. token = state.push('paragraph_open', 'p', 1);
  2868. token.map = [ startLine, state.line ];
  2869. token = state.push('inline', '', 0);
  2870. token.content = content;
  2871. token.map = [ startLine, state.line ];
  2872. token.children = [];
  2873. token = state.push('paragraph_close', 'p', -1);
  2874. state.parentType = oldParentType;
  2875. return true;
  2876. };
  2877. },{}],27:[function(require,module,exports){
  2878. 'use strict';
  2879. var normalizeReference = require('../common/utils').normalizeReference;
  2880. var isSpace = require('../common/utils').isSpace;
  2881. module.exports = function reference(state, startLine, _endLine, silent) {
  2882. var ch,
  2883. destEndPos,
  2884. destEndLineNo,
  2885. endLine,
  2886. href,
  2887. i,
  2888. l,
  2889. label,
  2890. labelEnd,
  2891. oldParentType,
  2892. res,
  2893. start,
  2894. str,
  2895. terminate,
  2896. terminatorRules,
  2897. title,
  2898. lines = 0,
  2899. pos = state.bMarks[startLine] + state.tShift[startLine],
  2900. max = state.eMarks[startLine],
  2901. nextLine = startLine + 1;
  2902. // if it's indented more than 3 spaces, it should be a code block
  2903. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  2904. if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
  2905. // Simple check to quickly interrupt scan on [link](url) at the start of line.
  2906. // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
  2907. while (++pos < max) {
  2908. if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
  2909. state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
  2910. if (pos + 1 === max) { return false; }
  2911. if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
  2912. break;
  2913. }
  2914. }
  2915. endLine = state.lineMax;
  2916. // jump line-by-line until empty one or EOF
  2917. terminatorRules = state.md.block.ruler.getRules('reference');
  2918. oldParentType = state.parentType;
  2919. state.parentType = 'reference';
  2920. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  2921. // this would be a code block normally, but after paragraph
  2922. // it's considered a lazy continuation regardless of what's there
  2923. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  2924. // quirk for blockquotes, this line should already be checked by that rule
  2925. if (state.sCount[nextLine] < 0) { continue; }
  2926. // Some tags can terminate paragraph without empty line.
  2927. terminate = false;
  2928. for (i = 0, l = terminatorRules.length; i < l; i++) {
  2929. if (terminatorRules[i](state, nextLine, endLine, true)) {
  2930. terminate = true;
  2931. break;
  2932. }
  2933. }
  2934. if (terminate) { break; }
  2935. }
  2936. str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  2937. max = str.length;
  2938. for (pos = 1; pos < max; pos++) {
  2939. ch = str.charCodeAt(pos);
  2940. if (ch === 0x5B /* [ */) {
  2941. return false;
  2942. } else if (ch === 0x5D /* ] */) {
  2943. labelEnd = pos;
  2944. break;
  2945. } else if (ch === 0x0A /* \n */) {
  2946. lines++;
  2947. } else if (ch === 0x5C /* \ */) {
  2948. pos++;
  2949. if (pos < max && str.charCodeAt(pos) === 0x0A) {
  2950. lines++;
  2951. }
  2952. }
  2953. }
  2954. if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
  2955. // [label]: destination 'title'
  2956. // ^^^ skip optional whitespace here
  2957. for (pos = labelEnd + 2; pos < max; pos++) {
  2958. ch = str.charCodeAt(pos);
  2959. if (ch === 0x0A) {
  2960. lines++;
  2961. } else if (isSpace(ch)) {
  2962. /*eslint no-empty:0*/
  2963. } else {
  2964. break;
  2965. }
  2966. }
  2967. // [label]: destination 'title'
  2968. // ^^^^^^^^^^^ parse this
  2969. res = state.md.helpers.parseLinkDestination(str, pos, max);
  2970. if (!res.ok) { return false; }
  2971. href = state.md.normalizeLink(res.str);
  2972. if (!state.md.validateLink(href)) { return false; }
  2973. pos = res.pos;
  2974. lines += res.lines;
  2975. // save cursor state, we could require to rollback later
  2976. destEndPos = pos;
  2977. destEndLineNo = lines;
  2978. // [label]: destination 'title'
  2979. // ^^^ skipping those spaces
  2980. start = pos;
  2981. for (; pos < max; pos++) {
  2982. ch = str.charCodeAt(pos);
  2983. if (ch === 0x0A) {
  2984. lines++;
  2985. } else if (isSpace(ch)) {
  2986. /*eslint no-empty:0*/
  2987. } else {
  2988. break;
  2989. }
  2990. }
  2991. // [label]: destination 'title'
  2992. // ^^^^^^^ parse this
  2993. res = state.md.helpers.parseLinkTitle(str, pos, max);
  2994. if (pos < max && start !== pos && res.ok) {
  2995. title = res.str;
  2996. pos = res.pos;
  2997. lines += res.lines;
  2998. } else {
  2999. title = '';
  3000. pos = destEndPos;
  3001. lines = destEndLineNo;
  3002. }
  3003. // skip trailing spaces until the rest of the line
  3004. while (pos < max) {
  3005. ch = str.charCodeAt(pos);
  3006. if (!isSpace(ch)) { break; }
  3007. pos++;
  3008. }
  3009. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  3010. if (title) {
  3011. // garbage at the end of the line after title,
  3012. // but it could still be a valid reference if we roll back
  3013. title = '';
  3014. pos = destEndPos;
  3015. lines = destEndLineNo;
  3016. while (pos < max) {
  3017. ch = str.charCodeAt(pos);
  3018. if (!isSpace(ch)) { break; }
  3019. pos++;
  3020. }
  3021. }
  3022. }
  3023. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  3024. // garbage at the end of the line
  3025. return false;
  3026. }
  3027. label = normalizeReference(str.slice(1, labelEnd));
  3028. if (!label) {
  3029. // CommonMark 0.20 disallows empty labels
  3030. return false;
  3031. }
  3032. // Reference can not terminate anything. This check is for safety only.
  3033. /*istanbul ignore if*/
  3034. if (silent) { return true; }
  3035. if (typeof state.env.references === 'undefined') {
  3036. state.env.references = {};
  3037. }
  3038. if (typeof state.env.references[label] === 'undefined') {
  3039. state.env.references[label] = { title: title, href: href };
  3040. }
  3041. state.parentType = oldParentType;
  3042. state.line = startLine + lines + 1;
  3043. return true;
  3044. };
  3045. },{"../common/utils":4}],28:[function(require,module,exports){
  3046. // Parser state class
  3047. 'use strict';
  3048. var Token = require('../token');
  3049. var isSpace = require('../common/utils').isSpace;
  3050. function StateBlock(src, md, env, tokens) {
  3051. var ch, s, start, pos, len, indent, offset, indent_found;
  3052. this.src = src;
  3053. // link to parser instance
  3054. this.md = md;
  3055. this.env = env;
  3056. //
  3057. // Internal state vartiables
  3058. //
  3059. this.tokens = tokens;
  3060. this.bMarks = []; // line begin offsets for fast jumps
  3061. this.eMarks = []; // line end offsets for fast jumps
  3062. this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
  3063. this.sCount = []; // indents for each line (tabs expanded)
  3064. // An amount of virtual spaces (tabs expanded) between beginning
  3065. // of each line (bMarks) and real beginning of that line.
  3066. //
  3067. // It exists only as a hack because blockquotes override bMarks
  3068. // losing information in the process.
  3069. //
  3070. // It's used only when expanding tabs, you can think about it as
  3071. // an initial tab length, e.g. bsCount=21 applied to string `\t123`
  3072. // means first tab should be expanded to 4-21%4 === 3 spaces.
  3073. //
  3074. this.bsCount = [];
  3075. // block parser variables
  3076. this.blkIndent = 0; // required block content indent (for example, if we are
  3077. // inside a list, it would be positioned after list marker)
  3078. this.line = 0; // line index in src
  3079. this.lineMax = 0; // lines count
  3080. this.tight = false; // loose/tight mode for lists
  3081. this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
  3082. this.listIndent = -1; // indent of the current list block (-1 if there isn't any)
  3083. // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
  3084. // used in lists to determine if they interrupt a paragraph
  3085. this.parentType = 'root';
  3086. this.level = 0;
  3087. // renderer
  3088. this.result = '';
  3089. // Create caches
  3090. // Generate markers.
  3091. s = this.src;
  3092. indent_found = false;
  3093. for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
  3094. ch = s.charCodeAt(pos);
  3095. if (!indent_found) {
  3096. if (isSpace(ch)) {
  3097. indent++;
  3098. if (ch === 0x09) {
  3099. offset += 4 - offset % 4;
  3100. } else {
  3101. offset++;
  3102. }
  3103. continue;
  3104. } else {
  3105. indent_found = true;
  3106. }
  3107. }
  3108. if (ch === 0x0A || pos === len - 1) {
  3109. if (ch !== 0x0A) { pos++; }
  3110. this.bMarks.push(start);
  3111. this.eMarks.push(pos);
  3112. this.tShift.push(indent);
  3113. this.sCount.push(offset);
  3114. this.bsCount.push(0);
  3115. indent_found = false;
  3116. indent = 0;
  3117. offset = 0;
  3118. start = pos + 1;
  3119. }
  3120. }
  3121. // Push fake entry to simplify cache bounds checks
  3122. this.bMarks.push(s.length);
  3123. this.eMarks.push(s.length);
  3124. this.tShift.push(0);
  3125. this.sCount.push(0);
  3126. this.bsCount.push(0);
  3127. this.lineMax = this.bMarks.length - 1; // don't count last fake line
  3128. }
  3129. // Push new token to "stream".
  3130. //
  3131. StateBlock.prototype.push = function (type, tag, nesting) {
  3132. var token = new Token(type, tag, nesting);
  3133. token.block = true;
  3134. if (nesting < 0) this.level--; // closing tag
  3135. token.level = this.level;
  3136. if (nesting > 0) this.level++; // opening tag
  3137. this.tokens.push(token);
  3138. return token;
  3139. };
  3140. StateBlock.prototype.isEmpty = function isEmpty(line) {
  3141. return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
  3142. };
  3143. StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
  3144. for (var max = this.lineMax; from < max; from++) {
  3145. if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
  3146. break;
  3147. }
  3148. }
  3149. return from;
  3150. };
  3151. // Skip spaces from given position.
  3152. StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
  3153. var ch;
  3154. for (var max = this.src.length; pos < max; pos++) {
  3155. ch = this.src.charCodeAt(pos);
  3156. if (!isSpace(ch)) { break; }
  3157. }
  3158. return pos;
  3159. };
  3160. // Skip spaces from given position in reverse.
  3161. StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
  3162. if (pos <= min) { return pos; }
  3163. while (pos > min) {
  3164. if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
  3165. }
  3166. return pos;
  3167. };
  3168. // Skip char codes from given position
  3169. StateBlock.prototype.skipChars = function skipChars(pos, code) {
  3170. for (var max = this.src.length; pos < max; pos++) {
  3171. if (this.src.charCodeAt(pos) !== code) { break; }
  3172. }
  3173. return pos;
  3174. };
  3175. // Skip char codes reverse from given position - 1
  3176. StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
  3177. if (pos <= min) { return pos; }
  3178. while (pos > min) {
  3179. if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
  3180. }
  3181. return pos;
  3182. };
  3183. // cut lines range from source.
  3184. StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
  3185. var i, lineIndent, ch, first, last, queue, lineStart,
  3186. line = begin;
  3187. if (begin >= end) {
  3188. return '';
  3189. }
  3190. queue = new Array(end - begin);
  3191. for (i = 0; line < end; line++, i++) {
  3192. lineIndent = 0;
  3193. lineStart = first = this.bMarks[line];
  3194. if (line + 1 < end || keepLastLF) {
  3195. // No need for bounds check because we have fake entry on tail.
  3196. last = this.eMarks[line] + 1;
  3197. } else {
  3198. last = this.eMarks[line];
  3199. }
  3200. while (first < last && lineIndent < indent) {
  3201. ch = this.src.charCodeAt(first);
  3202. if (isSpace(ch)) {
  3203. if (ch === 0x09) {
  3204. lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
  3205. } else {
  3206. lineIndent++;
  3207. }
  3208. } else if (first - lineStart < this.tShift[line]) {
  3209. // patched tShift masked characters to look like spaces (blockquotes, list markers)
  3210. lineIndent++;
  3211. } else {
  3212. break;
  3213. }
  3214. first++;
  3215. }
  3216. if (lineIndent > indent) {
  3217. // partially expanding tabs in code blocks, e.g '\t\tfoobar'
  3218. // with indent=2 becomes ' \tfoobar'
  3219. queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
  3220. } else {
  3221. queue[i] = this.src.slice(first, last);
  3222. }
  3223. }
  3224. return queue.join('');
  3225. };
  3226. // re-export Token class to use in block rules
  3227. StateBlock.prototype.Token = Token;
  3228. module.exports = StateBlock;
  3229. },{"../common/utils":4,"../token":51}],29:[function(require,module,exports){
  3230. // GFM table, non-standard
  3231. 'use strict';
  3232. var isSpace = require('../common/utils').isSpace;
  3233. function getLine(state, line) {
  3234. var pos = state.bMarks[line] + state.blkIndent,
  3235. max = state.eMarks[line];
  3236. return state.src.substr(pos, max - pos);
  3237. }
  3238. function escapedSplit(str) {
  3239. var result = [],
  3240. pos = 0,
  3241. max = str.length,
  3242. ch,
  3243. escapes = 0,
  3244. lastPos = 0,
  3245. backTicked = false,
  3246. lastBackTick = 0;
  3247. ch = str.charCodeAt(pos);
  3248. while (pos < max) {
  3249. if (ch === 0x60/* ` */) {
  3250. if (backTicked) {
  3251. // make \` close code sequence, but not open it;
  3252. // the reason is: `\` is correct code block
  3253. backTicked = false;
  3254. lastBackTick = pos;
  3255. } else if (escapes % 2 === 0) {
  3256. backTicked = true;
  3257. lastBackTick = pos;
  3258. }
  3259. } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
  3260. result.push(str.substring(lastPos, pos));
  3261. lastPos = pos + 1;
  3262. }
  3263. if (ch === 0x5c/* \ */) {
  3264. escapes++;
  3265. } else {
  3266. escapes = 0;
  3267. }
  3268. pos++;
  3269. // If there was an un-closed backtick, go back to just after
  3270. // the last backtick, but as if it was a normal character
  3271. if (pos === max && backTicked) {
  3272. backTicked = false;
  3273. pos = lastBackTick + 1;
  3274. }
  3275. ch = str.charCodeAt(pos);
  3276. }
  3277. result.push(str.substring(lastPos));
  3278. return result;
  3279. }
  3280. module.exports = function table(state, startLine, endLine, silent) {
  3281. var ch, lineText, pos, i, nextLine, columns, columnCount, token,
  3282. aligns, t, tableLines, tbodyLines;
  3283. // should have at least two lines
  3284. if (startLine + 2 > endLine) { return false; }
  3285. nextLine = startLine + 1;
  3286. if (state.sCount[nextLine] < state.blkIndent) { return false; }
  3287. // if it's indented more than 3 spaces, it should be a code block
  3288. if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
  3289. // first character of the second line should be '|', '-', ':',
  3290. // and no other characters are allowed but spaces;
  3291. // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
  3292. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  3293. if (pos >= state.eMarks[nextLine]) { return false; }
  3294. ch = state.src.charCodeAt(pos++);
  3295. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
  3296. while (pos < state.eMarks[nextLine]) {
  3297. ch = state.src.charCodeAt(pos);
  3298. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
  3299. pos++;
  3300. }
  3301. lineText = getLine(state, startLine + 1);
  3302. columns = lineText.split('|');
  3303. aligns = [];
  3304. for (i = 0; i < columns.length; i++) {
  3305. t = columns[i].trim();
  3306. if (!t) {
  3307. // allow empty columns before and after table, but not in between columns;
  3308. // e.g. allow ` |---| `, disallow ` ---||--- `
  3309. if (i === 0 || i === columns.length - 1) {
  3310. continue;
  3311. } else {
  3312. return false;
  3313. }
  3314. }
  3315. if (!/^:?-+:?$/.test(t)) { return false; }
  3316. if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
  3317. aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
  3318. } else if (t.charCodeAt(0) === 0x3A/* : */) {
  3319. aligns.push('left');
  3320. } else {
  3321. aligns.push('');
  3322. }
  3323. }
  3324. lineText = getLine(state, startLine).trim();
  3325. if (lineText.indexOf('|') === -1) { return false; }
  3326. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  3327. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  3328. // header row will define an amount of columns in the entire table,
  3329. // and align row shouldn't be smaller than that (the rest of the rows can)
  3330. columnCount = columns.length;
  3331. if (columnCount > aligns.length) { return false; }
  3332. if (silent) { return true; }
  3333. token = state.push('table_open', 'table', 1);
  3334. token.map = tableLines = [ startLine, 0 ];
  3335. token = state.push('thead_open', 'thead', 1);
  3336. token.map = [ startLine, startLine + 1 ];
  3337. token = state.push('tr_open', 'tr', 1);
  3338. token.map = [ startLine, startLine + 1 ];
  3339. for (i = 0; i < columns.length; i++) {
  3340. token = state.push('th_open', 'th', 1);
  3341. token.map = [ startLine, startLine + 1 ];
  3342. if (aligns[i]) {
  3343. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  3344. }
  3345. token = state.push('inline', '', 0);
  3346. token.content = columns[i].trim();
  3347. token.map = [ startLine, startLine + 1 ];
  3348. token.children = [];
  3349. token = state.push('th_close', 'th', -1);
  3350. }
  3351. token = state.push('tr_close', 'tr', -1);
  3352. token = state.push('thead_close', 'thead', -1);
  3353. token = state.push('tbody_open', 'tbody', 1);
  3354. token.map = tbodyLines = [ startLine + 2, 0 ];
  3355. for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
  3356. if (state.sCount[nextLine] < state.blkIndent) { break; }
  3357. lineText = getLine(state, nextLine).trim();
  3358. if (lineText.indexOf('|') === -1) { break; }
  3359. if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
  3360. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  3361. token = state.push('tr_open', 'tr', 1);
  3362. for (i = 0; i < columnCount; i++) {
  3363. token = state.push('td_open', 'td', 1);
  3364. if (aligns[i]) {
  3365. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  3366. }
  3367. token = state.push('inline', '', 0);
  3368. token.content = columns[i] ? columns[i].trim() : '';
  3369. token.children = [];
  3370. token = state.push('td_close', 'td', -1);
  3371. }
  3372. token = state.push('tr_close', 'tr', -1);
  3373. }
  3374. token = state.push('tbody_close', 'tbody', -1);
  3375. token = state.push('table_close', 'table', -1);
  3376. tableLines[1] = tbodyLines[1] = nextLine;
  3377. state.line = nextLine;
  3378. return true;
  3379. };
  3380. },{"../common/utils":4}],30:[function(require,module,exports){
  3381. 'use strict';
  3382. module.exports = function block(state) {
  3383. var token;
  3384. if (state.inlineMode) {
  3385. token = new state.Token('inline', '', 0);
  3386. token.content = state.src;
  3387. token.map = [ 0, 1 ];
  3388. token.children = [];
  3389. state.tokens.push(token);
  3390. } else {
  3391. state.md.block.parse(state.src, state.md, state.env, state.tokens);
  3392. }
  3393. };
  3394. },{}],31:[function(require,module,exports){
  3395. 'use strict';
  3396. module.exports = function inline(state) {
  3397. var tokens = state.tokens, tok, i, l;
  3398. // Parse inlines
  3399. for (i = 0, l = tokens.length; i < l; i++) {
  3400. tok = tokens[i];
  3401. if (tok.type === 'inline') {
  3402. state.md.inline.parse(tok.content, state.md, state.env, tok.children);
  3403. }
  3404. }
  3405. };
  3406. },{}],32:[function(require,module,exports){
  3407. // Replace link-like texts with link nodes.
  3408. //
  3409. // Currently restricted by `md.validateLink()` to http/https/ftp
  3410. //
  3411. 'use strict';
  3412. var arrayReplaceAt = require('../common/utils').arrayReplaceAt;
  3413. function isLinkOpen(str) {
  3414. return /^<a[>\s]/i.test(str);
  3415. }
  3416. function isLinkClose(str) {
  3417. return /^<\/a\s*>/i.test(str);
  3418. }
  3419. module.exports = function linkify(state) {
  3420. var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
  3421. level, htmlLinkLevel, url, fullUrl, urlText,
  3422. blockTokens = state.tokens,
  3423. links;
  3424. if (!state.md.options.linkify) { return; }
  3425. for (j = 0, l = blockTokens.length; j < l; j++) {
  3426. if (blockTokens[j].type !== 'inline' ||
  3427. !state.md.linkify.pretest(blockTokens[j].content)) {
  3428. continue;
  3429. }
  3430. tokens = blockTokens[j].children;
  3431. htmlLinkLevel = 0;
  3432. // We scan from the end, to keep position when new tags added.
  3433. // Use reversed logic in links start/end match
  3434. for (i = tokens.length - 1; i >= 0; i--) {
  3435. currentToken = tokens[i];
  3436. // Skip content of markdown links
  3437. if (currentToken.type === 'link_close') {
  3438. i--;
  3439. while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
  3440. i--;
  3441. }
  3442. continue;
  3443. }
  3444. // Skip content of html tag links
  3445. if (currentToken.type === 'html_inline') {
  3446. if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
  3447. htmlLinkLevel--;
  3448. }
  3449. if (isLinkClose(currentToken.content)) {
  3450. htmlLinkLevel++;
  3451. }
  3452. }
  3453. if (htmlLinkLevel > 0) { continue; }
  3454. if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
  3455. text = currentToken.content;
  3456. links = state.md.linkify.match(text);
  3457. // Now split string to nodes
  3458. nodes = [];
  3459. level = currentToken.level;
  3460. lastPos = 0;
  3461. for (ln = 0; ln < links.length; ln++) {
  3462. url = links[ln].url;
  3463. fullUrl = state.md.normalizeLink(url);
  3464. if (!state.md.validateLink(fullUrl)) { continue; }
  3465. urlText = links[ln].text;
  3466. // Linkifier might send raw hostnames like "example.com", where url
  3467. // starts with domain name. So we prepend http:// in those cases,
  3468. // and remove it afterwards.
  3469. //
  3470. if (!links[ln].schema) {
  3471. urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
  3472. } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
  3473. urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
  3474. } else {
  3475. urlText = state.md.normalizeLinkText(urlText);
  3476. }
  3477. pos = links[ln].index;
  3478. if (pos > lastPos) {
  3479. token = new state.Token('text', '', 0);
  3480. token.content = text.slice(lastPos, pos);
  3481. token.level = level;
  3482. nodes.push(token);
  3483. }
  3484. token = new state.Token('link_open', 'a', 1);
  3485. token.attrs = [ [ 'href', fullUrl ] ];
  3486. token.level = level++;
  3487. token.markup = 'linkify';
  3488. token.info = 'auto';
  3489. nodes.push(token);
  3490. token = new state.Token('text', '', 0);
  3491. token.content = urlText;
  3492. token.level = level;
  3493. nodes.push(token);
  3494. token = new state.Token('link_close', 'a', -1);
  3495. token.level = --level;
  3496. token.markup = 'linkify';
  3497. token.info = 'auto';
  3498. nodes.push(token);
  3499. lastPos = links[ln].lastIndex;
  3500. }
  3501. if (lastPos < text.length) {
  3502. token = new state.Token('text', '', 0);
  3503. token.content = text.slice(lastPos);
  3504. token.level = level;
  3505. nodes.push(token);
  3506. }
  3507. // replace current node
  3508. blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
  3509. }
  3510. }
  3511. }
  3512. };
  3513. },{"../common/utils":4}],33:[function(require,module,exports){
  3514. // Normalize input string
  3515. 'use strict';
  3516. // https://spec.commonmark.org/0.29/#line-ending
  3517. var NEWLINES_RE = /\r\n?|\n/g;
  3518. var NULL_RE = /\0/g;
  3519. module.exports = function normalize(state) {
  3520. var str;
  3521. // Normalize newlines
  3522. str = state.src.replace(NEWLINES_RE, '\n');
  3523. // Replace NULL characters
  3524. str = str.replace(NULL_RE, '\uFFFD');
  3525. state.src = str;
  3526. };
  3527. },{}],34:[function(require,module,exports){
  3528. // Simple typographic replacements
  3529. //
  3530. // (c) (C) → ©
  3531. // (tm) (TM) → ™
  3532. // (r) (R) → ®
  3533. // +- → ±
  3534. // (p) (P) -> §
  3535. // ... → … (also ?.... → ?.., !.... → !..)
  3536. // ???????? → ???, !!!!! → !!!, `,,` → `,`
  3537. // -- → &ndash;, --- → &mdash;
  3538. //
  3539. 'use strict';
  3540. // TODO:
  3541. // - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
  3542. // - miltiplication 2 x 4 -> 2 × 4
  3543. var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
  3544. // Workaround for phantomjs - need regex without /g flag,
  3545. // or root check will fail every second time
  3546. var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
  3547. var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
  3548. var SCOPED_ABBR = {
  3549. c: '©',
  3550. r: '®',
  3551. p: '§',
  3552. tm: '™'
  3553. };
  3554. function replaceFn(match, name) {
  3555. return SCOPED_ABBR[name.toLowerCase()];
  3556. }
  3557. function replace_scoped(inlineTokens) {
  3558. var i, token, inside_autolink = 0;
  3559. for (i = inlineTokens.length - 1; i >= 0; i--) {
  3560. token = inlineTokens[i];
  3561. if (token.type === 'text' && !inside_autolink) {
  3562. token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
  3563. }
  3564. if (token.type === 'link_open' && token.info === 'auto') {
  3565. inside_autolink--;
  3566. }
  3567. if (token.type === 'link_close' && token.info === 'auto') {
  3568. inside_autolink++;
  3569. }
  3570. }
  3571. }
  3572. function replace_rare(inlineTokens) {
  3573. var i, token, inside_autolink = 0;
  3574. for (i = inlineTokens.length - 1; i >= 0; i--) {
  3575. token = inlineTokens[i];
  3576. if (token.type === 'text' && !inside_autolink) {
  3577. if (RARE_RE.test(token.content)) {
  3578. token.content = token.content
  3579. .replace(/\+-/g, '±')
  3580. // .., ..., ....... -> …
  3581. // but ?..... & !..... -> ?.. & !..
  3582. .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
  3583. .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
  3584. // em-dash
  3585. .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
  3586. // en-dash
  3587. .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
  3588. .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
  3589. }
  3590. }
  3591. if (token.type === 'link_open' && token.info === 'auto') {
  3592. inside_autolink--;
  3593. }
  3594. if (token.type === 'link_close' && token.info === 'auto') {
  3595. inside_autolink++;
  3596. }
  3597. }
  3598. }
  3599. module.exports = function replace(state) {
  3600. var blkIdx;
  3601. if (!state.md.options.typographer) { return; }
  3602. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  3603. if (state.tokens[blkIdx].type !== 'inline') { continue; }
  3604. if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
  3605. replace_scoped(state.tokens[blkIdx].children);
  3606. }
  3607. if (RARE_RE.test(state.tokens[blkIdx].content)) {
  3608. replace_rare(state.tokens[blkIdx].children);
  3609. }
  3610. }
  3611. };
  3612. },{}],35:[function(require,module,exports){
  3613. // Convert straight quotation marks to typographic ones
  3614. //
  3615. 'use strict';
  3616. var isWhiteSpace = require('../common/utils').isWhiteSpace;
  3617. var isPunctChar = require('../common/utils').isPunctChar;
  3618. var isMdAsciiPunct = require('../common/utils').isMdAsciiPunct;
  3619. var QUOTE_TEST_RE = /['"]/;
  3620. var QUOTE_RE = /['"]/g;
  3621. var APOSTROPHE = '\u2019'; /* ’ */
  3622. function replaceAt(str, index, ch) {
  3623. return str.substr(0, index) + ch + str.substr(index + 1);
  3624. }
  3625. function process_inlines(tokens, state) {
  3626. var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
  3627. isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
  3628. canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
  3629. stack = [];
  3630. for (i = 0; i < tokens.length; i++) {
  3631. token = tokens[i];
  3632. thisLevel = tokens[i].level;
  3633. for (j = stack.length - 1; j >= 0; j--) {
  3634. if (stack[j].level <= thisLevel) { break; }
  3635. }
  3636. stack.length = j + 1;
  3637. if (token.type !== 'text') { continue; }
  3638. text = token.content;
  3639. pos = 0;
  3640. max = text.length;
  3641. /*eslint no-labels:0,block-scoped-var:0*/
  3642. OUTER:
  3643. while (pos < max) {
  3644. QUOTE_RE.lastIndex = pos;
  3645. t = QUOTE_RE.exec(text);
  3646. if (!t) { break; }
  3647. canOpen = canClose = true;
  3648. pos = t.index + 1;
  3649. isSingle = (t[0] === "'");
  3650. // Find previous character,
  3651. // default to space if it's the beginning of the line
  3652. //
  3653. lastChar = 0x20;
  3654. if (t.index - 1 >= 0) {
  3655. lastChar = text.charCodeAt(t.index - 1);
  3656. } else {
  3657. for (j = i - 1; j >= 0; j--) {
  3658. if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20
  3659. if (tokens[j].type !== 'text') continue;
  3660. lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
  3661. break;
  3662. }
  3663. }
  3664. // Find next character,
  3665. // default to space if it's the end of the line
  3666. //
  3667. nextChar = 0x20;
  3668. if (pos < max) {
  3669. nextChar = text.charCodeAt(pos);
  3670. } else {
  3671. for (j = i + 1; j < tokens.length; j++) {
  3672. if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20
  3673. if (tokens[j].type !== 'text') continue;
  3674. nextChar = tokens[j].content.charCodeAt(0);
  3675. break;
  3676. }
  3677. }
  3678. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  3679. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  3680. isLastWhiteSpace = isWhiteSpace(lastChar);
  3681. isNextWhiteSpace = isWhiteSpace(nextChar);
  3682. if (isNextWhiteSpace) {
  3683. canOpen = false;
  3684. } else if (isNextPunctChar) {
  3685. if (!(isLastWhiteSpace || isLastPunctChar)) {
  3686. canOpen = false;
  3687. }
  3688. }
  3689. if (isLastWhiteSpace) {
  3690. canClose = false;
  3691. } else if (isLastPunctChar) {
  3692. if (!(isNextWhiteSpace || isNextPunctChar)) {
  3693. canClose = false;
  3694. }
  3695. }
  3696. if (nextChar === 0x22 /* " */ && t[0] === '"') {
  3697. if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
  3698. // special case: 1"" - count first quote as an inch
  3699. canClose = canOpen = false;
  3700. }
  3701. }
  3702. if (canOpen && canClose) {
  3703. // treat this as the middle of the word
  3704. canOpen = false;
  3705. canClose = isNextPunctChar;
  3706. }
  3707. if (!canOpen && !canClose) {
  3708. // middle of word
  3709. if (isSingle) {
  3710. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  3711. }
  3712. continue;
  3713. }
  3714. if (canClose) {
  3715. // this could be a closing quote, rewind the stack to get a match
  3716. for (j = stack.length - 1; j >= 0; j--) {
  3717. item = stack[j];
  3718. if (stack[j].level < thisLevel) { break; }
  3719. if (item.single === isSingle && stack[j].level === thisLevel) {
  3720. item = stack[j];
  3721. if (isSingle) {
  3722. openQuote = state.md.options.quotes[2];
  3723. closeQuote = state.md.options.quotes[3];
  3724. } else {
  3725. openQuote = state.md.options.quotes[0];
  3726. closeQuote = state.md.options.quotes[1];
  3727. }
  3728. // replace token.content *before* tokens[item.token].content,
  3729. // because, if they are pointing at the same token, replaceAt
  3730. // could mess up indices when quote length != 1
  3731. token.content = replaceAt(token.content, t.index, closeQuote);
  3732. tokens[item.token].content = replaceAt(
  3733. tokens[item.token].content, item.pos, openQuote);
  3734. pos += closeQuote.length - 1;
  3735. if (item.token === i) { pos += openQuote.length - 1; }
  3736. text = token.content;
  3737. max = text.length;
  3738. stack.length = j;
  3739. continue OUTER;
  3740. }
  3741. }
  3742. }
  3743. if (canOpen) {
  3744. stack.push({
  3745. token: i,
  3746. pos: t.index,
  3747. single: isSingle,
  3748. level: thisLevel
  3749. });
  3750. } else if (canClose && isSingle) {
  3751. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  3752. }
  3753. }
  3754. }
  3755. }
  3756. module.exports = function smartquotes(state) {
  3757. /*eslint max-depth:0*/
  3758. var blkIdx;
  3759. if (!state.md.options.typographer) { return; }
  3760. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  3761. if (state.tokens[blkIdx].type !== 'inline' ||
  3762. !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
  3763. continue;
  3764. }
  3765. process_inlines(state.tokens[blkIdx].children, state);
  3766. }
  3767. };
  3768. },{"../common/utils":4}],36:[function(require,module,exports){
  3769. // Core state object
  3770. //
  3771. 'use strict';
  3772. var Token = require('../token');
  3773. function StateCore(src, md, env) {
  3774. this.src = src;
  3775. this.env = env;
  3776. this.tokens = [];
  3777. this.inlineMode = false;
  3778. this.md = md; // link to parser instance
  3779. }
  3780. // re-export Token class to use in core rules
  3781. StateCore.prototype.Token = Token;
  3782. module.exports = StateCore;
  3783. },{"../token":51}],37:[function(require,module,exports){
  3784. // Process autolinks '<protocol:...>'
  3785. 'use strict';
  3786. /*eslint max-len:0*/
  3787. var EMAIL_RE = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/;
  3788. var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
  3789. module.exports = function autolink(state, silent) {
  3790. var tail, linkMatch, emailMatch, url, fullUrl, token,
  3791. pos = state.pos;
  3792. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  3793. tail = state.src.slice(pos);
  3794. if (tail.indexOf('>') < 0) { return false; }
  3795. if (AUTOLINK_RE.test(tail)) {
  3796. linkMatch = tail.match(AUTOLINK_RE);
  3797. url = linkMatch[0].slice(1, -1);
  3798. fullUrl = state.md.normalizeLink(url);
  3799. if (!state.md.validateLink(fullUrl)) { return false; }
  3800. if (!silent) {
  3801. token = state.push('link_open', 'a', 1);
  3802. token.attrs = [ [ 'href', fullUrl ] ];
  3803. token.markup = 'autolink';
  3804. token.info = 'auto';
  3805. token = state.push('text', '', 0);
  3806. token.content = state.md.normalizeLinkText(url);
  3807. token = state.push('link_close', 'a', -1);
  3808. token.markup = 'autolink';
  3809. token.info = 'auto';
  3810. }
  3811. state.pos += linkMatch[0].length;
  3812. return true;
  3813. }
  3814. if (EMAIL_RE.test(tail)) {
  3815. emailMatch = tail.match(EMAIL_RE);
  3816. url = emailMatch[0].slice(1, -1);
  3817. fullUrl = state.md.normalizeLink('mailto:' + url);
  3818. if (!state.md.validateLink(fullUrl)) { return false; }
  3819. if (!silent) {
  3820. token = state.push('link_open', 'a', 1);
  3821. token.attrs = [ [ 'href', fullUrl ] ];
  3822. token.markup = 'autolink';
  3823. token.info = 'auto';
  3824. token = state.push('text', '', 0);
  3825. token.content = state.md.normalizeLinkText(url);
  3826. token = state.push('link_close', 'a', -1);
  3827. token.markup = 'autolink';
  3828. token.info = 'auto';
  3829. }
  3830. state.pos += emailMatch[0].length;
  3831. return true;
  3832. }
  3833. return false;
  3834. };
  3835. },{}],38:[function(require,module,exports){
  3836. // Parse backticks
  3837. 'use strict';
  3838. module.exports = function backtick(state, silent) {
  3839. var start, max, marker, matchStart, matchEnd, token,
  3840. pos = state.pos,
  3841. ch = state.src.charCodeAt(pos);
  3842. if (ch !== 0x60/* ` */) { return false; }
  3843. start = pos;
  3844. pos++;
  3845. max = state.posMax;
  3846. while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
  3847. marker = state.src.slice(start, pos);
  3848. matchStart = matchEnd = pos;
  3849. while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
  3850. matchEnd = matchStart + 1;
  3851. while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
  3852. if (matchEnd - matchStart === marker.length) {
  3853. if (!silent) {
  3854. token = state.push('code_inline', 'code', 0);
  3855. token.markup = marker;
  3856. token.content = state.src.slice(pos, matchStart)
  3857. .replace(/\n/g, ' ')
  3858. .replace(/^ (.+) $/, '$1');
  3859. }
  3860. state.pos = matchEnd;
  3861. return true;
  3862. }
  3863. }
  3864. if (!silent) { state.pending += marker; }
  3865. state.pos += marker.length;
  3866. return true;
  3867. };
  3868. },{}],39:[function(require,module,exports){
  3869. // For each opening emphasis-like marker find a matching closing one
  3870. //
  3871. 'use strict';
  3872. function processDelimiters(state, delimiters) {
  3873. var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx,
  3874. isOddMatch, lastJump,
  3875. openersBottom = {},
  3876. max = delimiters.length;
  3877. for (closerIdx = 0; closerIdx < max; closerIdx++) {
  3878. closer = delimiters[closerIdx];
  3879. // Length is only used for emphasis-specific "rule of 3",
  3880. // if it's not defined (in strikethrough or 3rd party plugins),
  3881. // we can default it to 0 to disable those checks.
  3882. //
  3883. closer.length = closer.length || 0;
  3884. if (!closer.close) continue;
  3885. // Previously calculated lower bounds (previous fails)
  3886. // for each marker and each delimiter length modulo 3.
  3887. if (!openersBottom.hasOwnProperty(closer.marker)) {
  3888. openersBottom[closer.marker] = [ -1, -1, -1 ];
  3889. }
  3890. minOpenerIdx = openersBottom[closer.marker][closer.length % 3];
  3891. newMinOpenerIdx = -1;
  3892. openerIdx = closerIdx - closer.jump - 1;
  3893. for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) {
  3894. opener = delimiters[openerIdx];
  3895. if (opener.marker !== closer.marker) continue;
  3896. if (newMinOpenerIdx === -1) newMinOpenerIdx = openerIdx;
  3897. if (opener.open &&
  3898. opener.end < 0 &&
  3899. opener.level === closer.level) {
  3900. isOddMatch = false;
  3901. // from spec:
  3902. //
  3903. // If one of the delimiters can both open and close emphasis, then the
  3904. // sum of the lengths of the delimiter runs containing the opening and
  3905. // closing delimiters must not be a multiple of 3 unless both lengths
  3906. // are multiples of 3.
  3907. //
  3908. if (opener.close || closer.open) {
  3909. if ((opener.length + closer.length) % 3 === 0) {
  3910. if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
  3911. isOddMatch = true;
  3912. }
  3913. }
  3914. }
  3915. if (!isOddMatch) {
  3916. // If previous delimiter cannot be an opener, we can safely skip
  3917. // the entire sequence in future checks. This is required to make
  3918. // sure algorithm has linear complexity (see *_*_*_*_*_... case).
  3919. //
  3920. lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ?
  3921. delimiters[openerIdx - 1].jump + 1 :
  3922. 0;
  3923. closer.jump = closerIdx - openerIdx + lastJump;
  3924. closer.open = false;
  3925. opener.end = closerIdx;
  3926. opener.jump = lastJump;
  3927. opener.close = false;
  3928. newMinOpenerIdx = -1;
  3929. break;
  3930. }
  3931. }
  3932. }
  3933. if (newMinOpenerIdx !== -1) {
  3934. // If match for this delimiter run failed, we want to set lower bound for
  3935. // future lookups. This is required to make sure algorithm has linear
  3936. // complexity.
  3937. //
  3938. // See details here:
  3939. // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442
  3940. //
  3941. openersBottom[closer.marker][(closer.length || 0) % 3] = newMinOpenerIdx;
  3942. }
  3943. }
  3944. }
  3945. module.exports = function link_pairs(state) {
  3946. var curr,
  3947. tokens_meta = state.tokens_meta,
  3948. max = state.tokens_meta.length;
  3949. processDelimiters(state, state.delimiters);
  3950. for (curr = 0; curr < max; curr++) {
  3951. if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
  3952. processDelimiters(state, tokens_meta[curr].delimiters);
  3953. }
  3954. }
  3955. };
  3956. },{}],40:[function(require,module,exports){
  3957. // Process *this* and _that_
  3958. //
  3959. 'use strict';
  3960. // Insert each marker as a separate text token, and add it to delimiter list
  3961. //
  3962. module.exports.tokenize = function emphasis(state, silent) {
  3963. var i, scanned, token,
  3964. start = state.pos,
  3965. marker = state.src.charCodeAt(start);
  3966. if (silent) { return false; }
  3967. if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
  3968. scanned = state.scanDelims(state.pos, marker === 0x2A);
  3969. for (i = 0; i < scanned.length; i++) {
  3970. token = state.push('text', '', 0);
  3971. token.content = String.fromCharCode(marker);
  3972. state.delimiters.push({
  3973. // Char code of the starting marker (number).
  3974. //
  3975. marker: marker,
  3976. // Total length of these series of delimiters.
  3977. //
  3978. length: scanned.length,
  3979. // An amount of characters before this one that's equivalent to
  3980. // current one. In plain English: if this delimiter does not open
  3981. // an emphasis, neither do previous `jump` characters.
  3982. //
  3983. // Used to skip sequences like "*****" in one step, for 1st asterisk
  3984. // value will be 0, for 2nd it's 1 and so on.
  3985. //
  3986. jump: i,
  3987. // A position of the token this delimiter corresponds to.
  3988. //
  3989. token: state.tokens.length - 1,
  3990. // If this delimiter is matched as a valid opener, `end` will be
  3991. // equal to its position, otherwise it's `-1`.
  3992. //
  3993. end: -1,
  3994. // Boolean flags that determine if this delimiter could open or close
  3995. // an emphasis.
  3996. //
  3997. open: scanned.can_open,
  3998. close: scanned.can_close
  3999. });
  4000. }
  4001. state.pos += scanned.length;
  4002. return true;
  4003. };
  4004. function postProcess(state, delimiters) {
  4005. var i,
  4006. startDelim,
  4007. endDelim,
  4008. token,
  4009. ch,
  4010. isStrong,
  4011. max = delimiters.length;
  4012. for (i = max - 1; i >= 0; i--) {
  4013. startDelim = delimiters[i];
  4014. if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
  4015. continue;
  4016. }
  4017. // Process only opening markers
  4018. if (startDelim.end === -1) {
  4019. continue;
  4020. }
  4021. endDelim = delimiters[startDelim.end];
  4022. // If the previous delimiter has the same marker and is adjacent to this one,
  4023. // merge those into one strong delimiter.
  4024. //
  4025. // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`
  4026. //
  4027. isStrong = i > 0 &&
  4028. delimiters[i - 1].end === startDelim.end + 1 &&
  4029. delimiters[i - 1].token === startDelim.token - 1 &&
  4030. delimiters[startDelim.end + 1].token === endDelim.token + 1 &&
  4031. delimiters[i - 1].marker === startDelim.marker;
  4032. ch = String.fromCharCode(startDelim.marker);
  4033. token = state.tokens[startDelim.token];
  4034. token.type = isStrong ? 'strong_open' : 'em_open';
  4035. token.tag = isStrong ? 'strong' : 'em';
  4036. token.nesting = 1;
  4037. token.markup = isStrong ? ch + ch : ch;
  4038. token.content = '';
  4039. token = state.tokens[endDelim.token];
  4040. token.type = isStrong ? 'strong_close' : 'em_close';
  4041. token.tag = isStrong ? 'strong' : 'em';
  4042. token.nesting = -1;
  4043. token.markup = isStrong ? ch + ch : ch;
  4044. token.content = '';
  4045. if (isStrong) {
  4046. state.tokens[delimiters[i - 1].token].content = '';
  4047. state.tokens[delimiters[startDelim.end + 1].token].content = '';
  4048. i--;
  4049. }
  4050. }
  4051. }
  4052. // Walk through delimiter list and replace text tokens with tags
  4053. //
  4054. module.exports.postProcess = function emphasis(state) {
  4055. var curr,
  4056. tokens_meta = state.tokens_meta,
  4057. max = state.tokens_meta.length;
  4058. postProcess(state, state.delimiters);
  4059. for (curr = 0; curr < max; curr++) {
  4060. if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
  4061. postProcess(state, tokens_meta[curr].delimiters);
  4062. }
  4063. }
  4064. };
  4065. },{}],41:[function(require,module,exports){
  4066. // Process html entity - &#123;, &#xAF;, &quot;, ...
  4067. 'use strict';
  4068. var entities = require('../common/entities');
  4069. var has = require('../common/utils').has;
  4070. var isValidEntityCode = require('../common/utils').isValidEntityCode;
  4071. var fromCodePoint = require('../common/utils').fromCodePoint;
  4072. var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
  4073. var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
  4074. module.exports = function entity(state, silent) {
  4075. var ch, code, match, pos = state.pos, max = state.posMax;
  4076. if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
  4077. if (pos + 1 < max) {
  4078. ch = state.src.charCodeAt(pos + 1);
  4079. if (ch === 0x23 /* # */) {
  4080. match = state.src.slice(pos).match(DIGITAL_RE);
  4081. if (match) {
  4082. if (!silent) {
  4083. code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
  4084. state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
  4085. }
  4086. state.pos += match[0].length;
  4087. return true;
  4088. }
  4089. } else {
  4090. match = state.src.slice(pos).match(NAMED_RE);
  4091. if (match) {
  4092. if (has(entities, match[1])) {
  4093. if (!silent) { state.pending += entities[match[1]]; }
  4094. state.pos += match[0].length;
  4095. return true;
  4096. }
  4097. }
  4098. }
  4099. }
  4100. if (!silent) { state.pending += '&'; }
  4101. state.pos++;
  4102. return true;
  4103. };
  4104. },{"../common/entities":1,"../common/utils":4}],42:[function(require,module,exports){
  4105. // Process escaped chars and hardbreaks
  4106. 'use strict';
  4107. var isSpace = require('../common/utils').isSpace;
  4108. var ESCAPED = [];
  4109. for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
  4110. '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
  4111. .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
  4112. module.exports = function escape(state, silent) {
  4113. var ch, pos = state.pos, max = state.posMax;
  4114. if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
  4115. pos++;
  4116. if (pos < max) {
  4117. ch = state.src.charCodeAt(pos);
  4118. if (ch < 256 && ESCAPED[ch] !== 0) {
  4119. if (!silent) { state.pending += state.src[pos]; }
  4120. state.pos += 2;
  4121. return true;
  4122. }
  4123. if (ch === 0x0A) {
  4124. if (!silent) {
  4125. state.push('hardbreak', 'br', 0);
  4126. }
  4127. pos++;
  4128. // skip leading whitespaces from next line
  4129. while (pos < max) {
  4130. ch = state.src.charCodeAt(pos);
  4131. if (!isSpace(ch)) { break; }
  4132. pos++;
  4133. }
  4134. state.pos = pos;
  4135. return true;
  4136. }
  4137. }
  4138. if (!silent) { state.pending += '\\'; }
  4139. state.pos++;
  4140. return true;
  4141. };
  4142. },{"../common/utils":4}],43:[function(require,module,exports){
  4143. // Process html tags
  4144. 'use strict';
  4145. var HTML_TAG_RE = require('../common/html_re').HTML_TAG_RE;
  4146. function isLetter(ch) {
  4147. /*eslint no-bitwise:0*/
  4148. var lc = ch | 0x20; // to lower case
  4149. return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
  4150. }
  4151. module.exports = function html_inline(state, silent) {
  4152. var ch, match, max, token,
  4153. pos = state.pos;
  4154. if (!state.md.options.html) { return false; }
  4155. // Check start
  4156. max = state.posMax;
  4157. if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
  4158. pos + 2 >= max) {
  4159. return false;
  4160. }
  4161. // Quick fail on second char
  4162. ch = state.src.charCodeAt(pos + 1);
  4163. if (ch !== 0x21/* ! */ &&
  4164. ch !== 0x3F/* ? */ &&
  4165. ch !== 0x2F/* / */ &&
  4166. !isLetter(ch)) {
  4167. return false;
  4168. }
  4169. match = state.src.slice(pos).match(HTML_TAG_RE);
  4170. if (!match) { return false; }
  4171. if (!silent) {
  4172. token = state.push('html_inline', '', 0);
  4173. token.content = state.src.slice(pos, pos + match[0].length);
  4174. }
  4175. state.pos += match[0].length;
  4176. return true;
  4177. };
  4178. },{"../common/html_re":3}],44:[function(require,module,exports){
  4179. // Process ![image](<src> "title")
  4180. 'use strict';
  4181. var normalizeReference = require('../common/utils').normalizeReference;
  4182. var isSpace = require('../common/utils').isSpace;
  4183. module.exports = function image(state, silent) {
  4184. var attrs,
  4185. code,
  4186. content,
  4187. label,
  4188. labelEnd,
  4189. labelStart,
  4190. pos,
  4191. ref,
  4192. res,
  4193. title,
  4194. token,
  4195. tokens,
  4196. start,
  4197. href = '',
  4198. oldPos = state.pos,
  4199. max = state.posMax;
  4200. if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
  4201. if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
  4202. labelStart = state.pos + 2;
  4203. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
  4204. // parser failed to find ']', so it's not a valid link
  4205. if (labelEnd < 0) { return false; }
  4206. pos = labelEnd + 1;
  4207. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  4208. //
  4209. // Inline link
  4210. //
  4211. // [link]( <href> "title" )
  4212. // ^^ skipping these spaces
  4213. pos++;
  4214. for (; pos < max; pos++) {
  4215. code = state.src.charCodeAt(pos);
  4216. if (!isSpace(code) && code !== 0x0A) { break; }
  4217. }
  4218. if (pos >= max) { return false; }
  4219. // [link]( <href> "title" )
  4220. // ^^^^^^ parsing link destination
  4221. start = pos;
  4222. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  4223. if (res.ok) {
  4224. href = state.md.normalizeLink(res.str);
  4225. if (state.md.validateLink(href)) {
  4226. pos = res.pos;
  4227. } else {
  4228. href = '';
  4229. }
  4230. }
  4231. // [link]( <href> "title" )
  4232. // ^^ skipping these spaces
  4233. start = pos;
  4234. for (; pos < max; pos++) {
  4235. code = state.src.charCodeAt(pos);
  4236. if (!isSpace(code) && code !== 0x0A) { break; }
  4237. }
  4238. // [link]( <href> "title" )
  4239. // ^^^^^^^ parsing link title
  4240. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  4241. if (pos < max && start !== pos && res.ok) {
  4242. title = res.str;
  4243. pos = res.pos;
  4244. // [link]( <href> "title" )
  4245. // ^^ skipping these spaces
  4246. for (; pos < max; pos++) {
  4247. code = state.src.charCodeAt(pos);
  4248. if (!isSpace(code) && code !== 0x0A) { break; }
  4249. }
  4250. } else {
  4251. title = '';
  4252. }
  4253. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  4254. state.pos = oldPos;
  4255. return false;
  4256. }
  4257. pos++;
  4258. } else {
  4259. //
  4260. // Link reference
  4261. //
  4262. if (typeof state.env.references === 'undefined') { return false; }
  4263. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  4264. start = pos + 1;
  4265. pos = state.md.helpers.parseLinkLabel(state, pos);
  4266. if (pos >= 0) {
  4267. label = state.src.slice(start, pos++);
  4268. } else {
  4269. pos = labelEnd + 1;
  4270. }
  4271. } else {
  4272. pos = labelEnd + 1;
  4273. }
  4274. // covers label === '' and label === undefined
  4275. // (collapsed reference link and shortcut reference link respectively)
  4276. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  4277. ref = state.env.references[normalizeReference(label)];
  4278. if (!ref) {
  4279. state.pos = oldPos;
  4280. return false;
  4281. }
  4282. href = ref.href;
  4283. title = ref.title;
  4284. }
  4285. //
  4286. // We found the end of the link, and know for a fact it's a valid link;
  4287. // so all that's left to do is to call tokenizer.
  4288. //
  4289. if (!silent) {
  4290. content = state.src.slice(labelStart, labelEnd);
  4291. state.md.inline.parse(
  4292. content,
  4293. state.md,
  4294. state.env,
  4295. tokens = []
  4296. );
  4297. token = state.push('image', 'img', 0);
  4298. token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
  4299. token.children = tokens;
  4300. token.content = content;
  4301. if (title) {
  4302. attrs.push([ 'title', title ]);
  4303. }
  4304. }
  4305. state.pos = pos;
  4306. state.posMax = max;
  4307. return true;
  4308. };
  4309. },{"../common/utils":4}],45:[function(require,module,exports){
  4310. // Process [link](<to> "stuff")
  4311. 'use strict';
  4312. var normalizeReference = require('../common/utils').normalizeReference;
  4313. var isSpace = require('../common/utils').isSpace;
  4314. module.exports = function link(state, silent) {
  4315. var attrs,
  4316. code,
  4317. label,
  4318. labelEnd,
  4319. labelStart,
  4320. pos,
  4321. res,
  4322. ref,
  4323. title,
  4324. token,
  4325. href = '',
  4326. oldPos = state.pos,
  4327. max = state.posMax,
  4328. start = state.pos,
  4329. parseReference = true;
  4330. if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
  4331. labelStart = state.pos + 1;
  4332. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
  4333. // parser failed to find ']', so it's not a valid link
  4334. if (labelEnd < 0) { return false; }
  4335. pos = labelEnd + 1;
  4336. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  4337. //
  4338. // Inline link
  4339. //
  4340. // might have found a valid shortcut link, disable reference parsing
  4341. parseReference = false;
  4342. // [link]( <href> "title" )
  4343. // ^^ skipping these spaces
  4344. pos++;
  4345. for (; pos < max; pos++) {
  4346. code = state.src.charCodeAt(pos);
  4347. if (!isSpace(code) && code !== 0x0A) { break; }
  4348. }
  4349. if (pos >= max) { return false; }
  4350. // [link]( <href> "title" )
  4351. // ^^^^^^ parsing link destination
  4352. start = pos;
  4353. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  4354. if (res.ok) {
  4355. href = state.md.normalizeLink(res.str);
  4356. if (state.md.validateLink(href)) {
  4357. pos = res.pos;
  4358. } else {
  4359. href = '';
  4360. }
  4361. }
  4362. // [link]( <href> "title" )
  4363. // ^^ skipping these spaces
  4364. start = pos;
  4365. for (; pos < max; pos++) {
  4366. code = state.src.charCodeAt(pos);
  4367. if (!isSpace(code) && code !== 0x0A) { break; }
  4368. }
  4369. // [link]( <href> "title" )
  4370. // ^^^^^^^ parsing link title
  4371. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  4372. if (pos < max && start !== pos && res.ok) {
  4373. title = res.str;
  4374. pos = res.pos;
  4375. // [link]( <href> "title" )
  4376. // ^^ skipping these spaces
  4377. for (; pos < max; pos++) {
  4378. code = state.src.charCodeAt(pos);
  4379. if (!isSpace(code) && code !== 0x0A) { break; }
  4380. }
  4381. } else {
  4382. title = '';
  4383. }
  4384. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  4385. // parsing a valid shortcut link failed, fallback to reference
  4386. parseReference = true;
  4387. }
  4388. pos++;
  4389. }
  4390. if (parseReference) {
  4391. //
  4392. // Link reference
  4393. //
  4394. if (typeof state.env.references === 'undefined') { return false; }
  4395. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  4396. start = pos + 1;
  4397. pos = state.md.helpers.parseLinkLabel(state, pos);
  4398. if (pos >= 0) {
  4399. label = state.src.slice(start, pos++);
  4400. } else {
  4401. pos = labelEnd + 1;
  4402. }
  4403. } else {
  4404. pos = labelEnd + 1;
  4405. }
  4406. // covers label === '' and label === undefined
  4407. // (collapsed reference link and shortcut reference link respectively)
  4408. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  4409. ref = state.env.references[normalizeReference(label)];
  4410. if (!ref) {
  4411. state.pos = oldPos;
  4412. return false;
  4413. }
  4414. href = ref.href;
  4415. title = ref.title;
  4416. }
  4417. //
  4418. // We found the end of the link, and know for a fact it's a valid link;
  4419. // so all that's left to do is to call tokenizer.
  4420. //
  4421. if (!silent) {
  4422. state.pos = labelStart;
  4423. state.posMax = labelEnd;
  4424. token = state.push('link_open', 'a', 1);
  4425. token.attrs = attrs = [ [ 'href', href ] ];
  4426. if (title) {
  4427. attrs.push([ 'title', title ]);
  4428. }
  4429. state.md.inline.tokenize(state);
  4430. token = state.push('link_close', 'a', -1);
  4431. }
  4432. state.pos = pos;
  4433. state.posMax = max;
  4434. return true;
  4435. };
  4436. },{"../common/utils":4}],46:[function(require,module,exports){
  4437. // Proceess '\n'
  4438. 'use strict';
  4439. var isSpace = require('../common/utils').isSpace;
  4440. module.exports = function newline(state, silent) {
  4441. var pmax, max, pos = state.pos;
  4442. if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
  4443. pmax = state.pending.length - 1;
  4444. max = state.posMax;
  4445. // ' \n' -> hardbreak
  4446. // Lookup in pending chars is bad practice! Don't copy to other rules!
  4447. // Pending string is stored in concat mode, indexed lookups will cause
  4448. // convertion to flat mode.
  4449. if (!silent) {
  4450. if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
  4451. if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
  4452. state.pending = state.pending.replace(/ +$/, '');
  4453. state.push('hardbreak', 'br', 0);
  4454. } else {
  4455. state.pending = state.pending.slice(0, -1);
  4456. state.push('softbreak', 'br', 0);
  4457. }
  4458. } else {
  4459. state.push('softbreak', 'br', 0);
  4460. }
  4461. }
  4462. pos++;
  4463. // skip heading spaces for next line
  4464. while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
  4465. state.pos = pos;
  4466. return true;
  4467. };
  4468. },{"../common/utils":4}],47:[function(require,module,exports){
  4469. // Inline parser state
  4470. 'use strict';
  4471. var Token = require('../token');
  4472. var isWhiteSpace = require('../common/utils').isWhiteSpace;
  4473. var isPunctChar = require('../common/utils').isPunctChar;
  4474. var isMdAsciiPunct = require('../common/utils').isMdAsciiPunct;
  4475. function StateInline(src, md, env, outTokens) {
  4476. this.src = src;
  4477. this.env = env;
  4478. this.md = md;
  4479. this.tokens = outTokens;
  4480. this.tokens_meta = Array(outTokens.length);
  4481. this.pos = 0;
  4482. this.posMax = this.src.length;
  4483. this.level = 0;
  4484. this.pending = '';
  4485. this.pendingLevel = 0;
  4486. // Stores { start: end } pairs. Useful for backtrack
  4487. // optimization of pairs parse (emphasis, strikes).
  4488. this.cache = {};
  4489. // List of emphasis-like delimiters for current tag
  4490. this.delimiters = [];
  4491. // Stack of delimiter lists for upper level tags
  4492. this._prev_delimiters = [];
  4493. }
  4494. // Flush pending text
  4495. //
  4496. StateInline.prototype.pushPending = function () {
  4497. var token = new Token('text', '', 0);
  4498. token.content = this.pending;
  4499. token.level = this.pendingLevel;
  4500. this.tokens.push(token);
  4501. this.pending = '';
  4502. return token;
  4503. };
  4504. // Push new token to "stream".
  4505. // If pending text exists - flush it as text token
  4506. //
  4507. StateInline.prototype.push = function (type, tag, nesting) {
  4508. if (this.pending) {
  4509. this.pushPending();
  4510. }
  4511. var token = new Token(type, tag, nesting);
  4512. var token_meta = null;
  4513. if (nesting < 0) {
  4514. // closing tag
  4515. this.level--;
  4516. this.delimiters = this._prev_delimiters.pop();
  4517. }
  4518. token.level = this.level;
  4519. if (nesting > 0) {
  4520. // opening tag
  4521. this.level++;
  4522. this._prev_delimiters.push(this.delimiters);
  4523. this.delimiters = [];
  4524. token_meta = { delimiters: this.delimiters };
  4525. }
  4526. this.pendingLevel = this.level;
  4527. this.tokens.push(token);
  4528. this.tokens_meta.push(token_meta);
  4529. return token;
  4530. };
  4531. // Scan a sequence of emphasis-like markers, and determine whether
  4532. // it can start an emphasis sequence or end an emphasis sequence.
  4533. //
  4534. // - start - position to scan from (it should point at a valid marker);
  4535. // - canSplitWord - determine if these markers can be found inside a word
  4536. //
  4537. StateInline.prototype.scanDelims = function (start, canSplitWord) {
  4538. var pos = start, lastChar, nextChar, count, can_open, can_close,
  4539. isLastWhiteSpace, isLastPunctChar,
  4540. isNextWhiteSpace, isNextPunctChar,
  4541. left_flanking = true,
  4542. right_flanking = true,
  4543. max = this.posMax,
  4544. marker = this.src.charCodeAt(start);
  4545. // treat beginning of the line as a whitespace
  4546. lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
  4547. while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
  4548. count = pos - start;
  4549. // treat end of the line as a whitespace
  4550. nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
  4551. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  4552. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  4553. isLastWhiteSpace = isWhiteSpace(lastChar);
  4554. isNextWhiteSpace = isWhiteSpace(nextChar);
  4555. if (isNextWhiteSpace) {
  4556. left_flanking = false;
  4557. } else if (isNextPunctChar) {
  4558. if (!(isLastWhiteSpace || isLastPunctChar)) {
  4559. left_flanking = false;
  4560. }
  4561. }
  4562. if (isLastWhiteSpace) {
  4563. right_flanking = false;
  4564. } else if (isLastPunctChar) {
  4565. if (!(isNextWhiteSpace || isNextPunctChar)) {
  4566. right_flanking = false;
  4567. }
  4568. }
  4569. if (!canSplitWord) {
  4570. can_open = left_flanking && (!right_flanking || isLastPunctChar);
  4571. can_close = right_flanking && (!left_flanking || isNextPunctChar);
  4572. } else {
  4573. can_open = left_flanking;
  4574. can_close = right_flanking;
  4575. }
  4576. return {
  4577. can_open: can_open,
  4578. can_close: can_close,
  4579. length: count
  4580. };
  4581. };
  4582. // re-export Token class to use in block rules
  4583. StateInline.prototype.Token = Token;
  4584. module.exports = StateInline;
  4585. },{"../common/utils":4,"../token":51}],48:[function(require,module,exports){
  4586. // ~~strike through~~
  4587. //
  4588. 'use strict';
  4589. // Insert each marker as a separate text token, and add it to delimiter list
  4590. //
  4591. module.exports.tokenize = function strikethrough(state, silent) {
  4592. var i, scanned, token, len, ch,
  4593. start = state.pos,
  4594. marker = state.src.charCodeAt(start);
  4595. if (silent) { return false; }
  4596. if (marker !== 0x7E/* ~ */) { return false; }
  4597. scanned = state.scanDelims(state.pos, true);
  4598. len = scanned.length;
  4599. ch = String.fromCharCode(marker);
  4600. if (len < 2) { return false; }
  4601. if (len % 2) {
  4602. token = state.push('text', '', 0);
  4603. token.content = ch;
  4604. len--;
  4605. }
  4606. for (i = 0; i < len; i += 2) {
  4607. token = state.push('text', '', 0);
  4608. token.content = ch + ch;
  4609. state.delimiters.push({
  4610. marker: marker,
  4611. length: 0, // disable "rule of 3" length checks meant for emphasis
  4612. jump: i,
  4613. token: state.tokens.length - 1,
  4614. end: -1,
  4615. open: scanned.can_open,
  4616. close: scanned.can_close
  4617. });
  4618. }
  4619. state.pos += scanned.length;
  4620. return true;
  4621. };
  4622. function postProcess(state, delimiters) {
  4623. var i, j,
  4624. startDelim,
  4625. endDelim,
  4626. token,
  4627. loneMarkers = [],
  4628. max = delimiters.length;
  4629. for (i = 0; i < max; i++) {
  4630. startDelim = delimiters[i];
  4631. if (startDelim.marker !== 0x7E/* ~ */) {
  4632. continue;
  4633. }
  4634. if (startDelim.end === -1) {
  4635. continue;
  4636. }
  4637. endDelim = delimiters[startDelim.end];
  4638. token = state.tokens[startDelim.token];
  4639. token.type = 's_open';
  4640. token.tag = 's';
  4641. token.nesting = 1;
  4642. token.markup = '~~';
  4643. token.content = '';
  4644. token = state.tokens[endDelim.token];
  4645. token.type = 's_close';
  4646. token.tag = 's';
  4647. token.nesting = -1;
  4648. token.markup = '~~';
  4649. token.content = '';
  4650. if (state.tokens[endDelim.token - 1].type === 'text' &&
  4651. state.tokens[endDelim.token - 1].content === '~') {
  4652. loneMarkers.push(endDelim.token - 1);
  4653. }
  4654. }
  4655. // If a marker sequence has an odd number of characters, it's splitted
  4656. // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
  4657. // start of the sequence.
  4658. //
  4659. // So, we have to move all those markers after subsequent s_close tags.
  4660. //
  4661. while (loneMarkers.length) {
  4662. i = loneMarkers.pop();
  4663. j = i + 1;
  4664. while (j < state.tokens.length && state.tokens[j].type === 's_close') {
  4665. j++;
  4666. }
  4667. j--;
  4668. if (i !== j) {
  4669. token = state.tokens[j];
  4670. state.tokens[j] = state.tokens[i];
  4671. state.tokens[i] = token;
  4672. }
  4673. }
  4674. }
  4675. // Walk through delimiter list and replace text tokens with tags
  4676. //
  4677. module.exports.postProcess = function strikethrough(state) {
  4678. var curr,
  4679. tokens_meta = state.tokens_meta,
  4680. max = state.tokens_meta.length;
  4681. postProcess(state, state.delimiters);
  4682. for (curr = 0; curr < max; curr++) {
  4683. if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
  4684. postProcess(state, tokens_meta[curr].delimiters);
  4685. }
  4686. }
  4687. };
  4688. },{}],49:[function(require,module,exports){
  4689. // Skip text characters for text token, place those to pending buffer
  4690. // and increment current pos
  4691. 'use strict';
  4692. // Rule to skip pure text
  4693. // '{}$%@~+=:' reserved for extentions
  4694. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  4695. // !!!! Don't confuse with "Markdown ASCII Punctuation" chars
  4696. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  4697. function isTerminatorChar(ch) {
  4698. switch (ch) {
  4699. case 0x0A/* \n */:
  4700. case 0x21/* ! */:
  4701. case 0x23/* # */:
  4702. case 0x24/* $ */:
  4703. case 0x25/* % */:
  4704. case 0x26/* & */:
  4705. case 0x2A/* * */:
  4706. case 0x2B/* + */:
  4707. case 0x2D/* - */:
  4708. case 0x3A/* : */:
  4709. case 0x3C/* < */:
  4710. case 0x3D/* = */:
  4711. case 0x3E/* > */:
  4712. case 0x40/* @ */:
  4713. case 0x5B/* [ */:
  4714. case 0x5C/* \ */:
  4715. case 0x5D/* ] */:
  4716. case 0x5E/* ^ */:
  4717. case 0x5F/* _ */:
  4718. case 0x60/* ` */:
  4719. case 0x7B/* { */:
  4720. case 0x7D/* } */:
  4721. case 0x7E/* ~ */:
  4722. return true;
  4723. default:
  4724. return false;
  4725. }
  4726. }
  4727. module.exports = function text(state, silent) {
  4728. var pos = state.pos;
  4729. while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
  4730. pos++;
  4731. }
  4732. if (pos === state.pos) { return false; }
  4733. if (!silent) { state.pending += state.src.slice(state.pos, pos); }
  4734. state.pos = pos;
  4735. return true;
  4736. };
  4737. // Alternative implementation, for memory.
  4738. //
  4739. // It costs 10% of performance, but allows extend terminators list, if place it
  4740. // to `ParcerInline` property. Probably, will switch to it sometime, such
  4741. // flexibility required.
  4742. /*
  4743. var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
  4744. module.exports = function text(state, silent) {
  4745. var pos = state.pos,
  4746. idx = state.src.slice(pos).search(TERMINATOR_RE);
  4747. // first char is terminator -> empty text
  4748. if (idx === 0) { return false; }
  4749. // no terminator -> text till end of string
  4750. if (idx < 0) {
  4751. if (!silent) { state.pending += state.src.slice(pos); }
  4752. state.pos = state.src.length;
  4753. return true;
  4754. }
  4755. if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
  4756. state.pos += idx;
  4757. return true;
  4758. };*/
  4759. },{}],50:[function(require,module,exports){
  4760. // Clean up tokens after emphasis and strikethrough postprocessing:
  4761. // merge adjacent text nodes into one and re-calculate all token levels
  4762. //
  4763. // This is necessary because initially emphasis delimiter markers (*, _, ~)
  4764. // are treated as their own separate text tokens. Then emphasis rule either
  4765. // leaves them as text (needed to merge with adjacent text) or turns them
  4766. // into opening/closing tags (which messes up levels inside).
  4767. //
  4768. 'use strict';
  4769. module.exports = function text_collapse(state) {
  4770. var curr, last,
  4771. level = 0,
  4772. tokens = state.tokens,
  4773. max = state.tokens.length;
  4774. for (curr = last = 0; curr < max; curr++) {
  4775. // re-calculate levels after emphasis/strikethrough turns some text nodes
  4776. // into opening/closing tags
  4777. if (tokens[curr].nesting < 0) level--; // closing tag
  4778. tokens[curr].level = level;
  4779. if (tokens[curr].nesting > 0) level++; // opening tag
  4780. if (tokens[curr].type === 'text' &&
  4781. curr + 1 < max &&
  4782. tokens[curr + 1].type === 'text') {
  4783. // collapse two adjacent text nodes
  4784. tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
  4785. } else {
  4786. if (curr !== last) { tokens[last] = tokens[curr]; }
  4787. last++;
  4788. }
  4789. }
  4790. if (curr !== last) {
  4791. tokens.length = last;
  4792. }
  4793. };
  4794. },{}],51:[function(require,module,exports){
  4795. // Token class
  4796. 'use strict';
  4797. /**
  4798. * class Token
  4799. **/
  4800. /**
  4801. * new Token(type, tag, nesting)
  4802. *
  4803. * Create new token and fill passed properties.
  4804. **/
  4805. function Token(type, tag, nesting) {
  4806. /**
  4807. * Token#type -> String
  4808. *
  4809. * Type of the token (string, e.g. "paragraph_open")
  4810. **/
  4811. this.type = type;
  4812. /**
  4813. * Token#tag -> String
  4814. *
  4815. * html tag name, e.g. "p"
  4816. **/
  4817. this.tag = tag;
  4818. /**
  4819. * Token#attrs -> Array
  4820. *
  4821. * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
  4822. **/
  4823. this.attrs = null;
  4824. /**
  4825. * Token#map -> Array
  4826. *
  4827. * Source map info. Format: `[ line_begin, line_end ]`
  4828. **/
  4829. this.map = null;
  4830. /**
  4831. * Token#nesting -> Number
  4832. *
  4833. * Level change (number in {-1, 0, 1} set), where:
  4834. *
  4835. * - `1` means the tag is opening
  4836. * - `0` means the tag is self-closing
  4837. * - `-1` means the tag is closing
  4838. **/
  4839. this.nesting = nesting;
  4840. /**
  4841. * Token#level -> Number
  4842. *
  4843. * nesting level, the same as `state.level`
  4844. **/
  4845. this.level = 0;
  4846. /**
  4847. * Token#children -> Array
  4848. *
  4849. * An array of child nodes (inline and img tokens)
  4850. **/
  4851. this.children = null;
  4852. /**
  4853. * Token#content -> String
  4854. *
  4855. * In a case of self-closing tag (code, html, fence, etc.),
  4856. * it has contents of this tag.
  4857. **/
  4858. this.content = '';
  4859. /**
  4860. * Token#markup -> String
  4861. *
  4862. * '*' or '_' for emphasis, fence string for fence, etc.
  4863. **/
  4864. this.markup = '';
  4865. /**
  4866. * Token#info -> String
  4867. *
  4868. * fence infostring
  4869. **/
  4870. this.info = '';
  4871. /**
  4872. * Token#meta -> Object
  4873. *
  4874. * A place for plugins to store an arbitrary data
  4875. **/
  4876. this.meta = null;
  4877. /**
  4878. * Token#block -> Boolean
  4879. *
  4880. * True for block-level tokens, false for inline tokens.
  4881. * Used in renderer to calculate line breaks
  4882. **/
  4883. this.block = false;
  4884. /**
  4885. * Token#hidden -> Boolean
  4886. *
  4887. * If it's true, ignore this element when rendering. Used for tight lists
  4888. * to hide paragraphs.
  4889. **/
  4890. this.hidden = false;
  4891. }
  4892. /**
  4893. * Token.attrIndex(name) -> Number
  4894. *
  4895. * Search attribute index by name.
  4896. **/
  4897. Token.prototype.attrIndex = function attrIndex(name) {
  4898. var attrs, i, len;
  4899. if (!this.attrs) { return -1; }
  4900. attrs = this.attrs;
  4901. for (i = 0, len = attrs.length; i < len; i++) {
  4902. if (attrs[i][0] === name) { return i; }
  4903. }
  4904. return -1;
  4905. };
  4906. /**
  4907. * Token.attrPush(attrData)
  4908. *
  4909. * Add `[ name, value ]` attribute to list. Init attrs if necessary
  4910. **/
  4911. Token.prototype.attrPush = function attrPush(attrData) {
  4912. if (this.attrs) {
  4913. this.attrs.push(attrData);
  4914. } else {
  4915. this.attrs = [ attrData ];
  4916. }
  4917. };
  4918. /**
  4919. * Token.attrSet(name, value)
  4920. *
  4921. * Set `name` attribute to `value`. Override old value if exists.
  4922. **/
  4923. Token.prototype.attrSet = function attrSet(name, value) {
  4924. var idx = this.attrIndex(name),
  4925. attrData = [ name, value ];
  4926. if (idx < 0) {
  4927. this.attrPush(attrData);
  4928. } else {
  4929. this.attrs[idx] = attrData;
  4930. }
  4931. };
  4932. /**
  4933. * Token.attrGet(name)
  4934. *
  4935. * Get the value of attribute `name`, or null if it does not exist.
  4936. **/
  4937. Token.prototype.attrGet = function attrGet(name) {
  4938. var idx = this.attrIndex(name), value = null;
  4939. if (idx >= 0) {
  4940. value = this.attrs[idx][1];
  4941. }
  4942. return value;
  4943. };
  4944. /**
  4945. * Token.attrJoin(name, value)
  4946. *
  4947. * Join value to existing attribute via space. Or create new attribute if not
  4948. * exists. Useful to operate with token classes.
  4949. **/
  4950. Token.prototype.attrJoin = function attrJoin(name, value) {
  4951. var idx = this.attrIndex(name);
  4952. if (idx < 0) {
  4953. this.attrPush([ name, value ]);
  4954. } else {
  4955. this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;
  4956. }
  4957. };
  4958. module.exports = Token;
  4959. },{}],52:[function(require,module,exports){
  4960. module.exports={ "Aacute": "\u00C1", "aacute": "\u00E1", "Abreve": "\u0102", "abreve": "\u0103", "ac": "\u223E", "acd": "\u223F", "acE": "\u223E\u0333", "Acirc": "\u00C2", "acirc": "\u00E2", "acute": "\u00B4", "Acy": "\u0410", "acy": "\u0430", "AElig": "\u00C6", "aelig": "\u00E6", "af": "\u2061", "Afr": "\uD835\uDD04", "afr": "\uD835\uDD1E", "Agrave": "\u00C0", "agrave": "\u00E0", "alefsym": "\u2135", "aleph": "\u2135", "Alpha": "\u0391", "alpha": "\u03B1", "Amacr": "\u0100", "amacr": "\u0101", "amalg": "\u2A3F", "amp": "&", "AMP": "&", "andand": "\u2A55", "And": "\u2A53", "and": "\u2227", "andd": "\u2A5C", "andslope": "\u2A58", "andv": "\u2A5A", "ang": "\u2220", "ange": "\u29A4", "angle": "\u2220", "angmsdaa": "\u29A8", "angmsdab": "\u29A9", "angmsdac": "\u29AA", "angmsdad": "\u29AB", "angmsdae": "\u29AC", "angmsdaf": "\u29AD", "angmsdag": "\u29AE", "angmsdah": "\u29AF", "angmsd": "\u2221", "angrt": "\u221F", "angrtvb": "\u22BE", "angrtvbd": "\u299D", "angsph": "\u2222", "angst": "\u00C5", "angzarr": "\u237C", "Aogon": "\u0104", "aogon": "\u0105", "Aopf": "\uD835\uDD38", "aopf": "\uD835\uDD52", "apacir": "\u2A6F", "ap": "\u2248", "apE": "\u2A70", "ape": "\u224A", "apid": "\u224B", "apos": "'", "ApplyFunction": "\u2061", "approx": "\u2248", "approxeq": "\u224A", "Aring": "\u00C5", "aring": "\u00E5", "Ascr": "\uD835\uDC9C", "ascr": "\uD835\uDCB6", "Assign": "\u2254", "ast": "*", "asymp": "\u2248", "asympeq": "\u224D", "Atilde": "\u00C3", "atilde": "\u00E3", "Auml": "\u00C4", "auml": "\u00E4", "awconint": "\u2233", "awint": "\u2A11", "backcong": "\u224C", "backepsilon": "\u03F6", "backprime": "\u2035", "backsim": "\u223D", "backsimeq": "\u22CD", "Backslash": "\u2216", "Barv": "\u2AE7", "barvee": "\u22BD", "barwed": "\u2305", "Barwed": "\u2306", "barwedge": "\u2305", "bbrk": "\u23B5", "bbrktbrk": "\u23B6", "bcong": "\u224C", "Bcy": "\u0411", "bcy": "\u0431", "bdquo": "\u201E", "becaus": "\u2235", "because": "\u2235", "Because": "\u2235", "bemptyv": "\u29B0", "bepsi": "\u03F6", "bernou": "\u212C", "Bernoullis": "\u212C", "Beta": "\u0392", "beta": "\u03B2", "beth": "\u2136", "between": "\u226C", "Bfr": "\uD835\uDD05", "bfr": "\uD835\uDD1F", "bigcap": "\u22C2", "bigcirc": "\u25EF", "bigcup": "\u22C3", "bigodot": "\u2A00", "bigoplus": "\u2A01", "bigotimes": "\u2A02", "bigsqcup": "\u2A06", "bigstar": "\u2605", "bigtriangledown": "\u25BD", "bigtriangleup": "\u25B3", "biguplus": "\u2A04", "bigvee": "\u22C1", "bigwedge": "\u22C0", "bkarow": "\u290D", "blacklozenge": "\u29EB", "blacksquare": "\u25AA", "blacktriangle": "\u25B4", "blacktriangledown": "\u25BE", "blacktriangleleft": "\u25C2", "blacktriangleright": "\u25B8", "blank": "\u2423", "blk12": "\u2592", "blk14": "\u2591", "blk34": "\u2593", "block": "\u2588", "bne": "=\u20E5", "bnequiv": "\u2261\u20E5", "bNot": "\u2AED", "bnot": "\u2310", "Bopf": "\uD835\uDD39", "bopf": "\uD835\uDD53", "bot": "\u22A5", "bottom": "\u22A5", "bowtie": "\u22C8", "boxbox": "\u29C9", "boxdl": "\u2510", "boxdL": "\u2555", "boxDl": "\u2556", "boxDL": "\u2557", "boxdr": "\u250C", "boxdR": "\u2552", "boxDr": "\u2553", "boxDR": "\u2554", "boxh": "\u2500", "boxH": "\u2550", "boxhd": "\u252C", "boxHd": "\u2564", "boxhD": "\u2565", "boxHD": "\u2566", "boxhu": "\u2534", "boxHu": "\u2567", "boxhU": "\u2568", "boxHU": "\u2569", "boxminus": "\u229F", "boxplus": "\u229E", "boxtimes": "\u22A0", "boxul": "\u2518", "boxuL": "\u255B", "boxUl": "\u255C", "boxUL": "\u255D", "boxur": "\u2514", "boxuR": "\u2558", "boxUr": "\u2559", "boxUR": "\u255A", "boxv": "\u2502", "boxV": "\u2551", "boxvh": "\u253C", "boxvH": "\u256A", "boxVh": "\u256B", "boxVH": "\u256C", "boxvl": "\u2524", "boxvL": "\u2561", "boxVl": "\u2562", "boxVL": "\u2563", "boxvr": "\u251C", "boxvR": "\u255E", "boxVr": "\u255F", "boxVR": "\u2560", "bprime": "\u2035", "breve": "\u02D8", "Breve": "\u02D8", "brvbar": "\u00A6", "bscr": "\uD835\uDCB7", "Bscr": "\u212C", "bsemi": "\u204F", "bsim": "\u223D", "bsime": "\u22CD", "bsolb": "\u29C5", "bsol": "\\", "bsolhsub": "\u27C8", "bull": "\u2022", "bullet": "\u2022", "bump": "\u224E", "bumpE": "\u2AAE", "bumpe": "\u224F", "Bumpeq": "\u224E", "bumpeq": "\u224F", "Cacute": "\u0106", "cacute": "\u0107", "capand": "\u2A44", "capbrcup": "\u2A49", "capcap": "\u2A4B", "cap": "\u2229", "Cap": "\u22D2", "capcup": "\u2A47", "capdot": "\u2A40", "CapitalDifferentialD": "\u2145", "caps": "\u2229\uFE00", "caret": "\u2041", "caron": "\u02C7", "Cayleys": "\u212D", "ccaps": "\u2A4D", "Ccaron": "\u010C", "ccaron": "\u010D", "Ccedil": "\u00C7", "ccedil": "\u00E7", "Ccirc": "\u0108", "ccirc": "\u0109", "Cconint": "\u2230", "ccups": "\u2A4C", "ccupssm": "\u2A50", "Cdot": "\u010A", "cdot": "\u010B", "cedil": "\u00B8", "Cedilla": "\u00B8", "cemptyv": "\u29B2", "cent": "\u00A2", "centerdot": "\u00B7", "CenterDot": "\u00B7", "cfr": "\uD835\uDD20", "Cfr": "\u212D", "CHcy": "\u0427", "chcy": "\u0447", "check": "\u2713", "checkmark": "\u2713", "Chi": "\u03A7", "chi": "\u03C7", "circ": "\u02C6", "circeq": "\u2257", "circlearrowleft": "\u21BA", "circlearrowright": "\u21BB", "circledast": "\u229B", "circledcirc": "\u229A", "circleddash": "\u229D", "CircleDot": "\u2299", "circledR": "\u00AE", "circledS": "\u24C8", "CircleMinus": "\u2296", "CirclePlus": "\u2295", "CircleTimes": "\u2297", "cir": "\u25CB", "cirE": "\u29C3", "cire": "\u2257", "cirfnint": "\u2A10", "cirmid": "\u2AEF", "cirscir": "\u29C2", "ClockwiseContourIntegral": "\u2232", "CloseCurlyDoubleQuote": "\u201D", "CloseCurlyQuote": "\u2019", "clubs": "\u2663", "clubsuit": "\u2663", "colon": ":", "Colon": "\u2237", "Colone": "\u2A74", "colone": "\u2254", "coloneq": "\u2254", "comma": ",", "commat": "@", "comp": "\u2201", "compfn": "\u2218", "complement": "\u2201", "complexes": "\u2102", "cong": "\u2245", "congdot": "\u2A6D", "Congruent": "\u2261", "conint": "\u222E", "Conint": "\u222F", "ContourIntegral": "\u222E", "copf": "\uD835\uDD54", "Copf": "\u2102", "coprod": "\u2210", "Coproduct": "\u2210", "copy": "\u00A9", "COPY": "\u00A9", "copysr": "\u2117", "CounterClockwiseContourIntegral": "\u2233", "crarr": "\u21B5", "cross": "\u2717", "Cross": "\u2A2F", "Cscr": "\uD835\uDC9E", "cscr": "\uD835\uDCB8", "csub": "\u2ACF", "csube": "\u2AD1", "csup": "\u2AD0", "csupe": "\u2AD2", "ctdot": "\u22EF", "cudarrl": "\u2938", "cudarrr": "\u2935", "cuepr": "\u22DE", "cuesc": "\u22DF", "cularr": "\u21B6", "cularrp": "\u293D", "cupbrcap": "\u2A48", "cupcap": "\u2A46", "CupCap": "\u224D", "cup": "\u222A", "Cup": "\u22D3", "cupcup": "\u2A4A", "cupdot": "\u228D", "cupor": "\u2A45", "cups": "\u222A\uFE00", "curarr": "\u21B7", "curarrm": "\u293C", "curlyeqprec": "\u22DE", "curlyeqsucc": "\u22DF", "curlyvee": "\u22CE", "curlywedge": "\u22CF", "curren": "\u00A4", "curvearrowleft": "\u21B6", "curvearrowright": "\u21B7", "cuvee": "\u22CE", "cuwed": "\u22CF", "cwconint": "\u2232", "cwint": "\u2231", "cylcty": "\u232D", "dagger": "\u2020", "Dagger": "\u2021", "daleth": "\u2138", "darr": "\u2193", "Darr": "\u21A1", "dArr": "\u21D3", "dash": "\u2010", "Dashv": "\u2AE4", "dashv": "\u22A3", "dbkarow": "\u290F", "dblac": "\u02DD", "Dcaron": "\u010E", "dcaron": "\u010F", "Dcy": "\u0414", "dcy": "\u0434", "ddagger": "\u2021", "ddarr": "\u21CA", "DD": "\u2145", "dd": "\u2146", "DDotrahd": "\u2911", "ddotseq": "\u2A77", "deg": "\u00B0", "Del": "\u2207", "Delta": "\u0394", "delta": "\u03B4", "demptyv": "\u29B1", "dfisht": "\u297F", "Dfr": "\uD835\uDD07", "dfr": "\uD835\uDD21", "dHar": "\u2965", "dharl": "\u21C3", "dharr": "\u21C2", "DiacriticalAcute": "\u00B4", "DiacriticalDot": "\u02D9", "DiacriticalDoubleAcute": "\u02DD", "DiacriticalGrave": "`", "DiacriticalTilde": "\u02DC", "diam": "\u22C4", "diamond": "\u22C4", "Diamond": "\u22C4", "diamondsuit": "\u2666", "diams": "\u2666", "die": "\u00A8", "DifferentialD": "\u2146", "digamma": "\u03DD", "disin": "\u22F2", "div": "\u00F7", "divide": "\u00F7", "divideontimes": "\u22C7", "divonx": "\u22C7", "DJcy": "\u0402", "djcy": "\u0452", "dlcorn": "\u231E", "dlcrop": "\u230D", "dollar": "$", "Dopf": "\uD835\uDD3B", "dopf": "\uD835\uDD55", "Dot": "\u00A8", "dot": "\u02D9", "DotDot": "\u20DC", "doteq": "\u2250", "doteqdot": "\u2251", "DotEqual": "\u2250", "dotminus": "\u2238", "dotplus": "\u2214", "dotsquare": "\u22A1", "doublebarwedge": "\u2306", "DoubleContourIntegral": "\u222F", "DoubleDot": "\u00A8", "DoubleDownArrow": "\u21D3", "DoubleLeftArrow": "\u21D0", "DoubleLeftRightArrow": "\u21D4", "DoubleLeftTee": "\u2AE4", "DoubleLongLeftArrow": "\u27F8", "DoubleLongLeftRightArrow": "\u27FA", "DoubleLongRightArrow": "\u27F9", "DoubleRightArrow": "\u21D2", "DoubleRightTee": "\u22A8", "DoubleUpArrow": "\u21D1", "DoubleUpDownArrow": "\u21D5", "DoubleVerticalBar": "\u2225", "DownArrowBar": "\u2913", "downarrow": "\u2193", "DownArrow": "\u2193", "Downarrow": "\u21D3", "DownArrowUpArrow": "\u21F5", "DownBreve": "\u0311", "downdownarrows": "\u21CA", "downharpoonleft": "\u21C3", "downharpoonright": "\u21C2", "DownLeftRightVector": "\u2950", "DownLeftTeeVector": "\u295E", "DownLeftVectorBar": "\u2956", "DownLeftVector": "\u21BD", "DownRightTeeVector": "\u295F", "DownRightVectorBar": "\u2957", "DownRightVector": "\u21C1", "DownTeeArrow": "\u21A7", "DownTee": "\u22A4", "drbkarow": "\u2910", "drcorn": "\u231F", "drcrop": "\u230C", "Dscr": "\uD835\uDC9F", "dscr": "\uD835\uDCB9", "DScy": "\u0405", "dscy": "\u0455", "dsol": "\u29F6", "Dstrok": "\u0110", "dstrok": "\u0111", "dtdot": "\u22F1", "dtri": "\u25BF", "dtrif": "\u25BE", "duarr": "\u21F5", "duhar": "\u296F", "dwangle": "\u29A6", "DZcy": "\u040F", "dzcy": "\u045F", "dzigrarr": "\u27FF", "Eacute": "\u00C9", "eacute": "\u00E9", "easter": "\u2A6E", "Ecaron": "\u011A", "ecaron": "\u011B", "Ecirc": "\u00CA", "ecirc": "\u00EA", "ecir": "\u2256", "ecolon": "\u2255", "Ecy": "\u042D", "ecy": "\u044D", "eDDot": "\u2A77", "Edot": "\u0116", "edot": "\u0117", "eDot": "\u2251", "ee": "\u2147", "efDot": "\u2252", "Efr": "\uD835\uDD08", "efr": "\uD835\uDD22", "eg": "\u2A9A", "Egrave": "\u00C8", "egrave": "\u00E8", "egs": "\u2A96", "egsdot": "\u2A98", "el": "\u2A99", "Element": "\u2208", "elinters": "\u23E7", "ell": "\u2113", "els": "\u2A95", "elsdot": "\u2A97", "Emacr": "\u0112", "emacr": "\u0113", "empty": "\u2205", "emptyset": "\u2205", "EmptySmallSquare": "\u25FB", "emptyv": "\u2205", "EmptyVerySmallSquare": "\u25AB", "emsp13": "\u2004", "emsp14": "\u2005", "emsp": "\u2003", "ENG": "\u014A", "eng": "\u014B", "ensp": "\u2002", "Eogon": "\u0118", "eogon": "\u0119", "Eopf": "\uD835\uDD3C", "eopf": "\uD835\uDD56", "epar": "\u22D5", "eparsl": "\u29E3", "eplus": "\u2A71", "epsi": "\u03B5", "Epsilon": "\u0395", "epsilon": "\u03B5", "epsiv": "\u03F5", "eqcirc": "\u2256", "eqcolon": "\u2255", "eqsim": "\u2242", "eqslantgtr": "\u2A96", "eqslantless": "\u2A95", "Equal": "\u2A75", "equals": "=", "EqualTilde": "\u2242", "equest": "\u225F", "Equilibrium": "\u21CC", "equiv": "\u2261", "equivDD": "\u2A78", "eqvparsl": "\u29E5", "erarr": "\u2971", "erDot": "\u2253", "escr": "\u212F", "Escr": "\u2130", "esdot": "\u2250", "Esim": "\u2A73", "esim": "\u2242", "Eta": "\u0397", "eta": "\u03B7", "ETH": "\u00D0", "eth": "\u00F0", "Euml": "\u00CB", "euml": "\u00EB", "euro": "\u20AC", "excl": "!", "exist": "\u2203", "Exists": "\u2203", "expectation": "\u2130", "exponentiale": "\u2147", "ExponentialE": "\u2147", "fallingdotseq": "\u2252", "Fcy": "\u0424", "fcy": "\u0444", "female": "\u2640", "ffilig": "\uFB03", "fflig": "\uFB00", "ffllig": "\uFB04", "Ffr": "\uD835\uDD09", "ffr": "\uD835\uDD23", "filig": "\uFB01", "FilledSmallSquare": "\u25FC", "FilledVerySmallSquare": "\u25AA", "fjlig": "fj", "flat": "\u266D", "fllig": "\uFB02", "fltns": "\u25B1", "fnof": "\u0192", "Fopf": "\uD835\uDD3D", "fopf": "\uD835\uDD57", "forall": "\u2200", "ForAll": "\u2200", "fork": "\u22D4", "forkv": "\u2AD9", "Fouriertrf": "\u2131", "fpartint": "\u2A0D", "frac12": "\u00BD", "frac13": "\u2153", "frac14": "\u00BC", "frac15": "\u2155", "frac16": "\u2159", "frac18": "\u215B", "frac23": "\u2154", "frac25": "\u2156", "frac34": "\u00BE", "frac35": "\u2157", "frac38": "\u215C", "frac45": "\u2158", "frac56": "\u215A", "frac58": "\u215D", "frac78": "\u215E", "frasl": "\u2044", "frown": "\u2322", "fscr": "\uD835\uDCBB", "Fscr": "\u2131", "gacute": "\u01F5", "Gamma": "\u0393", "gamma": "\u03B3", "Gammad": "\u03DC", "gammad": "\u03DD", "gap": "\u2A86", "Gbreve": "\u011E", "gbreve": "\u011F", "Gcedil": "\u0122", "Gcirc": "\u011C", "gcirc": "\u011D", "Gcy": "\u0413", "gcy": "\u0433", "Gdot": "\u0120", "gdot": "\u0121", "ge": "\u2265", "gE": "\u2267", "gEl": "\u2A8C", "gel": "\u22DB", "geq": "\u2265", "geqq": "\u2267", "geqslant": "\u2A7E", "gescc": "\u2AA9", "ges": "\u2A7E", "gesdot": "\u2A80", "gesdoto": "\u2A82", "gesdotol": "\u2A84", "gesl": "\u22DB\uFE00", "gesles": "\u2A94", "Gfr": "\uD835\uDD0A", "gfr": "\uD835\uDD24", "gg": "\u226B", "Gg": "\u22D9", "ggg": "\u22D9", "gimel": "\u2137", "GJcy": "\u0403", "gjcy": "\u0453", "gla": "\u2AA5", "gl": "\u2277", "glE": "\u2A92", "glj": "\u2AA4", "gnap": "\u2A8A", "gnapprox": "\u2A8A", "gne": "\u2A88", "gnE": "\u2269", "gneq": "\u2A88", "gneqq": "\u2269", "gnsim": "\u22E7", "Gopf": "\uD835\uDD3E", "gopf": "\uD835\uDD58", "grave": "`", "GreaterEqual": "\u2265", "GreaterEqualLess": "\u22DB", "GreaterFullEqual": "\u2267", "GreaterGreater": "\u2AA2", "GreaterLess": "\u2277", "GreaterSlantEqual": "\u2A7E", "GreaterTilde": "\u2273", "Gscr": "\uD835\uDCA2", "gscr": "\u210A", "gsim": "\u2273", "gsime": "\u2A8E", "gsiml": "\u2A90", "gtcc": "\u2AA7", "gtcir": "\u2A7A", "gt": ">", "GT": ">", "Gt": "\u226B", "gtdot": "\u22D7", "gtlPar": "\u2995", "gtquest": "\u2A7C", "gtrapprox": "\u2A86", "gtrarr": "\u2978", "gtrdot": "\u22D7", "gtreqless": "\u22DB", "gtreqqless": "\u2A8C", "gtrless": "\u2277", "gtrsim": "\u2273", "gvertneqq": "\u2269\uFE00", "gvnE": "\u2269\uFE00", "Hacek": "\u02C7", "hairsp": "\u200A", "half": "\u00BD", "hamilt": "\u210B", "HARDcy": "\u042A", "hardcy": "\u044A", "harrcir": "\u2948", "harr": "\u2194", "hArr": "\u21D4", "harrw": "\u21AD", "Hat": "^", "hbar": "\u210F", "Hcirc": "\u0124", "hcirc": "\u0125", "hearts": "\u2665", "heartsuit": "\u2665", "hellip": "\u2026", "hercon": "\u22B9", "hfr": "\uD835\uDD25", "Hfr": "\u210C", "HilbertSpace": "\u210B", "hksearow": "\u2925", "hkswarow": "\u2926", "hoarr": "\u21FF", "homtht": "\u223B", "hookleftarrow": "\u21A9", "hookrightarrow": "\u21AA", "hopf": "\uD835\uDD59", "Hopf": "\u210D", "horbar": "\u2015", "HorizontalLine": "\u2500", "hscr": "\uD835\uDCBD", "Hscr": "\u210B", "hslash": "\u210F", "Hstrok": "\u0126", "hstrok": "\u0127", "HumpDownHump": "\u224E", "HumpEqual": "\u224F", "hybull": "\u2043", "hyphen": "\u2010", "Iacute": "\u00CD", "iacute": "\u00ED", "ic": "\u2063", "Icirc": "\u00CE", "icirc": "\u00EE", "Icy": "\u0418", "icy": "\u0438", "Idot": "\u0130", "IEcy": "\u0415", "iecy": "\u0435", "iexcl": "\u00A1", "iff": "\u21D4", "ifr": "\uD835\uDD26", "Ifr": "\u2111", "Igrave": "\u00CC", "igrave": "\u00EC", "ii": "\u2148", "iiiint": "\u2A0C", "iiint": "\u222D", "iinfin": "\u29DC", "iiota": "\u2129", "IJlig": "\u0132", "ijlig": "\u0133", "Imacr": "\u012A", "imacr": "\u012B", "image": "\u2111", "ImaginaryI": "\u2148", "imagline": "\u2110", "imagpart": "\u2111", "imath": "\u0131", "Im": "\u2111", "imof": "\u22B7", "imped": "\u01B5", "Implies": "\u21D2", "incare": "\u2105", "in": "\u2208", "infin": "\u221E", "infintie": "\u29DD", "inodot": "\u0131", "intcal": "\u22BA", "int": "\u222B", "Int": "\u222C", "integers": "\u2124", "Integral": "\u222B", "intercal": "\u22BA", "Intersection": "\u22C2", "intlarhk": "\u2A17", "intprod": "\u2A3C", "InvisibleComma": "\u2063", "InvisibleTimes": "\u2062", "IOcy": "\u0401", "iocy": "\u0451", "Iogon": "\u012E", "iogon": "\u012F", "Iopf": "\uD835\uDD40", "iopf": "\uD835\uDD5A", "Iota": "\u0399", "iota": "\u03B9", "iprod": "\u2A3C", "iquest": "\u00BF", "iscr": "\uD835\uDCBE", "Iscr": "\u2110", "isin": "\u2208", "isindot": "\u22F5", "isinE": "\u22F9", "isins": "\u22F4", "isinsv": "\u22F3", "isinv": "\u2208", "it": "\u2062", "Itilde": "\u0128", "itilde": "\u0129", "Iukcy": "\u0406", "iukcy": "\u0456", "Iuml": "\u00CF", "iuml": "\u00EF", "Jcirc": "\u0134", "jcirc": "\u0135", "Jcy": "\u0419", "jcy": "\u0439", "Jfr": "\uD835\uDD0D", "jfr": "\uD835\uDD27", "jmath": "\u0237", "Jopf": "\uD835\uDD41", "jopf": "\uD835\uDD5B", "Jscr": "\uD835\uDCA5", "jscr": "\uD835\uDCBF", "Jsercy": "\u0408", "jsercy": "\u0458", "Jukcy": "\u0404", "jukcy": "\u0454", "Kappa": "\u039A", "kappa": "\u03BA", "kappav": "\u03F0", "Kcedil": "\u0136", "kcedil": "\u0137", "Kcy": "\u041A", "kcy": "\u043A", "Kfr": "\uD835\uDD0E", "kfr": "\uD835\uDD28", "kgreen": "\u0138", "KHcy": "\u0425", "khcy": "\u0445", "KJcy": "\u040C", "kjcy": "\u045C", "Kopf": "\uD835\uDD42", "kopf": "\uD835\uDD5C", "Kscr": "\uD835\uDCA6", "kscr": "\uD835\uDCC0", "lAarr": "\u21DA", "Lacute": "\u0139", "lacute": "\u013A", "laemptyv": "\u29B4", "lagran": "\u2112", "Lambda": "\u039B", "lambda": "\u03BB", "lang": "\u27E8", "Lang": "\u27EA", "langd": "\u2991", "langle": "\u27E8", "lap": "\u2A85", "Laplacetrf": "\u2112", "laquo": "\u00AB", "larrb": "\u21E4", "larrbfs": "\u291F", "larr": "\u2190", "Larr": "\u219E", "lArr": "\u21D0", "larrfs": "\u291D", "larrhk": "\u21A9", "larrlp": "\u21AB", "larrpl": "\u2939", "larrsim": "\u2973", "larrtl": "\u21A2", "latail": "\u2919", "lAtail": "\u291B", "lat": "\u2AAB", "late": "\u2AAD", "lates": "\u2AAD\uFE00", "lbarr": "\u290C", "lBarr": "\u290E", "lbbrk": "\u2772", "lbrace": "{", "lbrack": "[", "lbrke": "\u298B", "lbrksld": "\u298F", "lbrkslu": "\u298D", "Lcaron": "\u013D", "lcaron": "\u013E", "Lcedil": "\u013B", "lcedil": "\u013C", "lceil": "\u2308", "lcub": "{", "Lcy": "\u041B", "lcy": "\u043B", "ldca": "\u2936", "ldquo": "\u201C", "ldquor": "\u201E", "ldrdhar": "\u2967", "ldrushar": "\u294B", "ldsh": "\u21B2", "le": "\u2264", "lE": "\u2266", "LeftAngleBracket": "\u27E8", "LeftArrowBar": "\u21E4", "leftarrow": "\u2190", "LeftArrow": "\u2190", "Leftarrow": "\u21D0", "LeftArrowRightArrow": "\u21C6", "leftarrowtail": "\u21A2", "LeftCeiling": "\u2308", "LeftDoubleBracket": "\u27E6", "LeftDownTeeVector": "\u2961", "LeftDownVectorBar": "\u2959", "LeftDownVector": "\u21C3", "LeftFloor": "\u230A", "leftharpoondown": "\u21BD", "leftharpoonup": "\u21BC", "leftleftarrows": "\u21C7", "leftrightarrow": "\u2194", "LeftRightArrow": "\u2194", "Leftrightarrow": "\u21D4", "leftrightarrows": "\u21C6", "leftrightharpoons": "\u21CB", "leftrightsquigarrow": "\u21AD", "LeftRightVector": "\u294E", "LeftTeeArrow": "\u21A4", "LeftTee": "\u22A3", "LeftTeeVector": "\u295A", "leftthreetimes": "\u22CB", "LeftTriangleBar": "\u29CF", "LeftTriangle": "\u22B2", "LeftTriangleEqual": "\u22B4", "LeftUpDownVector": "\u2951", "LeftUpTeeVector": "\u2960", "LeftUpVectorBar": "\u2958", "LeftUpVector": "\u21BF", "LeftVectorBar": "\u2952", "LeftVector": "\u21BC", "lEg": "\u2A8B", "leg": "\u22DA", "leq": "\u2264", "leqq": "\u2266", "leqslant": "\u2A7D", "lescc": "\u2AA8", "les": "\u2A7D", "lesdot": "\u2A7F", "lesdoto": "\u2A81", "lesdotor": "\u2A83", "lesg": "\u22DA\uFE00", "lesges": "\u2A93", "lessapprox": "\u2A85", "lessdot": "\u22D6", "lesseqgtr": "\u22DA", "lesseqqgtr": "\u2A8B", "LessEqualGreater": "\u22DA", "LessFullEqual": "\u2266", "LessGreater": "\u2276", "lessgtr": "\u2276", "LessLess": "\u2AA1", "lesssim": "\u2272", "LessSlantEqual": "\u2A7D", "LessTilde": "\u2272", "lfisht": "\u297C", "lfloor": "\u230A", "Lfr": "\uD835\uDD0F", "lfr": "\uD835\uDD29", "lg": "\u2276", "lgE": "\u2A91", "lHar": "\u2962", "lhard": "\u21BD", "lharu": "\u21BC", "lharul": "\u296A", "lhblk": "\u2584", "LJcy": "\u0409", "ljcy": "\u0459", "llarr": "\u21C7", "ll": "\u226A", "Ll": "\u22D8", "llcorner": "\u231E", "Lleftarrow": "\u21DA", "llhard": "\u296B", "lltri": "\u25FA", "Lmidot": "\u013F", "lmidot": "\u0140", "lmoustache": "\u23B0", "lmoust": "\u23B0", "lnap": "\u2A89", "lnapprox": "\u2A89", "lne": "\u2A87", "lnE": "\u2268", "lneq": "\u2A87", "lneqq": "\u2268", "lnsim": "\u22E6", "loang": "\u27EC", "loarr": "\u21FD", "lobrk": "\u27E6", "longleftarrow": "\u27F5", "LongLeftArrow": "\u27F5", "Longleftarrow": "\u27F8", "longleftrightarrow": "\u27F7", "LongLeftRightArrow": "\u27F7", "Longleftrightarrow": "\u27FA", "longmapsto": "\u27FC", "longrightarrow": "\u27F6", "LongRightArrow": "\u27F6", "Longrightarrow": "\u27F9", "looparrowleft": "\u21AB", "looparrowright": "\u21AC", "lopar": "\u2985", "Lopf": "\uD835\uDD43", "lopf": "\uD835\uDD5D", "loplus": "\u2A2D", "lotimes": "\u2A34", "lowast": "\u2217", "lowbar": "_", "LowerLeftArrow": "\u2199", "LowerRightArrow": "\u2198", "loz": "\u25CA", "lozenge": "\u25CA", "lozf": "\u29EB", "lpar": "(", "lparlt": "\u2993", "lrarr": "\u21C6", "lrcorner": "\u231F", "lrhar": "\u21CB", "lrhard": "\u296D", "lrm": "\u200E", "lrtri": "\u22BF", "lsaquo": "\u2039", "lscr": "\uD835\uDCC1", "Lscr": "\u2112", "lsh": "\u21B0", "Lsh": "\u21B0", "lsim": "\u2272", "lsime": "\u2A8D", "lsimg": "\u2A8F", "lsqb": "[", "lsquo": "\u2018", "lsquor": "\u201A", "Lstrok": "\u0141", "lstrok": "\u0142", "ltcc": "\u2AA6", "ltcir": "\u2A79", "lt": "<", "LT": "<", "Lt": "\u226A", "ltdot": "\u22D6", "lthree": "\u22CB", "ltimes": "\u22C9", "ltlarr": "\u2976", "ltquest": "\u2A7B", "ltri": "\u25C3", "ltrie": "\u22B4", "ltrif": "\u25C2", "ltrPar": "\u2996", "lurdshar": "\u294A", "luruhar": "\u2966", "lvertneqq": "\u2268\uFE00", "lvnE": "\u2268\uFE00", "macr": "\u00AF", "male": "\u2642", "malt": "\u2720", "maltese": "\u2720", "Map": "\u2905", "map": "\u21A6", "mapsto": "\u21A6", "mapstodown": "\u21A7", "mapstoleft": "\u21A4", "mapstoup": "\u21A5", "marker": "\u25AE", "mcomma": "\u2A29", "Mcy": "\u041C", "mcy": "\u043C", "mdash": "\u2014", "mDDot": "\u223A", "measuredangle": "\u2221", "MediumSpace": "\u205F", "Mellintrf": "\u2133", "Mfr": "\uD835\uDD10", "mfr": "\uD835\uDD2A", "mho": "\u2127", "micro": "\u00B5", "midast": "*", "midcir": "\u2AF0", "mid": "\u2223", "middot": "\u00B7", "minusb": "\u229F", "minus": "\u2212", "minusd": "\u2238", "minusdu": "\u2A2A", "MinusPlus": "\u2213", "mlcp": "\u2ADB", "mldr": "\u2026", "mnplus": "\u2213", "models": "\u22A7", "Mopf": "\uD835\uDD44", "mopf": "\uD835\uDD5E", "mp": "\u2213", "mscr": "\uD835\uDCC2", "Mscr": "\u2133", "mstpos": "\u223E", "Mu": "\u039C", "mu": "\u03BC", "multimap": "\u22B8", "mumap": "\u22B8", "nabla": "\u2207", "Nacute": "\u0143", "nacute": "\u0144", "nang": "\u2220\u20D2", "nap": "\u2249", "napE": "\u2A70\u0338", "napid": "\u224B\u0338", "napos": "\u0149", "napprox": "\u2249", "natural": "\u266E", "naturals": "\u2115", "natur": "\u266E", "nbsp": "\u00A0", "nbump": "\u224E\u0338", "nbumpe": "\u224F\u0338", "ncap": "\u2A43", "Ncaron": "\u0147", "ncaron": "\u0148", "Ncedil": "\u0145", "ncedil": "\u0146", "ncong": "\u2247", "ncongdot": "\u2A6D\u0338", "ncup": "\u2A42", "Ncy": "\u041D", "ncy": "\u043D", "ndash": "\u2013", "nearhk": "\u2924", "nearr": "\u2197", "neArr": "\u21D7", "nearrow": "\u2197", "ne": "\u2260", "nedot": "\u2250\u0338", "NegativeMediumSpace": "\u200B", "NegativeThickSpace": "\u200B", "NegativeThinSpace": "\u200B", "NegativeVeryThinSpace": "\u200B", "nequiv": "\u2262", "nesear": "\u2928", "nesim": "\u2242\u0338", "NestedGreaterGreater": "\u226B", "NestedLessLess": "\u226A", "NewLine": "\n", "nexist": "\u2204", "nexists": "\u2204", "Nfr": "\uD835\uDD11", "nfr": "\uD835\uDD2B", "ngE": "\u2267\u0338", "nge": "\u2271", "ngeq": "\u2271", "ngeqq": "\u2267\u0338", "ngeqslant": "\u2A7E\u0338", "nges": "\u2A7E\u0338", "nGg": "\u22D9\u0338", "ngsim": "\u2275", "nGt": "\u226B\u20D2", "ngt": "\u226F", "ngtr": "\u226F", "nGtv": "\u226B\u0338", "nharr": "\u21AE", "nhArr": "\u21CE", "nhpar": "\u2AF2", "ni": "\u220B", "nis": "\u22FC", "nisd": "\u22FA", "niv": "\u220B", "NJcy": "\u040A", "njcy": "\u045A", "nlarr": "\u219A", "nlArr": "\u21CD", "nldr": "\u2025", "nlE": "\u2266\u0338", "nle": "\u2270", "nleftarrow": "\u219A", "nLeftarrow": "\u21CD", "nleftrightarrow": "\u21AE", "nLeftrightarrow": "\u21CE", "nleq": "\u2270", "nleqq": "\u2266\u0338", "nleqslant": "\u2A7D\u0338", "nles": "\u2A7D\u0338", "nless": "\u226E", "nLl": "\u22D8\u0338", "nlsim": "\u2274", "nLt": "\u226A\u20D2", "nlt": "\u226E", "nltri": "\u22EA", "nltrie": "\u22EC", "nLtv": "\u226A\u0338", "nmid": "\u2224", "NoBreak": "\u2060", "NonBreakingSpace": "\u00A0", "nopf": "\uD835\uDD5F", "Nopf": "\u2115", "Not": "\u2AEC", "not": "\u00AC", "NotCongruent": "\u2262", "NotCupCap": "\u226D", "NotDoubleVerticalBar": "\u2226", "NotElement": "\u2209", "NotEqual": "\u2260", "NotEqualTilde": "\u2242\u0338", "NotExists": "\u2204", "NotGreater": "\u226F", "NotGreaterEqual": "\u2271", "NotGreaterFullEqual": "\u2267\u0338", "NotGreaterGreater": "\u226B\u0338", "NotGreaterLess": "\u2279", "NotGreaterSlantEqual": "\u2A7E\u0338", "NotGreaterTilde": "\u2275", "NotHumpDownHump": "\u224E\u0338", "NotHumpEqual": "\u224F\u0338", "notin": "\u2209", "notindot": "\u22F5\u0338", "notinE": "\u22F9\u0338", "notinva": "\u2209", "notinvb": "\u22F7", "notinvc": "\u22F6", "NotLeftTriangleBar": "\u29CF\u0338", "NotLeftTriangle": "\u22EA", "NotLeftTriangleEqual": "\u22EC", "NotLess": "\u226E", "NotLessEqual": "\u2270", "NotLessGreater": "\u2278", "NotLessLess": "\u226A\u0338", "NotLessSlantEqual": "\u2A7D\u0338", "NotLessTilde": "\u2274", "NotNestedGreaterGreater": "\u2AA2\u0338", "NotNestedLessLess": "\u2AA1\u0338", "notni": "\u220C", "notniva": "\u220C", "notnivb": "\u22FE", "notnivc": "\u22FD", "NotPrecedes": "\u2280", "NotPrecedesEqual": "\u2AAF\u0338", "NotPrecedesSlantEqual": "\u22E0", "NotReverseElement": "\u220C", "NotRightTriangleBar": "\u29D0\u0338", "NotRightTriangle": "\u22EB", "NotRightTriangleEqual": "\u22ED", "NotSquareSubset": "\u228F\u0338", "NotSquareSubsetEqual": "\u22E2", "NotSquareSuperset": "\u2290\u0338", "NotSquareSupersetEqual": "\u22E3", "NotSubset": "\u2282\u20D2", "NotSubsetEqual": "\u2288", "NotSucceeds": "\u2281", "NotSucceedsEqual": "\u2AB0\u0338", "NotSucceedsSlantEqual": "\u22E1", "NotSucceedsTilde": "\u227F\u0338", "NotSuperset": "\u2283\u20D2", "NotSupersetEqual": "\u2289", "NotTilde": "\u2241", "NotTildeEqual": "\u2244", "NotTildeFullEqual": "\u2247", "NotTildeTilde": "\u2249", "NotVerticalBar": "\u2224", "nparallel": "\u2226", "npar": "\u2226", "nparsl": "\u2AFD\u20E5", "npart": "\u2202\u0338", "npolint": "\u2A14", "npr": "\u2280", "nprcue": "\u22E0", "nprec": "\u2280", "npreceq": "\u2AAF\u0338", "npre": "\u2AAF\u0338", "nrarrc": "\u2933\u0338", "nrarr": "\u219B", "nrArr": "\u21CF", "nrarrw": "\u219D\u0338", "nrightarrow": "\u219B", "nRightarrow": "\u21CF", "nrtri": "\u22EB", "nrtrie": "\u22ED", "nsc": "\u2281", "nsccue": "\u22E1", "nsce": "\u2AB0\u0338", "Nscr": "\uD835\uDCA9", "nscr": "\uD835\uDCC3", "nshortmid": "\u2224", "nshortparallel": "\u2226", "nsim": "\u2241", "nsime": "\u2244", "nsimeq": "\u2244", "nsmid": "\u2224", "nspar": "\u2226", "nsqsube": "\u22E2", "nsqsupe": "\u22E3", "nsub": "\u2284", "nsubE": "\u2AC5\u0338", "nsube": "\u2288", "nsubset": "\u2282\u20D2", "nsubseteq": "\u2288", "nsubseteqq": "\u2AC5\u0338", "nsucc": "\u2281", "nsucceq": "\u2AB0\u0338", "nsup": "\u2285", "nsupE": "\u2AC6\u0338", "nsupe": "\u2289", "nsupset": "\u2283\u20D2", "nsupseteq": "\u2289", "nsupseteqq": "\u2AC6\u0338", "ntgl": "\u2279", "Ntilde": "\u00D1", "ntilde": "\u00F1", "ntlg": "\u2278", "ntriangleleft": "\u22EA", "ntrianglelefteq": "\u22EC", "ntriangleright": "\u22EB", "ntrianglerighteq": "\u22ED", "Nu": "\u039D", "nu": "\u03BD", "num": "#", "numero": "\u2116", "numsp": "\u2007", "nvap": "\u224D\u20D2", "nvdash": "\u22AC", "nvDash": "\u22AD", "nVdash": "\u22AE", "nVDash": "\u22AF", "nvge": "\u2265\u20D2", "nvgt": ">\u20D2", "nvHarr": "\u2904", "nvinfin": "\u29DE", "nvlArr": "\u2902", "nvle": "\u2264\u20D2", "nvlt": "<\u20D2", "nvltrie": "\u22B4\u20D2", "nvrArr": "\u2903", "nvrtrie": "\u22B5\u20D2", "nvsim": "\u223C\u20D2", "nwarhk": "\u2923", "nwarr": "\u2196", "nwArr": "\u21D6", "nwarrow": "\u2196", "nwnear": "\u2927", "Oacute": "\u00D3", "oacute": "\u00F3", "oast": "\u229B", "Ocirc": "\u00D4", "ocirc": "\u00F4", "ocir": "\u229A", "Ocy": "\u041E", "ocy": "\u043E", "odash": "\u229D", "Odblac": "\u0150", "odblac": "\u0151", "odiv": "\u2A38", "odot": "\u2299", "odsold": "\u29BC", "OElig": "\u0152", "oelig": "\u0153", "ofcir": "\u29BF", "Ofr": "\uD835\uDD12", "ofr": "\uD835\uDD2C", "ogon": "\u02DB", "Ograve": "\u00D2", "ograve": "\u00F2", "ogt": "\u29C1", "ohbar": "\u29B5", "ohm": "\u03A9", "oint": "\u222E", "olarr": "\u21BA", "olcir": "\u29BE", "olcross": "\u29BB", "oline": "\u203E", "olt": "\u29C0", "Omacr": "\u014C", "omacr": "\u014D", "Omega": "\u03A9", "omega": "\u03C9", "Omicron": "\u039F", "omicron": "\u03BF", "omid": "\u29B6", "ominus": "\u2296", "Oopf": "\uD835\uDD46", "oopf": "\uD835\uDD60", "opar": "\u29B7", "OpenCurlyDoubleQuote": "\u201C", "OpenCurlyQuote": "\u2018", "operp": "\u29B9", "oplus": "\u2295", "orarr": "\u21BB", "Or": "\u2A54", "or": "\u2228", "ord": "\u2A5D", "order": "\u2134", "orderof": "\u2134", "ordf": "\u00AA", "ordm": "\u00BA", "origof": "\u22B6", "oror": "\u2A56", "orslope": "\u2A57", "orv": "\u2A5B", "oS": "\u24C8", "Oscr": "\uD835\uDCAA", "oscr": "\u2134", "Oslash": "\u00D8", "oslash": "\u00F8", "osol": "\u2298", "Otilde": "\u00D5", "otilde": "\u00F5", "otimesas": "\u2A36", "Otimes": "\u2A37", "otimes": "\u2297", "Ouml": "\u00D6", "ouml": "\u00F6", "ovbar": "\u233D", "OverBar": "\u203E", "OverBrace": "\u23DE", "OverBracket": "\u23B4", "OverParenthesis": "\u23DC", "para": "\u00B6", "parallel": "\u2225", "par": "\u2225", "parsim": "\u2AF3", "parsl": "\u2AFD", "part": "\u2202", "PartialD": "\u2202", "Pcy": "\u041F", "pcy": "\u043F", "percnt": "%", "period": ".", "permil": "\u2030", "perp": "\u22A5", "pertenk": "\u2031", "Pfr": "\uD835\uDD13", "pfr": "\uD835\uDD2D", "Phi": "\u03A6", "phi": "\u03C6", "phiv": "\u03D5", "phmmat": "\u2133", "phone": "\u260E", "Pi": "\u03A0", "pi": "\u03C0", "pitchfork": "\u22D4", "piv": "\u03D6", "planck": "\u210F", "planckh": "\u210E", "plankv": "\u210F", "plusacir": "\u2A23", "plusb": "\u229E", "pluscir": "\u2A22", "plus": "+", "plusdo": "\u2214", "plusdu": "\u2A25", "pluse": "\u2A72", "PlusMinus": "\u00B1", "plusmn": "\u00B1", "plussim": "\u2A26", "plustwo": "\u2A27", "pm": "\u00B1", "Poincareplane": "\u210C", "pointint": "\u2A15", "popf": "\uD835\uDD61", "Popf": "\u2119", "pound": "\u00A3", "prap": "\u2AB7", "Pr": "\u2ABB", "pr": "\u227A", "prcue": "\u227C", "precapprox": "\u2AB7", "prec": "\u227A", "preccurlyeq": "\u227C", "Precedes": "\u227A", "PrecedesEqual": "\u2AAF", "PrecedesSlantEqual": "\u227C", "PrecedesTilde": "\u227E", "preceq": "\u2AAF", "precnapprox": "\u2AB9", "precneqq": "\u2AB5", "precnsim": "\u22E8", "pre": "\u2AAF", "prE": "\u2AB3", "precsim": "\u227E", "prime": "\u2032", "Prime": "\u2033", "primes": "\u2119", "prnap": "\u2AB9", "prnE": "\u2AB5", "prnsim": "\u22E8", "prod": "\u220F", "Product": "\u220F", "profalar": "\u232E", "profline": "\u2312", "profsurf": "\u2313", "prop": "\u221D", "Proportional": "\u221D", "Proportion": "\u2237", "propto": "\u221D", "prsim": "\u227E", "prurel": "\u22B0", "Pscr": "\uD835\uDCAB", "pscr": "\uD835\uDCC5", "Psi": "\u03A8", "psi": "\u03C8", "puncsp": "\u2008", "Qfr": "\uD835\uDD14", "qfr": "\uD835\uDD2E", "qint": "\u2A0C", "qopf": "\uD835\uDD62", "Qopf": "\u211A", "qprime": "\u2057", "Qscr": "\uD835\uDCAC", "qscr": "\uD835\uDCC6", "quaternions": "\u210D", "quatint": "\u2A16", "quest": "?", "questeq": "\u225F", "quot": "\"", "QUOT": "\"", "rAarr": "\u21DB", "race": "\u223D\u0331", "Racute": "\u0154", "racute": "\u0155", "radic": "\u221A", "raemptyv": "\u29B3", "rang": "\u27E9", "Rang": "\u27EB", "rangd": "\u2992", "range": "\u29A5", "rangle": "\u27E9", "raquo": "\u00BB", "rarrap": "\u2975", "rarrb": "\u21E5", "rarrbfs": "\u2920", "rarrc": "\u2933", "rarr": "\u2192", "Rarr": "\u21A0", "rArr": "\u21D2", "rarrfs": "\u291E", "rarrhk": "\u21AA", "rarrlp": "\u21AC", "rarrpl": "\u2945", "rarrsim": "\u2974", "Rarrtl": "\u2916", "rarrtl": "\u21A3", "rarrw": "\u219D", "ratail": "\u291A", "rAtail": "\u291C", "ratio": "\u2236", "rationals": "\u211A", "rbarr": "\u290D", "rBarr": "\u290F", "RBarr": "\u2910", "rbbrk": "\u2773", "rbrace": "}", "rbrack": "]", "rbrke": "\u298C", "rbrksld": "\u298E", "rbrkslu": "\u2990", "Rcaron": "\u0158", "rcaron": "\u0159", "Rcedil": "\u0156", "rcedil": "\u0157", "rceil": "\u2309", "rcub": "}", "Rcy": "\u0420", "rcy": "\u0440", "rdca": "\u2937", "rdldhar": "\u2969", "rdquo": "\u201D", "rdquor": "\u201D", "rdsh": "\u21B3", "real": "\u211C", "realine": "\u211B", "realpart": "\u211C", "reals": "\u211D", "Re": "\u211C", "rect": "\u25AD", "reg": "\u00AE", "REG": "\u00AE", "ReverseElement": "\u220B", "ReverseEquilibrium": "\u21CB", "ReverseUpEquilibrium": "\u296F", "rfisht": "\u297D", "rfloor": "\u230B", "rfr": "\uD835\uDD2F", "Rfr": "\u211C", "rHar": "\u2964", "rhard": "\u21C1", "rharu": "\u21C0", "rharul": "\u296C", "Rho": "\u03A1", "rho": "\u03C1", "rhov": "\u03F1", "RightAngleBracket": "\u27E9", "RightArrowBar": "\u21E5", "rightarrow": "\u2192", "RightArrow": "\u2192", "Rightarrow": "\u21D2", "RightArrowLeftArrow": "\u21C4", "rightarrowtail": "\u21A3", "RightCeiling": "\u2309", "RightDoubleBracket": "\u27E7", "RightDownTeeVector": "\u295D", "RightDownVectorBar": "\u2955", "RightDownVector": "\u21C2", "RightFloor": "\u230B", "rightharpoondown": "\u21C1", "rightharpoonup": "\u21C0", "rightleftarrows": "\u21C4", "rightleftharpoons": "\u21CC", "rightrightarrows": "\u21C9", "rightsquigarrow": "\u219D", "RightTeeArrow": "\u21A6", "RightTee": "\u22A2", "RightTeeVector": "\u295B", "rightthreetimes": "\u22CC", "RightTriangleBar": "\u29D0", "RightTriangle": "\u22B3", "RightTriangleEqual": "\u22B5", "RightUpDownVector": "\u294F", "RightUpTeeVector": "\u295C", "RightUpVectorBar": "\u2954", "RightUpVector": "\u21BE", "RightVectorBar": "\u2953", "RightVector": "\u21C0", "ring": "\u02DA", "risingdotseq": "\u2253", "rlarr": "\u21C4", "rlhar": "\u21CC", "rlm": "\u200F", "rmoustache": "\u23B1", "rmoust": "\u23B1", "rnmid": "\u2AEE", "roang": "\u27ED", "roarr": "\u21FE", "robrk": "\u27E7", "ropar": "\u2986", "ropf": "\uD835\uDD63", "Ropf": "\u211D", "roplus": "\u2A2E", "rotimes": "\u2A35", "RoundImplies": "\u2970", "rpar": ")", "rpargt": "\u2994", "rppolint": "\u2A12", "rrarr": "\u21C9", "Rrightarrow": "\u21DB", "rsaquo": "\u203A", "rscr": "\uD835\uDCC7", "Rscr": "\u211B", "rsh": "\u21B1", "Rsh": "\u21B1", "rsqb": "]", "rsquo": "\u2019", "rsquor": "\u2019", "rthree": "\u22CC", "rtimes": "\u22CA", "rtri": "\u25B9", "rtrie": "\u22B5", "rtrif": "\u25B8", "rtriltri": "\u29CE", "RuleDelayed": "\u29F4", "ruluhar": "\u2968", "rx": "\u211E", "Sacute": "\u015A", "sacute": "\u015B", "sbquo": "\u201A", "scap": "\u2AB8", "Scaron": "\u0160", "scaron": "\u0161", "Sc": "\u2ABC", "sc": "\u227B", "sccue": "\u227D", "sce": "\u2AB0", "scE": "\u2AB4", "Scedil": "\u015E", "scedil": "\u015F", "Scirc": "\u015C", "scirc": "\u015D", "scnap": "\u2ABA", "scnE": "\u2AB6", "scnsim": "\u22E9", "scpolint": "\u2A13", "scsim": "\u227F", "Scy": "\u0421", "scy": "\u0441", "sdotb": "\u22A1", "sdot": "\u22C5", "sdote": "\u2A66", "searhk": "\u2925", "searr": "\u2198", "seArr": "\u21D8", "searrow": "\u2198", "sect": "\u00A7", "semi": ";", "seswar": "\u2929", "setminus": "\u2216", "setmn": "\u2216", "sext": "\u2736", "Sfr": "\uD835\uDD16", "sfr": "\uD835\uDD30", "sfrown": "\u2322", "sharp": "\u266F", "SHCHcy": "\u0429", "shchcy": "\u0449", "SHcy": "\u0428", "shcy": "\u0448", "ShortDownArrow": "\u2193", "ShortLeftArrow": "\u2190", "shortmid": "\u2223", "shortparallel": "\u2225", "ShortRightArrow": "\u2192", "ShortUpArrow": "\u2191", "shy": "\u00AD", "Sigma": "\u03A3", "sigma": "\u03C3", "sigmaf": "\u03C2", "sigmav": "\u03C2", "sim": "\u223C", "simdot": "\u2A6A", "sime": "\u2243", "simeq": "\u2243", "simg": "\u2A9E", "simgE": "\u2AA0", "siml": "\u2A9D", "simlE": "\u2A9F", "simne": "\u2246", "simplus": "\u2A24", "simrarr": "\u2972", "slarr": "\u2190", "SmallCircle": "\u2218", "smallsetminus": "\u2216", "smashp": "\u2A33", "smeparsl": "\u29E4", "smid": "\u2223", "smile": "\u2323", "smt": "\u2AAA", "smte": "\u2AAC", "smtes": "\u2AAC\uFE00", "SOFTcy": "\u042C", "softcy": "\u044C", "solbar": "\u233F", "solb": "\u29C4", "sol": "/", "Sopf": "\uD835\uDD4A", "sopf": "\uD835\uDD64", "spades": "\u2660", "spadesuit": "\u2660", "spar": "\u2225", "sqcap": "\u2293", "sqcaps": "\u2293\uFE00", "sqcup": "\u2294", "sqcups": "\u2294\uFE00", "Sqrt": "\u221A", "sqsub": "\u228F", "sqsube": "\u2291", "sqsubset": "\u228F", "sqsubseteq": "\u2291", "sqsup": "\u2290", "sqsupe": "\u2292", "sqsupset": "\u2290", "sqsupseteq": "\u2292", "square": "\u25A1", "Square": "\u25A1", "SquareIntersection": "\u2293", "SquareSubset": "\u228F", "SquareSubsetEqual": "\u2291", "SquareSuperset": "\u2290", "SquareSupersetEqual": "\u2292", "SquareUnion": "\u2294", "squarf": "\u25AA", "squ": "\u25A1", "squf": "\u25AA", "srarr": "\u2192", "Sscr": "\uD835\uDCAE", "sscr": "\uD835\uDCC8", "ssetmn": "\u2216", "ssmile": "\u2323", "sstarf": "\u22C6", "Star": "\u22C6", "star": "\u2606", "starf": "\u2605", "straightepsilon": "\u03F5", "straightphi": "\u03D5", "strns": "\u00AF", "sub": "\u2282", "Sub": "\u22D0", "subdot": "\u2ABD", "subE": "\u2AC5", "sube": "\u2286", "subedot": "\u2AC3", "submult": "\u2AC1", "subnE": "\u2ACB", "subne": "\u228A", "subplus": "\u2ABF", "subrarr": "\u2979", "subset": "\u2282", "Subset": "\u22D0", "subseteq": "\u2286", "subseteqq": "\u2AC5", "SubsetEqual": "\u2286", "subsetneq": "\u228A", "subsetneqq": "\u2ACB", "subsim": "\u2AC7", "subsub": "\u2AD5", "subsup": "\u2AD3", "succapprox": "\u2AB8", "succ": "\u227B", "succcurlyeq": "\u227D", "Succeeds": "\u227B", "SucceedsEqual": "\u2AB0", "SucceedsSlantEqual": "\u227D", "SucceedsTilde": "\u227F", "succeq": "\u2AB0", "succnapprox": "\u2ABA", "succneqq": "\u2AB6", "succnsim": "\u22E9", "succsim": "\u227F", "SuchThat": "\u220B", "sum": "\u2211", "Sum": "\u2211", "sung": "\u266A", "sup1": "\u00B9", "sup2": "\u00B2", "sup3": "\u00B3", "sup": "\u2283", "Sup": "\u22D1", "supdot": "\u2ABE", "supdsub": "\u2AD8", "supE": "\u2AC6", "supe": "\u2287", "supedot": "\u2AC4", "Superset": "\u2283", "SupersetEqual": "\u2287", "suphsol": "\u27C9", "suphsub": "\u2AD7", "suplarr": "\u297B", "supmult": "\u2AC2", "supnE": "\u2ACC", "supne": "\u228B", "supplus": "\u2AC0", "supset": "\u2283", "Supset": "\u22D1", "supseteq": "\u2287", "supseteqq": "\u2AC6", "supsetneq": "\u228B", "supsetneqq": "\u2ACC", "supsim": "\u2AC8", "supsub": "\u2AD4", "supsup": "\u2AD6", "swarhk": "\u2926", "swarr": "\u2199", "swArr": "\u21D9", "swarrow": "\u2199", "swnwar": "\u292A", "szlig": "\u00DF", "Tab": "\t", "target": "\u2316", "Tau": "\u03A4", "tau": "\u03C4", "tbrk": "\u23B4", "Tcaron": "\u0164", "tcaron": "\u0165", "Tcedil": "\u0162", "tcedil": "\u0163", "Tcy": "\u0422", "tcy": "\u0442", "tdot": "\u20DB", "telrec": "\u2315", "Tfr": "\uD835\uDD17", "tfr": "\uD835\uDD31", "there4": "\u2234", "therefore": "\u2234", "Therefore": "\u2234", "Theta": "\u0398", "theta": "\u03B8", "thetasym": "\u03D1", "thetav": "\u03D1", "thickapprox": "\u2248", "thicksim": "\u223C", "ThickSpace": "\u205F\u200A", "ThinSpace": "\u2009", "thinsp": "\u2009", "thkap": "\u2248", "thksim": "\u223C", "THORN": "\u00DE", "thorn": "\u00FE", "tilde": "\u02DC", "Tilde": "\u223C", "TildeEqual": "\u2243", "TildeFullEqual": "\u2245", "TildeTilde": "\u2248", "timesbar": "\u2A31", "timesb": "\u22A0", "times": "\u00D7", "timesd": "\u2A30", "tint": "\u222D", "toea": "\u2928", "topbot": "\u2336", "topcir": "\u2AF1", "top": "\u22A4", "Topf": "\uD835\uDD4B", "topf": "\uD835\uDD65", "topfork": "\u2ADA", "tosa": "\u2929", "tprime": "\u2034", "trade": "\u2122", "TRADE": "\u2122", "triangle": "\u25B5", "triangledown": "\u25BF", "triangleleft": "\u25C3", "trianglelefteq": "\u22B4", "triangleq": "\u225C", "triangleright": "\u25B9", "trianglerighteq": "\u22B5", "tridot": "\u25EC", "trie": "\u225C", "triminus": "\u2A3A", "TripleDot": "\u20DB", "triplus": "\u2A39", "trisb": "\u29CD", "tritime": "\u2A3B", "trpezium": "\u23E2", "Tscr": "\uD835\uDCAF", "tscr": "\uD835\uDCC9", "TScy": "\u0426", "tscy": "\u0446", "TSHcy": "\u040B", "tshcy": "\u045B", "Tstrok": "\u0166", "tstrok": "\u0167", "twixt": "\u226C", "twoheadleftarrow": "\u219E", "twoheadrightarrow": "\u21A0", "Uacute": "\u00DA", "uacute": "\u00FA", "uarr": "\u2191", "Uarr": "\u219F", "uArr": "\u21D1", "Uarrocir": "\u2949", "Ubrcy": "\u040E", "ubrcy": "\u045E", "Ubreve": "\u016C", "ubreve": "\u016D", "Ucirc": "\u00DB", "ucirc": "\u00FB", "Ucy": "\u0423", "ucy": "\u0443", "udarr": "\u21C5", "Udblac": "\u0170", "udblac": "\u0171", "udhar": "\u296E", "ufisht": "\u297E", "Ufr": "\uD835\uDD18", "ufr": "\uD835\uDD32", "Ugrave": "\u00D9", "ugrave": "\u00F9", "uHar": "\u2963", "uharl": "\u21BF", "uharr": "\u21BE", "uhblk": "\u2580", "ulcorn": "\u231C", "ulcorner": "\u231C", "ulcrop": "\u230F", "ultri": "\u25F8", "Umacr": "\u016A", "umacr": "\u016B", "uml": "\u00A8", "UnderBar": "_", "UnderBrace": "\u23DF", "UnderBracket": "\u23B5", "UnderParenthesis": "\u23DD", "Union": "\u22C3", "UnionPlus": "\u228E", "Uogon": "\u0172", "uogon": "\u0173", "Uopf": "\uD835\uDD4C", "uopf": "\uD835\uDD66", "UpArrowBar": "\u2912", "uparrow": "\u2191", "UpArrow": "\u2191", "Uparrow": "\u21D1", "UpArrowDownArrow": "\u21C5", "updownarrow": "\u2195", "UpDownArrow": "\u2195", "Updownarrow": "\u21D5", "UpEquilibrium": "\u296E", "upharpoonleft": "\u21BF", "upharpoonright": "\u21BE", "uplus": "\u228E", "UpperLeftArrow": "\u2196", "UpperRightArrow": "\u2197", "upsi": "\u03C5", "Upsi": "\u03D2", "upsih": "\u03D2", "Upsilon": "\u03A5", "upsilon": "\u03C5", "UpTeeArrow": "\u21A5", "UpTee": "\u22A5", "upuparrows": "\u21C8", "urcorn": "\u231D", "urcorner": "\u231D", "urcrop": "\u230E", "Uring": "\u016E", "uring": "\u016F", "urtri": "\u25F9", "Uscr": "\uD835\uDCB0", "uscr": "\uD835\uDCCA", "utdot": "\u22F0", "Utilde": "\u0168", "utilde": "\u0169", "utri": "\u25B5", "utrif": "\u25B4", "uuarr": "\u21C8", "Uuml": "\u00DC", "uuml": "\u00FC", "uwangle": "\u29A7", "vangrt": "\u299C", "varepsilon": "\u03F5", "varkappa": "\u03F0", "varnothing": "\u2205", "varphi": "\u03D5", "varpi": "\u03D6", "varpropto": "\u221D", "varr": "\u2195", "vArr": "\u21D5", "varrho": "\u03F1", "varsigma": "\u03C2", "varsubsetneq": "\u228A\uFE00", "varsubsetneqq": "\u2ACB\uFE00", "varsupsetneq": "\u228B\uFE00", "varsupsetneqq": "\u2ACC\uFE00", "vartheta": "\u03D1", "vartriangleleft": "\u22B2", "vartriangleright": "\u22B3", "vBar": "\u2AE8", "Vbar": "\u2AEB", "vBarv": "\u2AE9", "Vcy": "\u0412", "vcy": "\u0432", "vdash": "\u22A2", "vDash": "\u22A8", "Vdash": "\u22A9", "VDash": "\u22AB", "Vdashl": "\u2AE6", "veebar": "\u22BB", "vee": "\u2228", "Vee": "\u22C1", "veeeq": "\u225A", "vellip": "\u22EE", "verbar": "|", "Verbar": "\u2016", "vert": "|", "Vert": "\u2016", "VerticalBar": "\u2223", "VerticalLine": "|", "VerticalSeparator": "\u2758", "VerticalTilde": "\u2240", "VeryThinSpace": "\u200A", "Vfr": "\uD835\uDD19", "vfr": "\uD835\uDD33", "vltri": "\u22B2", "vnsub": "\u2282\u20D2", "vnsup": "\u2283\u20D2", "Vopf": "\uD835\uDD4D", "vopf": "\uD835\uDD67", "vprop": "\u221D", "vrtri": "\u22B3", "Vscr": "\uD835\uDCB1", "vscr": "\uD835\uDCCB", "vsubnE": "\u2ACB\uFE00", "vsubne": "\u228A\uFE00", "vsupnE": "\u2ACC\uFE00", "vsupne": "\u228B\uFE00", "Vvdash": "\u22AA", "vzigzag": "\u299A", "Wcirc": "\u0174", "wcirc": "\u0175", "wedbar": "\u2A5F", "wedge": "\u2227", "Wedge": "\u22C0", "wedgeq": "\u2259", "weierp": "\u2118", "Wfr": "\uD835\uDD1A", "wfr": "\uD835\uDD34", "Wopf": "\uD835\uDD4E", "wopf": "\uD835\uDD68", "wp": "\u2118", "wr": "\u2240", "wreath": "\u2240", "Wscr": "\uD835\uDCB2", "wscr": "\uD835\uDCCC", "xcap": "\u22C2", "xcirc": "\u25EF", "xcup": "\u22C3", "xdtri": "\u25BD", "Xfr": "\uD835\uDD1B", "xfr": "\uD835\uDD35", "xharr": "\u27F7", "xhArr": "\u27FA", "Xi": "\u039E", "xi": "\u03BE", "xlarr": "\u27F5", "xlArr": "\u27F8", "xmap": "\u27FC", "xnis": "\u22FB", "xodot": "\u2A00", "Xopf": "\uD835\uDD4F", "xopf": "\uD835\uDD69", "xoplus": "\u2A01", "xotime": "\u2A02", "xrarr": "\u27F6", "xrArr": "\u27F9", "Xscr": "\uD835\uDCB3", "xscr": "\uD835\uDCCD", "xsqcup": "\u2A06", "xuplus": "\u2A04", "xutri": "\u25B3", "xvee": "\u22C1", "xwedge": "\u22C0", "Yacute": "\u00DD", "yacute": "\u00FD", "YAcy": "\u042F", "yacy": "\u044F", "Ycirc": "\u0176", "ycirc": "\u0177", "Ycy": "\u042B", "ycy": "\u044B", "yen": "\u00A5", "Yfr": "\uD835\uDD1C", "yfr": "\uD835\uDD36", "YIcy": "\u0407", "yicy": "\u0457", "Yopf": "\uD835\uDD50", "yopf": "\uD835\uDD6A", "Yscr": "\uD835\uDCB4", "yscr": "\uD835\uDCCE", "YUcy": "\u042E", "yucy": "\u044E", "yuml": "\u00FF", "Yuml": "\u0178", "Zacute": "\u0179", "zacute": "\u017A", "Zcaron": "\u017D", "zcaron": "\u017E", "Zcy": "\u0417", "zcy": "\u0437", "Zdot": "\u017B", "zdot": "\u017C", "zeetrf": "\u2128", "ZeroWidthSpace": "\u200B", "Zeta": "\u0396", "zeta": "\u03B6", "zfr": "\uD835\uDD37", "Zfr": "\u2128", "ZHcy": "\u0416", "zhcy": "\u0436", "zigrarr": "\u21DD", "zopf": "\uD835\uDD6B", "Zopf": "\u2124", "Zscr": "\uD835\uDCB5", "zscr": "\uD835\uDCCF", "zwj": "\u200D", "zwnj": "\u200C" }
  4961. },{}],53:[function(require,module,exports){
  4962. 'use strict';
  4963. ////////////////////////////////////////////////////////////////////////////////
  4964. // Helpers
  4965. // Merge objects
  4966. //
  4967. function assign(obj /*from1, from2, from3, ...*/) {
  4968. var sources = Array.prototype.slice.call(arguments, 1);
  4969. sources.forEach(function (source) {
  4970. if (!source) { return; }
  4971. Object.keys(source).forEach(function (key) {
  4972. obj[key] = source[key];
  4973. });
  4974. });
  4975. return obj;
  4976. }
  4977. function _class(obj) { return Object.prototype.toString.call(obj); }
  4978. function isString(obj) { return _class(obj) === '[object String]'; }
  4979. function isObject(obj) { return _class(obj) === '[object Object]'; }
  4980. function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
  4981. function isFunction(obj) { return _class(obj) === '[object Function]'; }
  4982. function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
  4983. ////////////////////////////////////////////////////////////////////////////////
  4984. var defaultOptions = {
  4985. fuzzyLink: true,
  4986. fuzzyEmail: true,
  4987. fuzzyIP: false
  4988. };
  4989. function isOptionsObj(obj) {
  4990. return Object.keys(obj || {}).reduce(function (acc, k) {
  4991. return acc || defaultOptions.hasOwnProperty(k);
  4992. }, false);
  4993. }
  4994. var defaultSchemas = {
  4995. 'http:': {
  4996. validate: function (text, pos, self) {
  4997. var tail = text.slice(pos);
  4998. if (!self.re.http) {
  4999. // compile lazily, because "host"-containing variables can change on tlds update.
  5000. self.re.http = new RegExp(
  5001. '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
  5002. );
  5003. }
  5004. if (self.re.http.test(tail)) {
  5005. return tail.match(self.re.http)[0].length;
  5006. }
  5007. return 0;
  5008. }
  5009. },
  5010. 'https:': 'http:',
  5011. 'ftp:': 'http:',
  5012. '//': {
  5013. validate: function (text, pos, self) {
  5014. var tail = text.slice(pos);
  5015. if (!self.re.no_http) {
  5016. // compile lazily, because "host"-containing variables can change on tlds update.
  5017. self.re.no_http = new RegExp(
  5018. '^' +
  5019. self.re.src_auth +
  5020. // Don't allow single-level domains, because of false positives like '//test'
  5021. // with code comments
  5022. '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
  5023. self.re.src_port +
  5024. self.re.src_host_terminator +
  5025. self.re.src_path,
  5026. 'i'
  5027. );
  5028. }
  5029. if (self.re.no_http.test(tail)) {
  5030. // should not be `://` & `///`, that protects from errors in protocol name
  5031. if (pos >= 3 && text[pos - 3] === ':') { return 0; }
  5032. if (pos >= 3 && text[pos - 3] === '/') { return 0; }
  5033. return tail.match(self.re.no_http)[0].length;
  5034. }
  5035. return 0;
  5036. }
  5037. },
  5038. 'mailto:': {
  5039. validate: function (text, pos, self) {
  5040. var tail = text.slice(pos);
  5041. if (!self.re.mailto) {
  5042. self.re.mailto = new RegExp(
  5043. '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
  5044. );
  5045. }
  5046. if (self.re.mailto.test(tail)) {
  5047. return tail.match(self.re.mailto)[0].length;
  5048. }
  5049. return 0;
  5050. }
  5051. }
  5052. };
  5053. /*eslint-disable max-len*/
  5054. // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
  5055. var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
  5056. // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
  5057. var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
  5058. /*eslint-enable max-len*/
  5059. ////////////////////////////////////////////////////////////////////////////////
  5060. function resetScanCache(self) {
  5061. self.__index__ = -1;
  5062. self.__text_cache__ = '';
  5063. }
  5064. function createValidator(re) {
  5065. return function (text, pos) {
  5066. var tail = text.slice(pos);
  5067. if (re.test(tail)) {
  5068. return tail.match(re)[0].length;
  5069. }
  5070. return 0;
  5071. };
  5072. }
  5073. function createNormalizer() {
  5074. return function (match, self) {
  5075. self.normalize(match);
  5076. };
  5077. }
  5078. // Schemas compiler. Build regexps.
  5079. //
  5080. function compile(self) {
  5081. // Load & clone RE patterns.
  5082. var re = self.re = require('./lib/re')(self.__opts__);
  5083. // Define dynamic patterns
  5084. var tlds = self.__tlds__.slice();
  5085. self.onCompile();
  5086. if (!self.__tlds_replaced__) {
  5087. tlds.push(tlds_2ch_src_re);
  5088. }
  5089. tlds.push(re.src_xn);
  5090. re.src_tlds = tlds.join('|');
  5091. function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
  5092. re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
  5093. re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
  5094. re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
  5095. re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
  5096. //
  5097. // Compile each schema
  5098. //
  5099. var aliases = [];
  5100. self.__compiled__ = {}; // Reset compiled data
  5101. function schemaError(name, val) {
  5102. throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
  5103. }
  5104. Object.keys(self.__schemas__).forEach(function (name) {
  5105. var val = self.__schemas__[name];
  5106. // skip disabled methods
  5107. if (val === null) { return; }
  5108. var compiled = { validate: null, link: null };
  5109. self.__compiled__[name] = compiled;
  5110. if (isObject(val)) {
  5111. if (isRegExp(val.validate)) {
  5112. compiled.validate = createValidator(val.validate);
  5113. } else if (isFunction(val.validate)) {
  5114. compiled.validate = val.validate;
  5115. } else {
  5116. schemaError(name, val);
  5117. }
  5118. if (isFunction(val.normalize)) {
  5119. compiled.normalize = val.normalize;
  5120. } else if (!val.normalize) {
  5121. compiled.normalize = createNormalizer();
  5122. } else {
  5123. schemaError(name, val);
  5124. }
  5125. return;
  5126. }
  5127. if (isString(val)) {
  5128. aliases.push(name);
  5129. return;
  5130. }
  5131. schemaError(name, val);
  5132. });
  5133. //
  5134. // Compile postponed aliases
  5135. //
  5136. aliases.forEach(function (alias) {
  5137. if (!self.__compiled__[self.__schemas__[alias]]) {
  5138. // Silently fail on missed schemas to avoid errons on disable.
  5139. // schemaError(alias, self.__schemas__[alias]);
  5140. return;
  5141. }
  5142. self.__compiled__[alias].validate =
  5143. self.__compiled__[self.__schemas__[alias]].validate;
  5144. self.__compiled__[alias].normalize =
  5145. self.__compiled__[self.__schemas__[alias]].normalize;
  5146. });
  5147. //
  5148. // Fake record for guessed links
  5149. //
  5150. self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
  5151. //
  5152. // Build schema condition
  5153. //
  5154. var slist = Object.keys(self.__compiled__)
  5155. .filter(function (name) {
  5156. // Filter disabled & fake schemas
  5157. return name.length > 0 && self.__compiled__[name];
  5158. })
  5159. .map(escapeRE)
  5160. .join('|');
  5161. // (?!_) cause 1.5x slowdown
  5162. self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
  5163. self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
  5164. self.re.pretest = RegExp(
  5165. '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@',
  5166. 'i'
  5167. );
  5168. //
  5169. // Cleanup
  5170. //
  5171. resetScanCache(self);
  5172. }
  5173. /**
  5174. * class Match
  5175. *
  5176. * Match result. Single element of array, returned by [[LinkifyIt#match]]
  5177. **/
  5178. function Match(self, shift) {
  5179. var start = self.__index__,
  5180. end = self.__last_index__,
  5181. text = self.__text_cache__.slice(start, end);
  5182. /**
  5183. * Match#schema -> String
  5184. *
  5185. * Prefix (protocol) for matched string.
  5186. **/
  5187. this.schema = self.__schema__.toLowerCase();
  5188. /**
  5189. * Match#index -> Number
  5190. *
  5191. * First position of matched string.
  5192. **/
  5193. this.index = start + shift;
  5194. /**
  5195. * Match#lastIndex -> Number
  5196. *
  5197. * Next position after matched string.
  5198. **/
  5199. this.lastIndex = end + shift;
  5200. /**
  5201. * Match#raw -> String
  5202. *
  5203. * Matched string.
  5204. **/
  5205. this.raw = text;
  5206. /**
  5207. * Match#text -> String
  5208. *
  5209. * Notmalized text of matched string.
  5210. **/
  5211. this.text = text;
  5212. /**
  5213. * Match#url -> String
  5214. *
  5215. * Normalized url of matched string.
  5216. **/
  5217. this.url = text;
  5218. }
  5219. function createMatch(self, shift) {
  5220. var match = new Match(self, shift);
  5221. self.__compiled__[match.schema].normalize(match, self);
  5222. return match;
  5223. }
  5224. /**
  5225. * class LinkifyIt
  5226. **/
  5227. /**
  5228. * new LinkifyIt(schemas, options)
  5229. * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
  5230. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  5231. *
  5232. * Creates new linkifier instance with optional additional schemas.
  5233. * Can be called without `new` keyword for convenience.
  5234. *
  5235. * By default understands:
  5236. *
  5237. * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
  5238. * - "fuzzy" links and emails (example.com, [email protected]).
  5239. *
  5240. * `schemas` is an object, where each key/value describes protocol/rule:
  5241. *
  5242. * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
  5243. * for example). `linkify-it` makes shure that prefix is not preceeded with
  5244. * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
  5245. * - __value__ - rule to check tail after link prefix
  5246. * - _String_ - just alias to existing rule
  5247. * - _Object_
  5248. * - _validate_ - validator function (should return matched length on success),
  5249. * or `RegExp`.
  5250. * - _normalize_ - optional function to normalize text & url of matched result
  5251. * (for example, for @twitter mentions).
  5252. *
  5253. * `options`:
  5254. *
  5255. * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
  5256. * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
  5257. * like version numbers. Default `false`.
  5258. * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
  5259. *
  5260. **/
  5261. function LinkifyIt(schemas, options) {
  5262. if (!(this instanceof LinkifyIt)) {
  5263. return new LinkifyIt(schemas, options);
  5264. }
  5265. if (!options) {
  5266. if (isOptionsObj(schemas)) {
  5267. options = schemas;
  5268. schemas = {};
  5269. }
  5270. }
  5271. this.__opts__ = assign({}, defaultOptions, options);
  5272. // Cache last tested result. Used to skip repeating steps on next `match` call.
  5273. this.__index__ = -1;
  5274. this.__last_index__ = -1; // Next scan position
  5275. this.__schema__ = '';
  5276. this.__text_cache__ = '';
  5277. this.__schemas__ = assign({}, defaultSchemas, schemas);
  5278. this.__compiled__ = {};
  5279. this.__tlds__ = tlds_default;
  5280. this.__tlds_replaced__ = false;
  5281. this.re = {};
  5282. compile(this);
  5283. }
  5284. /** chainable
  5285. * LinkifyIt#add(schema, definition)
  5286. * - schema (String): rule name (fixed pattern prefix)
  5287. * - definition (String|RegExp|Object): schema definition
  5288. *
  5289. * Add new rule definition. See constructor description for details.
  5290. **/
  5291. LinkifyIt.prototype.add = function add(schema, definition) {
  5292. this.__schemas__[schema] = definition;
  5293. compile(this);
  5294. return this;
  5295. };
  5296. /** chainable
  5297. * LinkifyIt#set(options)
  5298. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  5299. *
  5300. * Set recognition options for links without schema.
  5301. **/
  5302. LinkifyIt.prototype.set = function set(options) {
  5303. this.__opts__ = assign(this.__opts__, options);
  5304. return this;
  5305. };
  5306. /**
  5307. * LinkifyIt#test(text) -> Boolean
  5308. *
  5309. * Searches linkifiable pattern and returns `true` on success or `false` on fail.
  5310. **/
  5311. LinkifyIt.prototype.test = function test(text) {
  5312. // Reset scan cache
  5313. this.__text_cache__ = text;
  5314. this.__index__ = -1;
  5315. if (!text.length) { return false; }
  5316. var m, ml, me, len, shift, next, re, tld_pos, at_pos;
  5317. // try to scan for link with schema - that's the most simple rule
  5318. if (this.re.schema_test.test(text)) {
  5319. re = this.re.schema_search;
  5320. re.lastIndex = 0;
  5321. while ((m = re.exec(text)) !== null) {
  5322. len = this.testSchemaAt(text, m[2], re.lastIndex);
  5323. if (len) {
  5324. this.__schema__ = m[2];
  5325. this.__index__ = m.index + m[1].length;
  5326. this.__last_index__ = m.index + m[0].length + len;
  5327. break;
  5328. }
  5329. }
  5330. }
  5331. if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
  5332. // guess schemaless links
  5333. tld_pos = text.search(this.re.host_fuzzy_test);
  5334. if (tld_pos >= 0) {
  5335. // if tld is located after found link - no need to check fuzzy pattern
  5336. if (this.__index__ < 0 || tld_pos < this.__index__) {
  5337. if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
  5338. shift = ml.index + ml[1].length;
  5339. if (this.__index__ < 0 || shift < this.__index__) {
  5340. this.__schema__ = '';
  5341. this.__index__ = shift;
  5342. this.__last_index__ = ml.index + ml[0].length;
  5343. }
  5344. }
  5345. }
  5346. }
  5347. }
  5348. if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
  5349. // guess schemaless emails
  5350. at_pos = text.indexOf('@');
  5351. if (at_pos >= 0) {
  5352. // We can't skip this check, because this cases are possible:
  5353. // [email protected], [email protected]
  5354. if ((me = text.match(this.re.email_fuzzy)) !== null) {
  5355. shift = me.index + me[1].length;
  5356. next = me.index + me[0].length;
  5357. if (this.__index__ < 0 || shift < this.__index__ ||
  5358. (shift === this.__index__ && next > this.__last_index__)) {
  5359. this.__schema__ = 'mailto:';
  5360. this.__index__ = shift;
  5361. this.__last_index__ = next;
  5362. }
  5363. }
  5364. }
  5365. }
  5366. return this.__index__ >= 0;
  5367. };
  5368. /**
  5369. * LinkifyIt#pretest(text) -> Boolean
  5370. *
  5371. * Very quick check, that can give false positives. Returns true if link MAY BE
  5372. * can exists. Can be used for speed optimization, when you need to check that
  5373. * link NOT exists.
  5374. **/
  5375. LinkifyIt.prototype.pretest = function pretest(text) {
  5376. return this.re.pretest.test(text);
  5377. };
  5378. /**
  5379. * LinkifyIt#testSchemaAt(text, name, position) -> Number
  5380. * - text (String): text to scan
  5381. * - name (String): rule (schema) name
  5382. * - position (Number): text offset to check from
  5383. *
  5384. * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
  5385. * at given position. Returns length of found pattern (0 on fail).
  5386. **/
  5387. LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
  5388. // If not supported schema check requested - terminate
  5389. if (!this.__compiled__[schema.toLowerCase()]) {
  5390. return 0;
  5391. }
  5392. return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
  5393. };
  5394. /**
  5395. * LinkifyIt#match(text) -> Array|null
  5396. *
  5397. * Returns array of found link descriptions or `null` on fail. We strongly
  5398. * recommend to use [[LinkifyIt#test]] first, for best speed.
  5399. *
  5400. * ##### Result match description
  5401. *
  5402. * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
  5403. * protocol-neutral links.
  5404. * - __index__ - offset of matched text
  5405. * - __lastIndex__ - index of next char after mathch end
  5406. * - __raw__ - matched text
  5407. * - __text__ - normalized text
  5408. * - __url__ - link, generated from matched text
  5409. **/
  5410. LinkifyIt.prototype.match = function match(text) {
  5411. var shift = 0, result = [];
  5412. // Try to take previous element from cache, if .test() called before
  5413. if (this.__index__ >= 0 && this.__text_cache__ === text) {
  5414. result.push(createMatch(this, shift));
  5415. shift = this.__last_index__;
  5416. }
  5417. // Cut head if cache was used
  5418. var tail = shift ? text.slice(shift) : text;
  5419. // Scan string until end reached
  5420. while (this.test(tail)) {
  5421. result.push(createMatch(this, shift));
  5422. tail = tail.slice(this.__last_index__);
  5423. shift += this.__last_index__;
  5424. }
  5425. if (result.length) {
  5426. return result;
  5427. }
  5428. return null;
  5429. };
  5430. /** chainable
  5431. * LinkifyIt#tlds(list [, keepOld]) -> this
  5432. * - list (Array): list of tlds
  5433. * - keepOld (Boolean): merge with current list if `true` (`false` by default)
  5434. *
  5435. * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
  5436. * to avoid false positives. By default this algorythm used:
  5437. *
  5438. * - hostname with any 2-letter root zones are ok.
  5439. * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
  5440. * are ok.
  5441. * - encoded (`xn--...`) root zones are ok.
  5442. *
  5443. * If list is replaced, then exact match for 2-chars root zones will be checked.
  5444. **/
  5445. LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
  5446. list = Array.isArray(list) ? list : [ list ];
  5447. if (!keepOld) {
  5448. this.__tlds__ = list.slice();
  5449. this.__tlds_replaced__ = true;
  5450. compile(this);
  5451. return this;
  5452. }
  5453. this.__tlds__ = this.__tlds__.concat(list)
  5454. .sort()
  5455. .filter(function (el, idx, arr) {
  5456. return el !== arr[idx - 1];
  5457. })
  5458. .reverse();
  5459. compile(this);
  5460. return this;
  5461. };
  5462. /**
  5463. * LinkifyIt#normalize(match)
  5464. *
  5465. * Default normalizer (if schema does not define it's own).
  5466. **/
  5467. LinkifyIt.prototype.normalize = function normalize(match) {
  5468. // Do minimal possible changes by default. Need to collect feedback prior
  5469. // to move forward https://github.com/markdown-it/linkify-it/issues/1
  5470. if (!match.schema) { match.url = 'http://' + match.url; }
  5471. if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
  5472. match.url = 'mailto:' + match.url;
  5473. }
  5474. };
  5475. /**
  5476. * LinkifyIt#onCompile()
  5477. *
  5478. * Override to modify basic RegExp-s.
  5479. **/
  5480. LinkifyIt.prototype.onCompile = function onCompile() {
  5481. };
  5482. module.exports = LinkifyIt;
  5483. },{"./lib/re":54}],54:[function(require,module,exports){
  5484. 'use strict';
  5485. module.exports = function (opts) {
  5486. var re = {};
  5487. // Use direct extract instead of `regenerate` to reduse browserified size
  5488. re.src_Any = require('uc.micro/properties/Any/regex').source;
  5489. re.src_Cc = require('uc.micro/categories/Cc/regex').source;
  5490. re.src_Z = require('uc.micro/categories/Z/regex').source;
  5491. re.src_P = require('uc.micro/categories/P/regex').source;
  5492. // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
  5493. re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');
  5494. // \p{\Z\Cc} (white spaces + control)
  5495. re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');
  5496. // Experimental. List of chars, completely prohibited in links
  5497. // because can separate it from other part of text
  5498. var text_separators = '[><\uff5c]';
  5499. // All possible word characters (everything without punctuation, spaces & controls)
  5500. // Defined via punctuation & spaces to save space
  5501. // Should be something like \p{\L\N\S\M} (\w but without `_`)
  5502. re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
  5503. // The same as abothe but without [0-9]
  5504. // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
  5505. ////////////////////////////////////////////////////////////////////////////////
  5506. re.src_ip4 =
  5507. '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
  5508. // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
  5509. re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
  5510. re.src_port =
  5511. '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
  5512. re.src_host_terminator =
  5513. '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
  5514. re.src_path =
  5515. '(?:' +
  5516. '[/?#]' +
  5517. '(?:' +
  5518. '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
  5519. '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
  5520. '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
  5521. '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
  5522. '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
  5523. "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
  5524. "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found
  5525. '\\.{2,4}[a-zA-Z0-9%/]|' + // github has ... in commit range links,
  5526. // google has .... in links (issue #66)
  5527. // Restrict to
  5528. // - english
  5529. // - percent-encoded
  5530. // - parts of file path
  5531. // until more examples found.
  5532. '\\.(?!' + re.src_ZCc + '|[.]).|' +
  5533. (opts && opts['---'] ?
  5534. '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
  5535. :
  5536. '\\-+|'
  5537. ) +
  5538. '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths
  5539. '\\!(?!' + re.src_ZCc + '|[!]).|' +
  5540. '\\?(?!' + re.src_ZCc + '|[?]).' +
  5541. ')+' +
  5542. '|\\/' +
  5543. ')?';
  5544. // Allow anything in markdown spec, forbid quote (") at the first position
  5545. // because emails enclosed in quotes are far more common
  5546. re.src_email_name =
  5547. '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
  5548. re.src_xn =
  5549. 'xn--[a-z0-9\\-]{1,59}';
  5550. // More to read about domain names
  5551. // http://serverfault.com/questions/638260/
  5552. re.src_domain_root =
  5553. // Allow letters & digits (http://test1)
  5554. '(?:' +
  5555. re.src_xn +
  5556. '|' +
  5557. re.src_pseudo_letter + '{1,63}' +
  5558. ')';
  5559. re.src_domain =
  5560. '(?:' +
  5561. re.src_xn +
  5562. '|' +
  5563. '(?:' + re.src_pseudo_letter + ')' +
  5564. '|' +
  5565. '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
  5566. ')';
  5567. re.src_host =
  5568. '(?:' +
  5569. // Don't need IP check, because digits are already allowed in normal domain names
  5570. // src_ip4 +
  5571. // '|' +
  5572. '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' +
  5573. ')';
  5574. re.tpl_host_fuzzy =
  5575. '(?:' +
  5576. re.src_ip4 +
  5577. '|' +
  5578. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
  5579. ')';
  5580. re.tpl_host_no_ip_fuzzy =
  5581. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
  5582. re.src_host_strict =
  5583. re.src_host + re.src_host_terminator;
  5584. re.tpl_host_fuzzy_strict =
  5585. re.tpl_host_fuzzy + re.src_host_terminator;
  5586. re.src_host_port_strict =
  5587. re.src_host + re.src_port + re.src_host_terminator;
  5588. re.tpl_host_port_fuzzy_strict =
  5589. re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
  5590. re.tpl_host_port_no_ip_fuzzy_strict =
  5591. re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
  5592. ////////////////////////////////////////////////////////////////////////////////
  5593. // Main rules
  5594. // Rude test fuzzy links by host, for quick deny
  5595. re.tpl_host_fuzzy_test =
  5596. 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
  5597. re.tpl_email_fuzzy =
  5598. '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' +
  5599. '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
  5600. re.tpl_link_fuzzy =
  5601. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  5602. // but can start with > (markdown blockquote)
  5603. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  5604. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
  5605. re.tpl_link_no_ip_fuzzy =
  5606. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  5607. // but can start with > (markdown blockquote)
  5608. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  5609. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
  5610. return re;
  5611. };
  5612. },{"uc.micro/categories/Cc/regex":61,"uc.micro/categories/P/regex":63,"uc.micro/categories/Z/regex":64,"uc.micro/properties/Any/regex":66}],55:[function(require,module,exports){
  5613. 'use strict';
  5614. /* eslint-disable no-bitwise */
  5615. var decodeCache = {};
  5616. function getDecodeCache(exclude) {
  5617. var i, ch, cache = decodeCache[exclude];
  5618. if (cache) { return cache; }
  5619. cache = decodeCache[exclude] = [];
  5620. for (i = 0; i < 128; i++) {
  5621. ch = String.fromCharCode(i);
  5622. cache.push(ch);
  5623. }
  5624. for (i = 0; i < exclude.length; i++) {
  5625. ch = exclude.charCodeAt(i);
  5626. cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
  5627. }
  5628. return cache;
  5629. }
  5630. // Decode percent-encoded string.
  5631. //
  5632. function decode(string, exclude) {
  5633. var cache;
  5634. if (typeof exclude !== 'string') {
  5635. exclude = decode.defaultChars;
  5636. }
  5637. cache = getDecodeCache(exclude);
  5638. return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
  5639. var i, l, b1, b2, b3, b4, chr,
  5640. result = '';
  5641. for (i = 0, l = seq.length; i < l; i += 3) {
  5642. b1 = parseInt(seq.slice(i + 1, i + 3), 16);
  5643. if (b1 < 0x80) {
  5644. result += cache[b1];
  5645. continue;
  5646. }
  5647. if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
  5648. // 110xxxxx 10xxxxxx
  5649. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  5650. if ((b2 & 0xC0) === 0x80) {
  5651. chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
  5652. if (chr < 0x80) {
  5653. result += '\ufffd\ufffd';
  5654. } else {
  5655. result += String.fromCharCode(chr);
  5656. }
  5657. i += 3;
  5658. continue;
  5659. }
  5660. }
  5661. if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
  5662. // 1110xxxx 10xxxxxx 10xxxxxx
  5663. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  5664. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  5665. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
  5666. chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
  5667. if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
  5668. result += '\ufffd\ufffd\ufffd';
  5669. } else {
  5670. result += String.fromCharCode(chr);
  5671. }
  5672. i += 6;
  5673. continue;
  5674. }
  5675. }
  5676. if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
  5677. // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
  5678. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  5679. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  5680. b4 = parseInt(seq.slice(i + 10, i + 12), 16);
  5681. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
  5682. chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
  5683. if (chr < 0x10000 || chr > 0x10FFFF) {
  5684. result += '\ufffd\ufffd\ufffd\ufffd';
  5685. } else {
  5686. chr -= 0x10000;
  5687. result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
  5688. }
  5689. i += 9;
  5690. continue;
  5691. }
  5692. }
  5693. result += '\ufffd';
  5694. }
  5695. return result;
  5696. });
  5697. }
  5698. decode.defaultChars = ';/?:@&=+$,#';
  5699. decode.componentChars = '';
  5700. module.exports = decode;
  5701. },{}],56:[function(require,module,exports){
  5702. 'use strict';
  5703. var encodeCache = {};
  5704. // Create a lookup array where anything but characters in `chars` string
  5705. // and alphanumeric chars is percent-encoded.
  5706. //
  5707. function getEncodeCache(exclude) {
  5708. var i, ch, cache = encodeCache[exclude];
  5709. if (cache) { return cache; }
  5710. cache = encodeCache[exclude] = [];
  5711. for (i = 0; i < 128; i++) {
  5712. ch = String.fromCharCode(i);
  5713. if (/^[0-9a-z]$/i.test(ch)) {
  5714. // always allow unencoded alphanumeric characters
  5715. cache.push(ch);
  5716. } else {
  5717. cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
  5718. }
  5719. }
  5720. for (i = 0; i < exclude.length; i++) {
  5721. cache[exclude.charCodeAt(i)] = exclude[i];
  5722. }
  5723. return cache;
  5724. }
  5725. // Encode unsafe characters with percent-encoding, skipping already
  5726. // encoded sequences.
  5727. //
  5728. // - string - string to encode
  5729. // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
  5730. // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
  5731. //
  5732. function encode(string, exclude, keepEscaped) {
  5733. var i, l, code, nextCode, cache,
  5734. result = '';
  5735. if (typeof exclude !== 'string') {
  5736. // encode(string, keepEscaped)
  5737. keepEscaped = exclude;
  5738. exclude = encode.defaultChars;
  5739. }
  5740. if (typeof keepEscaped === 'undefined') {
  5741. keepEscaped = true;
  5742. }
  5743. cache = getEncodeCache(exclude);
  5744. for (i = 0, l = string.length; i < l; i++) {
  5745. code = string.charCodeAt(i);
  5746. if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
  5747. if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
  5748. result += string.slice(i, i + 3);
  5749. i += 2;
  5750. continue;
  5751. }
  5752. }
  5753. if (code < 128) {
  5754. result += cache[code];
  5755. continue;
  5756. }
  5757. if (code >= 0xD800 && code <= 0xDFFF) {
  5758. if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
  5759. nextCode = string.charCodeAt(i + 1);
  5760. if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
  5761. result += encodeURIComponent(string[i] + string[i + 1]);
  5762. i++;
  5763. continue;
  5764. }
  5765. }
  5766. result += '%EF%BF%BD';
  5767. continue;
  5768. }
  5769. result += encodeURIComponent(string[i]);
  5770. }
  5771. return result;
  5772. }
  5773. encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
  5774. encode.componentChars = "-_.!~*'()";
  5775. module.exports = encode;
  5776. },{}],57:[function(require,module,exports){
  5777. 'use strict';
  5778. module.exports = function format(url) {
  5779. var result = '';
  5780. result += url.protocol || '';
  5781. result += url.slashes ? '//' : '';
  5782. result += url.auth ? url.auth + '@' : '';
  5783. if (url.hostname && url.hostname.indexOf(':') !== -1) {
  5784. // ipv6 address
  5785. result += '[' + url.hostname + ']';
  5786. } else {
  5787. result += url.hostname || '';
  5788. }
  5789. result += url.port ? ':' + url.port : '';
  5790. result += url.pathname || '';
  5791. result += url.search || '';
  5792. result += url.hash || '';
  5793. return result;
  5794. };
  5795. },{}],58:[function(require,module,exports){
  5796. 'use strict';
  5797. module.exports.encode = require('./encode');
  5798. module.exports.decode = require('./decode');
  5799. module.exports.format = require('./format');
  5800. module.exports.parse = require('./parse');
  5801. },{"./decode":55,"./encode":56,"./format":57,"./parse":59}],59:[function(require,module,exports){
  5802. // Copyright Joyent, Inc. and other Node contributors.
  5803. //
  5804. // Permission is hereby granted, free of charge, to any person obtaining a
  5805. // copy of this software and associated documentation files (the
  5806. // "Software"), to deal in the Software without restriction, including
  5807. // without limitation the rights to use, copy, modify, merge, publish,
  5808. // distribute, sublicense, and/or sell copies of the Software, and to permit
  5809. // persons to whom the Software is furnished to do so, subject to the
  5810. // following conditions:
  5811. //
  5812. // The above copyright notice and this permission notice shall be included
  5813. // in all copies or substantial portions of the Software.
  5814. //
  5815. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5816. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5817. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  5818. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  5819. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  5820. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  5821. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  5822. 'use strict';
  5823. //
  5824. // Changes from joyent/node:
  5825. //
  5826. // 1. No leading slash in paths,
  5827. // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
  5828. //
  5829. // 2. Backslashes are not replaced with slashes,
  5830. // so `http:\\example.org\` is treated like a relative path
  5831. //
  5832. // 3. Trailing colon is treated like a part of the path,
  5833. // i.e. in `http://example.org:foo` pathname is `:foo`
  5834. //
  5835. // 4. Nothing is URL-encoded in the resulting object,
  5836. // (in joyent/node some chars in auth and paths are encoded)
  5837. //
  5838. // 5. `url.parse()` does not have `parseQueryString` argument
  5839. //
  5840. // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
  5841. // which can be constructed using other parts of the url.
  5842. //
  5843. function Url() {
  5844. this.protocol = null;
  5845. this.slashes = null;
  5846. this.auth = null;
  5847. this.port = null;
  5848. this.hostname = null;
  5849. this.hash = null;
  5850. this.search = null;
  5851. this.pathname = null;
  5852. }
  5853. // Reference: RFC 3986, RFC 1808, RFC 2396
  5854. // define these here so at least they only have to be
  5855. // compiled once on the first module load.
  5856. var protocolPattern = /^([a-z0-9.+-]+:)/i,
  5857. portPattern = /:[0-9]*$/,
  5858. // Special case for a simple path URL
  5859. simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  5860. // RFC 2396: characters reserved for delimiting URLs.
  5861. // We actually just auto-escape these.
  5862. delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
  5863. // RFC 2396: characters not allowed for various reasons.
  5864. unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
  5865. // Allowed by RFCs, but cause of XSS attacks. Always escape these.
  5866. autoEscape = [ '\'' ].concat(unwise),
  5867. // Characters that are never ever allowed in a hostname.
  5868. // Note that any invalid chars are also handled, but these
  5869. // are the ones that are *expected* to be seen, so we fast-path
  5870. // them.
  5871. nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
  5872. hostEndingChars = [ '/', '?', '#' ],
  5873. hostnameMaxLen = 255,
  5874. hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
  5875. hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  5876. // protocols that can allow "unsafe" and "unwise" chars.
  5877. /* eslint-disable no-script-url */
  5878. // protocols that never have a hostname.
  5879. hostlessProtocol = {
  5880. 'javascript': true,
  5881. 'javascript:': true
  5882. },
  5883. // protocols that always contain a // bit.
  5884. slashedProtocol = {
  5885. 'http': true,
  5886. 'https': true,
  5887. 'ftp': true,
  5888. 'gopher': true,
  5889. 'file': true,
  5890. 'http:': true,
  5891. 'https:': true,
  5892. 'ftp:': true,
  5893. 'gopher:': true,
  5894. 'file:': true
  5895. };
  5896. /* eslint-enable no-script-url */
  5897. function urlParse(url, slashesDenoteHost) {
  5898. if (url && url instanceof Url) { return url; }
  5899. var u = new Url();
  5900. u.parse(url, slashesDenoteHost);
  5901. return u;
  5902. }
  5903. Url.prototype.parse = function(url, slashesDenoteHost) {
  5904. var i, l, lowerProto, hec, slashes,
  5905. rest = url;
  5906. // trim before proceeding.
  5907. // This is to support parse stuff like " http://foo.com \n"
  5908. rest = rest.trim();
  5909. if (!slashesDenoteHost && url.split('#').length === 1) {
  5910. // Try fast path regexp
  5911. var simplePath = simplePathPattern.exec(rest);
  5912. if (simplePath) {
  5913. this.pathname = simplePath[1];
  5914. if (simplePath[2]) {
  5915. this.search = simplePath[2];
  5916. }
  5917. return this;
  5918. }
  5919. }
  5920. var proto = protocolPattern.exec(rest);
  5921. if (proto) {
  5922. proto = proto[0];
  5923. lowerProto = proto.toLowerCase();
  5924. this.protocol = proto;
  5925. rest = rest.substr(proto.length);
  5926. }
  5927. // figure out if it's got a host
  5928. // user@server is *always* interpreted as a hostname, and url
  5929. // resolution will treat //foo/bar as host=foo,path=bar because that's
  5930. // how the browser resolves relative URLs.
  5931. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  5932. slashes = rest.substr(0, 2) === '//';
  5933. if (slashes && !(proto && hostlessProtocol[proto])) {
  5934. rest = rest.substr(2);
  5935. this.slashes = true;
  5936. }
  5937. }
  5938. if (!hostlessProtocol[proto] &&
  5939. (slashes || (proto && !slashedProtocol[proto]))) {
  5940. // there's a hostname.
  5941. // the first instance of /, ?, ;, or # ends the host.
  5942. //
  5943. // If there is an @ in the hostname, then non-host chars *are* allowed
  5944. // to the left of the last @ sign, unless some host-ending character
  5945. // comes *before* the @-sign.
  5946. // URLs are obnoxious.
  5947. //
  5948. // ex:
  5949. // http://a@b@c/ => user:a@b host:c
  5950. // http://a@b?@c => user:a host:c path:/?@c
  5951. // v0.12 TODO(isaacs): This is not quite how Chrome does things.
  5952. // Review our test case against browsers more comprehensively.
  5953. // find the first instance of any hostEndingChars
  5954. var hostEnd = -1;
  5955. for (i = 0; i < hostEndingChars.length; i++) {
  5956. hec = rest.indexOf(hostEndingChars[i]);
  5957. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  5958. hostEnd = hec;
  5959. }
  5960. }
  5961. // at this point, either we have an explicit point where the
  5962. // auth portion cannot go past, or the last @ char is the decider.
  5963. var auth, atSign;
  5964. if (hostEnd === -1) {
  5965. // atSign can be anywhere.
  5966. atSign = rest.lastIndexOf('@');
  5967. } else {
  5968. // atSign must be in auth portion.
  5969. // http://a@b/c@d => host:b auth:a path:/c@d
  5970. atSign = rest.lastIndexOf('@', hostEnd);
  5971. }
  5972. // Now we have a portion which is definitely the auth.
  5973. // Pull that off.
  5974. if (atSign !== -1) {
  5975. auth = rest.slice(0, atSign);
  5976. rest = rest.slice(atSign + 1);
  5977. this.auth = auth;
  5978. }
  5979. // the host is the remaining to the left of the first non-host char
  5980. hostEnd = -1;
  5981. for (i = 0; i < nonHostChars.length; i++) {
  5982. hec = rest.indexOf(nonHostChars[i]);
  5983. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  5984. hostEnd = hec;
  5985. }
  5986. }
  5987. // if we still have not hit it, then the entire thing is a host.
  5988. if (hostEnd === -1) {
  5989. hostEnd = rest.length;
  5990. }
  5991. if (rest[hostEnd - 1] === ':') { hostEnd--; }
  5992. var host = rest.slice(0, hostEnd);
  5993. rest = rest.slice(hostEnd);
  5994. // pull out port.
  5995. this.parseHost(host);
  5996. // we've indicated that there is a hostname,
  5997. // so even if it's empty, it has to be present.
  5998. this.hostname = this.hostname || '';
  5999. // if hostname begins with [ and ends with ]
  6000. // assume that it's an IPv6 address.
  6001. var ipv6Hostname = this.hostname[0] === '[' &&
  6002. this.hostname[this.hostname.length - 1] === ']';
  6003. // validate a little.
  6004. if (!ipv6Hostname) {
  6005. var hostparts = this.hostname.split(/\./);
  6006. for (i = 0, l = hostparts.length; i < l; i++) {
  6007. var part = hostparts[i];
  6008. if (!part) { continue; }
  6009. if (!part.match(hostnamePartPattern)) {
  6010. var newpart = '';
  6011. for (var j = 0, k = part.length; j < k; j++) {
  6012. if (part.charCodeAt(j) > 127) {
  6013. // we replace non-ASCII char with a temporary placeholder
  6014. // we need this to make sure size of hostname is not
  6015. // broken by replacing non-ASCII by nothing
  6016. newpart += 'x';
  6017. } else {
  6018. newpart += part[j];
  6019. }
  6020. }
  6021. // we test again with ASCII char only
  6022. if (!newpart.match(hostnamePartPattern)) {
  6023. var validParts = hostparts.slice(0, i);
  6024. var notHost = hostparts.slice(i + 1);
  6025. var bit = part.match(hostnamePartStart);
  6026. if (bit) {
  6027. validParts.push(bit[1]);
  6028. notHost.unshift(bit[2]);
  6029. }
  6030. if (notHost.length) {
  6031. rest = notHost.join('.') + rest;
  6032. }
  6033. this.hostname = validParts.join('.');
  6034. break;
  6035. }
  6036. }
  6037. }
  6038. }
  6039. if (this.hostname.length > hostnameMaxLen) {
  6040. this.hostname = '';
  6041. }
  6042. // strip [ and ] from the hostname
  6043. // the host field still retains them, though
  6044. if (ipv6Hostname) {
  6045. this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  6046. }
  6047. }
  6048. // chop off from the tail first.
  6049. var hash = rest.indexOf('#');
  6050. if (hash !== -1) {
  6051. // got a fragment string.
  6052. this.hash = rest.substr(hash);
  6053. rest = rest.slice(0, hash);
  6054. }
  6055. var qm = rest.indexOf('?');
  6056. if (qm !== -1) {
  6057. this.search = rest.substr(qm);
  6058. rest = rest.slice(0, qm);
  6059. }
  6060. if (rest) { this.pathname = rest; }
  6061. if (slashedProtocol[lowerProto] &&
  6062. this.hostname && !this.pathname) {
  6063. this.pathname = '';
  6064. }
  6065. return this;
  6066. };
  6067. Url.prototype.parseHost = function(host) {
  6068. var port = portPattern.exec(host);
  6069. if (port) {
  6070. port = port[0];
  6071. if (port !== ':') {
  6072. this.port = port.substr(1);
  6073. }
  6074. host = host.substr(0, host.length - port.length);
  6075. }
  6076. if (host) { this.hostname = host; }
  6077. };
  6078. module.exports = urlParse;
  6079. },{}],60:[function(require,module,exports){
  6080. (function (global){
  6081. /*! https://mths.be/punycode v1.4.1 by @mathias */
  6082. ;(function(root) {
  6083. /** Detect free variables */
  6084. var freeExports = typeof exports == 'object' && exports &&
  6085. !exports.nodeType && exports;
  6086. var freeModule = typeof module == 'object' && module &&
  6087. !module.nodeType && module;
  6088. var freeGlobal = typeof global == 'object' && global;
  6089. if (
  6090. freeGlobal.global === freeGlobal ||
  6091. freeGlobal.window === freeGlobal ||
  6092. freeGlobal.self === freeGlobal
  6093. ) {
  6094. root = freeGlobal;
  6095. }
  6096. /**
  6097. * The `punycode` object.
  6098. * @name punycode
  6099. * @type Object
  6100. */
  6101. var punycode,
  6102. /** Highest positive signed 32-bit float value */
  6103. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  6104. /** Bootstring parameters */
  6105. base = 36,
  6106. tMin = 1,
  6107. tMax = 26,
  6108. skew = 38,
  6109. damp = 700,
  6110. initialBias = 72,
  6111. initialN = 128, // 0x80
  6112. delimiter = '-', // '\x2D'
  6113. /** Regular expressions */
  6114. regexPunycode = /^xn--/,
  6115. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  6116. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  6117. /** Error messages */
  6118. errors = {
  6119. 'overflow': 'Overflow: input needs wider integers to process',
  6120. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  6121. 'invalid-input': 'Invalid input'
  6122. },
  6123. /** Convenience shortcuts */
  6124. baseMinusTMin = base - tMin,
  6125. floor = Math.floor,
  6126. stringFromCharCode = String.fromCharCode,
  6127. /** Temporary variable */
  6128. key;
  6129. /*--------------------------------------------------------------------------*/
  6130. /**
  6131. * A generic error utility function.
  6132. * @private
  6133. * @param {String} type The error type.
  6134. * @returns {Error} Throws a `RangeError` with the applicable error message.
  6135. */
  6136. function error(type) {
  6137. throw new RangeError(errors[type]);
  6138. }
  6139. /**
  6140. * A generic `Array#map` utility function.
  6141. * @private
  6142. * @param {Array} array The array to iterate over.
  6143. * @param {Function} callback The function that gets called for every array
  6144. * item.
  6145. * @returns {Array} A new array of values returned by the callback function.
  6146. */
  6147. function map(array, fn) {
  6148. var length = array.length;
  6149. var result = [];
  6150. while (length--) {
  6151. result[length] = fn(array[length]);
  6152. }
  6153. return result;
  6154. }
  6155. /**
  6156. * A simple `Array#map`-like wrapper to work with domain name strings or email
  6157. * addresses.
  6158. * @private
  6159. * @param {String} domain The domain name or email address.
  6160. * @param {Function} callback The function that gets called for every
  6161. * character.
  6162. * @returns {Array} A new string of characters returned by the callback
  6163. * function.
  6164. */
  6165. function mapDomain(string, fn) {
  6166. var parts = string.split('@');
  6167. var result = '';
  6168. if (parts.length > 1) {
  6169. // In email addresses, only the domain name should be punycoded. Leave
  6170. // the local part (i.e. everything up to `@`) intact.
  6171. result = parts[0] + '@';
  6172. string = parts[1];
  6173. }
  6174. // Avoid `split(regex)` for IE8 compatibility. See #17.
  6175. string = string.replace(regexSeparators, '\x2E');
  6176. var labels = string.split('.');
  6177. var encoded = map(labels, fn).join('.');
  6178. return result + encoded;
  6179. }
  6180. /**
  6181. * Creates an array containing the numeric code points of each Unicode
  6182. * character in the string. While JavaScript uses UCS-2 internally,
  6183. * this function will convert a pair of surrogate halves (each of which
  6184. * UCS-2 exposes as separate characters) into a single code point,
  6185. * matching UTF-16.
  6186. * @see `punycode.ucs2.encode`
  6187. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  6188. * @memberOf punycode.ucs2
  6189. * @name decode
  6190. * @param {String} string The Unicode input string (UCS-2).
  6191. * @returns {Array} The new array of code points.
  6192. */
  6193. function ucs2decode(string) {
  6194. var output = [],
  6195. counter = 0,
  6196. length = string.length,
  6197. value,
  6198. extra;
  6199. while (counter < length) {
  6200. value = string.charCodeAt(counter++);
  6201. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  6202. // high surrogate, and there is a next character
  6203. extra = string.charCodeAt(counter++);
  6204. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  6205. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  6206. } else {
  6207. // unmatched surrogate; only append this code unit, in case the next
  6208. // code unit is the high surrogate of a surrogate pair
  6209. output.push(value);
  6210. counter--;
  6211. }
  6212. } else {
  6213. output.push(value);
  6214. }
  6215. }
  6216. return output;
  6217. }
  6218. /**
  6219. * Creates a string based on an array of numeric code points.
  6220. * @see `punycode.ucs2.decode`
  6221. * @memberOf punycode.ucs2
  6222. * @name encode
  6223. * @param {Array} codePoints The array of numeric code points.
  6224. * @returns {String} The new Unicode string (UCS-2).
  6225. */
  6226. function ucs2encode(array) {
  6227. return map(array, function(value) {
  6228. var output = '';
  6229. if (value > 0xFFFF) {
  6230. value -= 0x10000;
  6231. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  6232. value = 0xDC00 | value & 0x3FF;
  6233. }
  6234. output += stringFromCharCode(value);
  6235. return output;
  6236. }).join('');
  6237. }
  6238. /**
  6239. * Converts a basic code point into a digit/integer.
  6240. * @see `digitToBasic()`
  6241. * @private
  6242. * @param {Number} codePoint The basic numeric code point value.
  6243. * @returns {Number} The numeric value of a basic code point (for use in
  6244. * representing integers) in the range `0` to `base - 1`, or `base` if
  6245. * the code point does not represent a value.
  6246. */
  6247. function basicToDigit(codePoint) {
  6248. if (codePoint - 48 < 10) {
  6249. return codePoint - 22;
  6250. }
  6251. if (codePoint - 65 < 26) {
  6252. return codePoint - 65;
  6253. }
  6254. if (codePoint - 97 < 26) {
  6255. return codePoint - 97;
  6256. }
  6257. return base;
  6258. }
  6259. /**
  6260. * Converts a digit/integer into a basic code point.
  6261. * @see `basicToDigit()`
  6262. * @private
  6263. * @param {Number} digit The numeric value of a basic code point.
  6264. * @returns {Number} The basic code point whose value (when used for
  6265. * representing integers) is `digit`, which needs to be in the range
  6266. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  6267. * used; else, the lowercase form is used. The behavior is undefined
  6268. * if `flag` is non-zero and `digit` has no uppercase form.
  6269. */
  6270. function digitToBasic(digit, flag) {
  6271. // 0..25 map to ASCII a..z or A..Z
  6272. // 26..35 map to ASCII 0..9
  6273. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  6274. }
  6275. /**
  6276. * Bias adaptation function as per section 3.4 of RFC 3492.
  6277. * https://tools.ietf.org/html/rfc3492#section-3.4
  6278. * @private
  6279. */
  6280. function adapt(delta, numPoints, firstTime) {
  6281. var k = 0;
  6282. delta = firstTime ? floor(delta / damp) : delta >> 1;
  6283. delta += floor(delta / numPoints);
  6284. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  6285. delta = floor(delta / baseMinusTMin);
  6286. }
  6287. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  6288. }
  6289. /**
  6290. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  6291. * symbols.
  6292. * @memberOf punycode
  6293. * @param {String} input The Punycode string of ASCII-only symbols.
  6294. * @returns {String} The resulting string of Unicode symbols.
  6295. */
  6296. function decode(input) {
  6297. // Don't use UCS-2
  6298. var output = [],
  6299. inputLength = input.length,
  6300. out,
  6301. i = 0,
  6302. n = initialN,
  6303. bias = initialBias,
  6304. basic,
  6305. j,
  6306. index,
  6307. oldi,
  6308. w,
  6309. k,
  6310. digit,
  6311. t,
  6312. /** Cached calculation results */
  6313. baseMinusT;
  6314. // Handle the basic code points: let `basic` be the number of input code
  6315. // points before the last delimiter, or `0` if there is none, then copy
  6316. // the first basic code points to the output.
  6317. basic = input.lastIndexOf(delimiter);
  6318. if (basic < 0) {
  6319. basic = 0;
  6320. }
  6321. for (j = 0; j < basic; ++j) {
  6322. // if it's not a basic code point
  6323. if (input.charCodeAt(j) >= 0x80) {
  6324. error('not-basic');
  6325. }
  6326. output.push(input.charCodeAt(j));
  6327. }
  6328. // Main decoding loop: start just after the last delimiter if any basic code
  6329. // points were copied; start at the beginning otherwise.
  6330. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  6331. // `index` is the index of the next character to be consumed.
  6332. // Decode a generalized variable-length integer into `delta`,
  6333. // which gets added to `i`. The overflow checking is easier
  6334. // if we increase `i` as we go, then subtract off its starting
  6335. // value at the end to obtain `delta`.
  6336. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  6337. if (index >= inputLength) {
  6338. error('invalid-input');
  6339. }
  6340. digit = basicToDigit(input.charCodeAt(index++));
  6341. if (digit >= base || digit > floor((maxInt - i) / w)) {
  6342. error('overflow');
  6343. }
  6344. i += digit * w;
  6345. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  6346. if (digit < t) {
  6347. break;
  6348. }
  6349. baseMinusT = base - t;
  6350. if (w > floor(maxInt / baseMinusT)) {
  6351. error('overflow');
  6352. }
  6353. w *= baseMinusT;
  6354. }
  6355. out = output.length + 1;
  6356. bias = adapt(i - oldi, out, oldi == 0);
  6357. // `i` was supposed to wrap around from `out` to `0`,
  6358. // incrementing `n` each time, so we'll fix that now:
  6359. if (floor(i / out) > maxInt - n) {
  6360. error('overflow');
  6361. }
  6362. n += floor(i / out);
  6363. i %= out;
  6364. // Insert `n` at position `i` of the output
  6365. output.splice(i++, 0, n);
  6366. }
  6367. return ucs2encode(output);
  6368. }
  6369. /**
  6370. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  6371. * Punycode string of ASCII-only symbols.
  6372. * @memberOf punycode
  6373. * @param {String} input The string of Unicode symbols.
  6374. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  6375. */
  6376. function encode(input) {
  6377. var n,
  6378. delta,
  6379. handledCPCount,
  6380. basicLength,
  6381. bias,
  6382. j,
  6383. m,
  6384. q,
  6385. k,
  6386. t,
  6387. currentValue,
  6388. output = [],
  6389. /** `inputLength` will hold the number of code points in `input`. */
  6390. inputLength,
  6391. /** Cached calculation results */
  6392. handledCPCountPlusOne,
  6393. baseMinusT,
  6394. qMinusT;
  6395. // Convert the input in UCS-2 to Unicode
  6396. input = ucs2decode(input);
  6397. // Cache the length
  6398. inputLength = input.length;
  6399. // Initialize the state
  6400. n = initialN;
  6401. delta = 0;
  6402. bias = initialBias;
  6403. // Handle the basic code points
  6404. for (j = 0; j < inputLength; ++j) {
  6405. currentValue = input[j];
  6406. if (currentValue < 0x80) {
  6407. output.push(stringFromCharCode(currentValue));
  6408. }
  6409. }
  6410. handledCPCount = basicLength = output.length;
  6411. // `handledCPCount` is the number of code points that have been handled;
  6412. // `basicLength` is the number of basic code points.
  6413. // Finish the basic string - if it is not empty - with a delimiter
  6414. if (basicLength) {
  6415. output.push(delimiter);
  6416. }
  6417. // Main encoding loop:
  6418. while (handledCPCount < inputLength) {
  6419. // All non-basic code points < n have been handled already. Find the next
  6420. // larger one:
  6421. for (m = maxInt, j = 0; j < inputLength; ++j) {
  6422. currentValue = input[j];
  6423. if (currentValue >= n && currentValue < m) {
  6424. m = currentValue;
  6425. }
  6426. }
  6427. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  6428. // but guard against overflow
  6429. handledCPCountPlusOne = handledCPCount + 1;
  6430. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  6431. error('overflow');
  6432. }
  6433. delta += (m - n) * handledCPCountPlusOne;
  6434. n = m;
  6435. for (j = 0; j < inputLength; ++j) {
  6436. currentValue = input[j];
  6437. if (currentValue < n && ++delta > maxInt) {
  6438. error('overflow');
  6439. }
  6440. if (currentValue == n) {
  6441. // Represent delta as a generalized variable-length integer
  6442. for (q = delta, k = base; /* no condition */; k += base) {
  6443. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  6444. if (q < t) {
  6445. break;
  6446. }
  6447. qMinusT = q - t;
  6448. baseMinusT = base - t;
  6449. output.push(
  6450. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  6451. );
  6452. q = floor(qMinusT / baseMinusT);
  6453. }
  6454. output.push(stringFromCharCode(digitToBasic(q, 0)));
  6455. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  6456. delta = 0;
  6457. ++handledCPCount;
  6458. }
  6459. }
  6460. ++delta;
  6461. ++n;
  6462. }
  6463. return output.join('');
  6464. }
  6465. /**
  6466. * Converts a Punycode string representing a domain name or an email address
  6467. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  6468. * it doesn't matter if you call it on a string that has already been
  6469. * converted to Unicode.
  6470. * @memberOf punycode
  6471. * @param {String} input The Punycoded domain name or email address to
  6472. * convert to Unicode.
  6473. * @returns {String} The Unicode representation of the given Punycode
  6474. * string.
  6475. */
  6476. function toUnicode(input) {
  6477. return mapDomain(input, function(string) {
  6478. return regexPunycode.test(string)
  6479. ? decode(string.slice(4).toLowerCase())
  6480. : string;
  6481. });
  6482. }
  6483. /**
  6484. * Converts a Unicode string representing a domain name or an email address to
  6485. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  6486. * i.e. it doesn't matter if you call it with a domain that's already in
  6487. * ASCII.
  6488. * @memberOf punycode
  6489. * @param {String} input The domain name or email address to convert, as a
  6490. * Unicode string.
  6491. * @returns {String} The Punycode representation of the given domain name or
  6492. * email address.
  6493. */
  6494. function toASCII(input) {
  6495. return mapDomain(input, function(string) {
  6496. return regexNonASCII.test(string)
  6497. ? 'xn--' + encode(string)
  6498. : string;
  6499. });
  6500. }
  6501. /*--------------------------------------------------------------------------*/
  6502. /** Define the public API */
  6503. punycode = {
  6504. /**
  6505. * A string representing the current Punycode.js version number.
  6506. * @memberOf punycode
  6507. * @type String
  6508. */
  6509. 'version': '1.4.1',
  6510. /**
  6511. * An object of methods to convert from JavaScript's internal character
  6512. * representation (UCS-2) to Unicode code points, and back.
  6513. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  6514. * @memberOf punycode
  6515. * @type Object
  6516. */
  6517. 'ucs2': {
  6518. 'decode': ucs2decode,
  6519. 'encode': ucs2encode
  6520. },
  6521. 'decode': decode,
  6522. 'encode': encode,
  6523. 'toASCII': toASCII,
  6524. 'toUnicode': toUnicode
  6525. };
  6526. /** Expose `punycode` */
  6527. // Some AMD build optimizers, like r.js, check for specific condition patterns
  6528. // like the following:
  6529. if (
  6530. typeof define == 'function' &&
  6531. typeof define.amd == 'object' &&
  6532. define.amd
  6533. ) {
  6534. define('punycode', function() {
  6535. return punycode;
  6536. });
  6537. } else if (freeExports && freeModule) {
  6538. if (module.exports == freeExports) {
  6539. // in Node.js, io.js, or RingoJS v0.8.0+
  6540. freeModule.exports = punycode;
  6541. } else {
  6542. // in Narwhal or RingoJS v0.7.0-
  6543. for (key in punycode) {
  6544. punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
  6545. }
  6546. }
  6547. } else {
  6548. // in Rhino or a web browser
  6549. root.punycode = punycode;
  6550. }
  6551. }(this));
  6552. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  6553. },{}],61:[function(require,module,exports){
  6554. module.exports=/[\0-\x1F\x7F-\x9F]/
  6555. },{}],62:[function(require,module,exports){
  6556. module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
  6557. },{}],63:[function(require,module,exports){
  6558. module.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/
  6559. },{}],64:[function(require,module,exports){
  6560. module.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/
  6561. },{}],65:[function(require,module,exports){
  6562. 'use strict';
  6563. exports.Any = require('./properties/Any/regex');
  6564. exports.Cc = require('./categories/Cc/regex');
  6565. exports.Cf = require('./categories/Cf/regex');
  6566. exports.P = require('./categories/P/regex');
  6567. exports.Z = require('./categories/Z/regex');
  6568. },{"./categories/Cc/regex":61,"./categories/Cf/regex":62,"./categories/P/regex":63,"./categories/Z/regex":64,"./properties/Any/regex":66}],66:[function(require,module,exports){
  6569. module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
  6570. },{}],67:[function(require,module,exports){
  6571. 'use strict';
  6572. module.exports = require('./lib/');
  6573. },{"./lib/":9}]},{},[67])(67)
  6574. });