diff --git a/app/assets/javascripts/markdown-it.min.js b/app/assets/javascripts/markdown-it.min.js new file mode 100644 index 000000000..8351af518 --- /dev/null +++ b/app/assets/javascripts/markdown-it.min.js @@ -0,0 +1,6009 @@ +/* eslint-disable */ +/*! markdown-it 12.0.4 https://github.com/markdown-it/markdown-it @license MIT */ +!(function (e, r) { + 'object' == typeof exports && 'undefined' != typeof module + ? (module.exports = r()) + : 'function' == typeof define && define.amd + ? define(r) + : ((e = + 'undefined' != typeof globalThis ? globalThis : e || self).markdownit = + r()); +})(this, function () { + 'use strict'; + function e(e) { + if (e.__esModule) return e; + var r = Object.defineProperty({}, '__esModule', { value: !0 }); + return ( + Object.keys(e).forEach(function (t) { + var n = Object.getOwnPropertyDescriptor(e, t); + Object.defineProperty( + r, + t, + n.get + ? n + : { + enumerable: !0, + get: function () { + return e[t]; + }, + }, + ); + }), + r + ); + } + var r = { + Aacute: '\xc1', + aacute: '\xe1', + Abreve: '\u0102', + abreve: '\u0103', + ac: '\u223e', + acd: '\u223f', + acE: '\u223e\u0333', + Acirc: '\xc2', + acirc: '\xe2', + acute: '\xb4', + Acy: '\u0410', + acy: '\u0430', + AElig: '\xc6', + aelig: '\xe6', + af: '\u2061', + Afr: '\ud835\udd04', + afr: '\ud835\udd1e', + Agrave: '\xc0', + agrave: '\xe0', + 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: '\xc5', + 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: '\xc5', + aring: '\xe5', + Ascr: '\ud835\udc9c', + ascr: '\ud835\udcb6', + Assign: '\u2254', + ast: '*', + asymp: '\u2248', + asympeq: '\u224d', + Atilde: '\xc3', + atilde: '\xe3', + Auml: '\xc4', + auml: '\xe4', + 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: '\xa6', + 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: '\xc7', + ccedil: '\xe7', + Ccirc: '\u0108', + ccirc: '\u0109', + Cconint: '\u2230', + ccups: '\u2a4c', + ccupssm: '\u2a50', + Cdot: '\u010a', + cdot: '\u010b', + cedil: '\xb8', + Cedilla: '\xb8', + cemptyv: '\u29b2', + cent: '\xa2', + centerdot: '\xb7', + CenterDot: '\xb7', + 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: '\xae', + 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: '\xa9', + COPY: '\xa9', + 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: '\xa4', + 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: '\xb0', + Del: '\u2207', + Delta: '\u0394', + delta: '\u03b4', + demptyv: '\u29b1', + dfisht: '\u297f', + Dfr: '\ud835\udd07', + dfr: '\ud835\udd21', + dHar: '\u2965', + dharl: '\u21c3', + dharr: '\u21c2', + DiacriticalAcute: '\xb4', + DiacriticalDot: '\u02d9', + DiacriticalDoubleAcute: '\u02dd', + DiacriticalGrave: '`', + DiacriticalTilde: '\u02dc', + diam: '\u22c4', + diamond: '\u22c4', + Diamond: '\u22c4', + diamondsuit: '\u2666', + diams: '\u2666', + die: '\xa8', + DifferentialD: '\u2146', + digamma: '\u03dd', + disin: '\u22f2', + div: '\xf7', + divide: '\xf7', + divideontimes: '\u22c7', + divonx: '\u22c7', + DJcy: '\u0402', + djcy: '\u0452', + dlcorn: '\u231e', + dlcrop: '\u230d', + dollar: '$', + Dopf: '\ud835\udd3b', + dopf: '\ud835\udd55', + Dot: '\xa8', + dot: '\u02d9', + DotDot: '\u20dc', + doteq: '\u2250', + doteqdot: '\u2251', + DotEqual: '\u2250', + dotminus: '\u2238', + dotplus: '\u2214', + dotsquare: '\u22a1', + doublebarwedge: '\u2306', + DoubleContourIntegral: '\u222f', + DoubleDot: '\xa8', + 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: '\xc9', + eacute: '\xe9', + easter: '\u2a6e', + Ecaron: '\u011a', + ecaron: '\u011b', + Ecirc: '\xca', + ecirc: '\xea', + 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: '\xc8', + egrave: '\xe8', + 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: '\xd0', + eth: '\xf0', + Euml: '\xcb', + euml: '\xeb', + 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: '\xbd', + frac13: '\u2153', + frac14: '\xbc', + frac15: '\u2155', + frac16: '\u2159', + frac18: '\u215b', + frac23: '\u2154', + frac25: '\u2156', + frac34: '\xbe', + 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: '\xbd', + 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: '\xcd', + iacute: '\xed', + ic: '\u2063', + Icirc: '\xce', + icirc: '\xee', + Icy: '\u0418', + icy: '\u0438', + Idot: '\u0130', + IEcy: '\u0415', + iecy: '\u0435', + iexcl: '\xa1', + iff: '\u21d4', + ifr: '\ud835\udd26', + Ifr: '\u2111', + Igrave: '\xcc', + igrave: '\xec', + 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: '\xbf', + 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: '\xcf', + iuml: '\xef', + 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: '\xab', + 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: '\xaf', + 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: '\xb5', + midast: '*', + midcir: '\u2af0', + mid: '\u2223', + middot: '\xb7', + 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: '\xa0', + 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: '\xa0', + nopf: '\ud835\udd5f', + Nopf: '\u2115', + Not: '\u2aec', + not: '\xac', + 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: '\xd1', + ntilde: '\xf1', + 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: '\xd3', + oacute: '\xf3', + oast: '\u229b', + Ocirc: '\xd4', + ocirc: '\xf4', + 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: '\xd2', + ograve: '\xf2', + 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: '\xaa', + ordm: '\xba', + origof: '\u22b6', + oror: '\u2a56', + orslope: '\u2a57', + orv: '\u2a5b', + oS: '\u24c8', + Oscr: '\ud835\udcaa', + oscr: '\u2134', + Oslash: '\xd8', + oslash: '\xf8', + osol: '\u2298', + Otilde: '\xd5', + otilde: '\xf5', + otimesas: '\u2a36', + Otimes: '\u2a37', + otimes: '\u2297', + Ouml: '\xd6', + ouml: '\xf6', + ovbar: '\u233d', + OverBar: '\u203e', + OverBrace: '\u23de', + OverBracket: '\u23b4', + OverParenthesis: '\u23dc', + para: '\xb6', + 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: '\xb1', + plusmn: '\xb1', + plussim: '\u2a26', + plustwo: '\u2a27', + pm: '\xb1', + Poincareplane: '\u210c', + pointint: '\u2a15', + popf: '\ud835\udd61', + Popf: '\u2119', + pound: '\xa3', + 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: '\xbb', + 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: '\xae', + REG: '\xae', + 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: '\xa7', + 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: '\xad', + 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: '\xaf', + 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: '\xb9', + sup2: '\xb2', + sup3: '\xb3', + 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: '\xdf', + 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: '\xde', + thorn: '\xfe', + tilde: '\u02dc', + Tilde: '\u223c', + TildeEqual: '\u2243', + TildeFullEqual: '\u2245', + TildeTilde: '\u2248', + timesbar: '\u2a31', + timesb: '\u22a0', + times: '\xd7', + 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: '\xda', + uacute: '\xfa', + uarr: '\u2191', + Uarr: '\u219f', + uArr: '\u21d1', + Uarrocir: '\u2949', + Ubrcy: '\u040e', + ubrcy: '\u045e', + Ubreve: '\u016c', + ubreve: '\u016d', + Ucirc: '\xdb', + ucirc: '\xfb', + Ucy: '\u0423', + ucy: '\u0443', + udarr: '\u21c5', + Udblac: '\u0170', + udblac: '\u0171', + udhar: '\u296e', + ufisht: '\u297e', + Ufr: '\ud835\udd18', + ufr: '\ud835\udd32', + Ugrave: '\xd9', + ugrave: '\xf9', + uHar: '\u2963', + uharl: '\u21bf', + uharr: '\u21be', + uhblk: '\u2580', + ulcorn: '\u231c', + ulcorner: '\u231c', + ulcrop: '\u230f', + ultri: '\u25f8', + Umacr: '\u016a', + umacr: '\u016b', + uml: '\xa8', + 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: '\xdc', + uuml: '\xfc', + 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: '\xdd', + yacute: '\xfd', + YAcy: '\u042f', + yacy: '\u044f', + Ycirc: '\u0176', + ycirc: '\u0177', + Ycy: '\u042b', + ycy: '\u044b', + yen: '\xa5', + 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: '\xff', + 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', + }, + t = + /[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/, + n = {}; + function s(e, r, t) { + var o, + i, + a, + c, + l, + u = ''; + for ( + 'string' != typeof r && ((t = r), (r = s.defaultChars)), + void 0 === t && (t = !0), + l = (function (e) { + var r, + t, + s = n[e]; + if (s) return s; + for (s = n[e] = [], r = 0; r < 128; r++) + (t = String.fromCharCode(r)), + /^[0-9a-z]$/i.test(t) + ? s.push(t) + : s.push('%' + ('0' + r.toString(16).toUpperCase()).slice(-2)); + for (r = 0; r < e.length; r++) s[e.charCodeAt(r)] = e[r]; + return s; + })(r), + o = 0, + i = e.length; + o < i; + o++ + ) + if ( + ((a = e.charCodeAt(o)), + t && + 37 === a && + o + 2 < i && + /^[0-9a-f]{2}$/i.test(e.slice(o + 1, o + 3))) + ) + (u += e.slice(o, o + 3)), (o += 2); + else if (a < 128) u += l[a]; + else if (a >= 55296 && a <= 57343) { + if ( + a >= 55296 && + a <= 56319 && + o + 1 < i && + (c = e.charCodeAt(o + 1)) >= 56320 && + c <= 57343 + ) { + (u += encodeURIComponent(e[o] + e[o + 1])), o++; + continue; + } + u += '%EF%BF%BD'; + } else u += encodeURIComponent(e[o]); + return u; + } + (s.defaultChars = ";/?:@&=+$,-_.!~*'()#"), (s.componentChars = "-_.!~*'()"); + var o = s, + i = {}; + function a(e, r) { + var t; + return ( + 'string' != typeof r && (r = a.defaultChars), + (t = (function (e) { + var r, + t, + n = i[e]; + if (n) return n; + for (n = i[e] = [], r = 0; r < 128; r++) + (t = String.fromCharCode(r)), n.push(t); + for (r = 0; r < e.length; r++) + n[(t = e.charCodeAt(r))] = + '%' + ('0' + t.toString(16).toUpperCase()).slice(-2); + return n; + })(r)), + e.replace(/(%[a-f0-9]{2})+/gi, function (e) { + var r, + n, + s, + o, + i, + a, + c, + l = ''; + for (r = 0, n = e.length; r < n; r += 3) + (s = parseInt(e.slice(r + 1, r + 3), 16)) < 128 + ? (l += t[s]) + : 192 == (224 & s) && + r + 3 < n && + 128 == (192 & (o = parseInt(e.slice(r + 4, r + 6), 16))) + ? ((l += + (c = ((s << 6) & 1984) | (63 & o)) < 128 + ? '\ufffd\ufffd' + : String.fromCharCode(c)), + (r += 3)) + : 224 == (240 & s) && + r + 6 < n && + ((o = parseInt(e.slice(r + 4, r + 6), 16)), + (i = parseInt(e.slice(r + 7, r + 9), 16)), + 128 == (192 & o) && 128 == (192 & i)) + ? ((l += + (c = ((s << 12) & 61440) | ((o << 6) & 4032) | (63 & i)) < + 2048 || + (c >= 55296 && c <= 57343) + ? '\ufffd\ufffd\ufffd' + : String.fromCharCode(c)), + (r += 6)) + : 240 == (248 & s) && + r + 9 < n && + ((o = parseInt(e.slice(r + 4, r + 6), 16)), + (i = parseInt(e.slice(r + 7, r + 9), 16)), + (a = parseInt(e.slice(r + 10, r + 12), 16)), + 128 == (192 & o) && 128 == (192 & i) && 128 == (192 & a)) + ? ((c = + ((s << 18) & 1835008) | + ((o << 12) & 258048) | + ((i << 6) & 4032) | + (63 & a)) < 65536 || c > 1114111 + ? (l += '\ufffd\ufffd\ufffd\ufffd') + : ((c -= 65536), + (l += String.fromCharCode( + 55296 + (c >> 10), + 56320 + (1023 & c), + ))), + (r += 9)) + : (l += '\ufffd'); + return l; + }) + ); + } + (a.defaultChars = ';/?:@&=+$,#'), (a.componentChars = ''); + var c = a; + function l() { + (this.protocol = null), + (this.slashes = null), + (this.auth = null), + (this.port = null), + (this.hostname = null), + (this.hash = null), + (this.search = null), + (this.pathname = null); + } + var u = /^([a-z0-9.+-]+:)/i, + p = /:[0-9]*$/, + h = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + f = ['{', '}', '|', '\\', '^', '`'].concat([ + '<', + '>', + '"', + '`', + ' ', + '\r', + '\n', + '\t', + ]), + d = ["'"].concat(f), + m = ['%', '/', '?', ';', '#'].concat(d), + g = ['/', '?', '#'], + _ = /^[+a-z0-9A-Z_-]{0,63}$/, + b = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + k = { javascript: !0, 'javascript:': !0 }, + v = { + http: !0, + https: !0, + ftp: !0, + gopher: !0, + file: !0, + 'http:': !0, + 'https:': !0, + 'ftp:': !0, + 'gopher:': !0, + 'file:': !0, + }; + (l.prototype.parse = function (e, r) { + var t, + n, + s, + o, + i, + a = e; + if (((a = a.trim()), !r && 1 === e.split('#').length)) { + var c = h.exec(a); + if (c) return (this.pathname = c[1]), c[2] && (this.search = c[2]), this; + } + var l = u.exec(a); + if ( + (l && + ((s = (l = l[0]).toLowerCase()), + (this.protocol = l), + (a = a.substr(l.length))), + (r || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) && + (!(i = '//' === a.substr(0, 2)) || + (l && k[l]) || + ((a = a.substr(2)), (this.slashes = !0))), + !k[l] && (i || (l && !v[l]))) + ) { + var p, + f, + d = -1; + for (t = 0; t < g.length; t++) + -1 !== (o = a.indexOf(g[t])) && (-1 === d || o < d) && (d = o); + for ( + -1 !== (f = -1 === d ? a.lastIndexOf('@') : a.lastIndexOf('@', d)) && + ((p = a.slice(0, f)), (a = a.slice(f + 1)), (this.auth = p)), + d = -1, + t = 0; + t < m.length; + t++ + ) + -1 !== (o = a.indexOf(m[t])) && (-1 === d || o < d) && (d = o); + -1 === d && (d = a.length), ':' === a[d - 1] && d--; + var C = a.slice(0, d); + (a = a.slice(d)), + this.parseHost(C), + (this.hostname = this.hostname || ''); + var y = + '[' === this.hostname[0] && + ']' === this.hostname[this.hostname.length - 1]; + if (!y) { + var A = this.hostname.split(/\./); + for (t = 0, n = A.length; t < n; t++) { + var x = A[t]; + if (x && !x.match(_)) { + for (var D = '', w = 0, E = x.length; w < E; w++) + x.charCodeAt(w) > 127 ? (D += 'x') : (D += x[w]); + if (!D.match(_)) { + var q = A.slice(0, t), + S = A.slice(t + 1), + F = x.match(b); + F && (q.push(F[1]), S.unshift(F[2])), + S.length && (a = S.join('.') + a), + (this.hostname = q.join('.')); + break; + } + } + } + } + this.hostname.length > 255 && (this.hostname = ''), + y && + (this.hostname = this.hostname.substr(1, this.hostname.length - 2)); + } + var L = a.indexOf('#'); + -1 !== L && ((this.hash = a.substr(L)), (a = a.slice(0, L))); + var z = a.indexOf('?'); + return ( + -1 !== z && ((this.search = a.substr(z)), (a = a.slice(0, z))), + a && (this.pathname = a), + v[s] && this.hostname && !this.pathname && (this.pathname = ''), + this + ); + }), + (l.prototype.parseHost = function (e) { + var r = p.exec(e); + r && + (':' !== (r = r[0]) && (this.port = r.substr(1)), + (e = e.substr(0, e.length - r.length))), + e && (this.hostname = e); + }); + var C = { + encode: o, + decode: c, + format: function (e) { + var r = ''; + return ( + (r += e.protocol || ''), + (r += e.slashes ? '//' : ''), + (r += e.auth ? e.auth + '@' : ''), + e.hostname && -1 !== e.hostname.indexOf(':') + ? (r += '[' + e.hostname + ']') + : (r += e.hostname || ''), + (r += e.port ? ':' + e.port : ''), + (r += e.pathname || ''), + (r += e.search || ''), + (r += e.hash || '') + ); + }, + parse: function (e, r) { + if (e && e instanceof l) return e; + var t = new l(); + return t.parse(e, r), t; + }, + }, + y = + /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, + A = /[\0-\x1F\x7F-\x9F]/, + x = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, + D = { + Any: y, + Cc: A, + Cf: /[\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]/, + P: t, + Z: x, + }, + w = (function (e, r, t) { + return ( + e( + (t = { + path: r, + exports: {}, + require: function (e, r) { + return (function () { + throw new Error( + 'Dynamic requires are not currently supported by @rollup/plugin-commonjs', + ); + })(null == r && t.path); + }, + }), + t.exports, + ), + t.exports + ); + })(function (e, n) { + var s = Object.prototype.hasOwnProperty; + function o(e, r) { + return s.call(e, r); + } + function i(e) { + return ( + !(e >= 55296 && e <= 57343) && + !(e >= 64976 && e <= 65007) && + 65535 != (65535 & e) && + 65534 != (65535 & e) && + !(e >= 0 && e <= 8) && + 11 !== e && + !(e >= 14 && e <= 31) && + !(e >= 127 && e <= 159) && + !(e > 1114111) + ); + } + function a(e) { + if (e > 65535) { + var r = 55296 + ((e -= 65536) >> 10), + t = 56320 + (1023 & e); + return String.fromCharCode(r, t); + } + return String.fromCharCode(e); + } + var c = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g, + l = new RegExp( + c.source + '|' + /&([a-z#][a-z0-9]{1,31});/gi.source, + 'gi', + ), + u = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i; + var p = /[&<>"]/, + h = /[&<>"]/g, + f = { '&': '&', '<': '<', '>': '>', '"': '"' }; + function d(e) { + return f[e]; + } + var m = /[.?*+^$[\]\\(){}|-]/g; + (n.lib = {}), + (n.lib.mdurl = C), + (n.lib.ucmicro = D), + (n.assign = function (e) { + var r = Array.prototype.slice.call(arguments, 1); + return ( + r.forEach(function (r) { + if (r) { + if ('object' != typeof r) + throw new TypeError(r + 'must be object'); + Object.keys(r).forEach(function (t) { + e[t] = r[t]; + }); + } + }), + e + ); + }), + (n.isString = function (e) { + return ( + '[object String]' === + (function (e) { + return Object.prototype.toString.call(e); + })(e) + ); + }), + (n.has = o), + (n.unescapeMd = function (e) { + return e.indexOf('\\') < 0 ? e : e.replace(c, '$1'); + }), + (n.unescapeAll = function (e) { + return e.indexOf('\\') < 0 && e.indexOf('&') < 0 + ? e + : e.replace(l, function (e, t, n) { + return ( + t || + (function (e, t) { + var n = 0; + return o(r, t) + ? r[t] + : 35 === t.charCodeAt(0) && + u.test(t) && + i( + (n = + 'x' === t[1].toLowerCase() + ? parseInt(t.slice(2), 16) + : parseInt(t.slice(1), 10)), + ) + ? a(n) + : e; + })(e, n) + ); + }); + }), + (n.isValidEntityCode = i), + (n.fromCodePoint = a), + (n.escapeHtml = function (e) { + return p.test(e) ? e.replace(h, d) : e; + }), + (n.arrayReplaceAt = function (e, r, t) { + return [].concat(e.slice(0, r), t, e.slice(r + 1)); + }), + (n.isSpace = function (e) { + switch (e) { + case 9: + case 32: + return !0; + } + return !1; + }), + (n.isWhiteSpace = function (e) { + if (e >= 8192 && e <= 8202) return !0; + switch (e) { + case 9: + case 10: + case 11: + case 12: + case 13: + case 32: + case 160: + case 5760: + case 8239: + case 8287: + case 12288: + return !0; + } + return !1; + }), + (n.isMdAsciiPunct = function (e) { + switch (e) { + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 123: + case 124: + case 125: + case 126: + return !0; + default: + return !1; + } + }), + (n.isPunctChar = function (e) { + return t.test(e); + }), + (n.escapeRE = function (e) { + return e.replace(m, '\\$&'); + }), + (n.normalizeReference = function (e) { + return ( + (e = e.trim().replace(/\s+/g, ' ')), + '\u1e7e' === '\u1e9e'.toLowerCase() && + (e = e.replace(/\u1e9e/g, '\xdf')), + e.toLowerCase().toUpperCase() + ); + }); + }), + E = w.unescapeAll, + q = w.unescapeAll, + S = { + parseLinkLabel: function (e, r, t) { + var n, + s, + o, + i, + a = -1, + c = e.posMax, + l = e.pos; + for (e.pos = r + 1, n = 1; e.pos < c; ) { + if (93 === (o = e.src.charCodeAt(e.pos)) && 0 === --n) { + s = !0; + break; + } + if (((i = e.pos), e.md.inline.skipToken(e), 91 === o)) + if (i === e.pos - 1) n++; + else if (t) return (e.pos = l), -1; + } + return s && (a = e.pos), (e.pos = l), a; + }, + parseLinkDestination: function (e, r, t) { + var n, + s, + o = r, + i = { ok: !1, pos: 0, lines: 0, str: '' }; + if (60 === e.charCodeAt(r)) { + for (r++; r < t; ) { + if (10 === (n = e.charCodeAt(r))) return i; + if (60 === n) return i; + if (62 === n) + return ( + (i.pos = r + 1), (i.str = E(e.slice(o + 1, r))), (i.ok = !0), i + ); + 92 === n && r + 1 < t ? (r += 2) : r++; + } + return i; + } + for ( + s = 0; + r < t && 32 !== (n = e.charCodeAt(r)) && !(n < 32 || 127 === n); + + ) + if (92 === n && r + 1 < t) { + if (32 === e.charCodeAt(r + 1)) break; + r += 2; + } else { + if (40 === n && ++s > 32) return i; + if (41 === n) { + if (0 === s) break; + s--; + } + r++; + } + return ( + o === r || + 0 !== s || + ((i.str = E(e.slice(o, r))), + (i.lines = 0), + (i.pos = r), + (i.ok = !0)), + i + ); + }, + parseLinkTitle: function (e, r, t) { + var n, + s, + o = 0, + i = r, + a = { ok: !1, pos: 0, lines: 0, str: '' }; + if (r >= t) return a; + if (34 !== (s = e.charCodeAt(r)) && 39 !== s && 40 !== s) return a; + for (r++, 40 === s && (s = 41); r < t; ) { + if ((n = e.charCodeAt(r)) === s) + return ( + (a.pos = r + 1), + (a.lines = o), + (a.str = q(e.slice(i + 1, r))), + (a.ok = !0), + a + ); + if (40 === n && 41 === s) return a; + 10 === n + ? o++ + : 92 === n && r + 1 < t && (r++, 10 === e.charCodeAt(r) && o++), + r++; + } + return a; + }, + }, + F = w.assign, + L = w.unescapeAll, + z = w.escapeHtml, + T = {}; + function I() { + this.rules = F({}, T); + } + (T.code_inline = function (e, r, t, n, s) { + var o = e[r]; + return '' + z(e[r].content) + ''; + }), + (T.code_block = function (e, r, t, n, s) { + var o = e[r]; + return ( + '' + + z(e[r].content) + + '\n' + ); + }), + (T.fence = function (e, r, t, n, s) { + var o, + i, + a, + c, + l, + u = e[r], + p = u.info ? L(u.info).trim() : '', + h = '', + f = ''; + return ( + p && ((h = (a = p.split(/(\s+)/g))[0]), (f = a.slice(2).join(''))), + 0 === + (o = + (t.highlight && t.highlight(u.content, h, f)) || + z(u.content)).indexOf('' + o + '\n') + : '
' + o + '
\n' + ); + }), + (T.image = function (e, r, t, n, s) { + var o = e[r]; + return ( + (o.attrs[o.attrIndex('alt')][1] = s.renderInlineAsText( + o.children, + t, + n, + )), + s.renderToken(e, r, t) + ); + }), + (T.hardbreak = function (e, r, t) { + return t.xhtmlOut ? '
\n' : '
\n'; + }), + (T.softbreak = function (e, r, t) { + return t.breaks ? (t.xhtmlOut ? '
\n' : '
\n') : '\n'; + }), + (T.text = function (e, r) { + return z(e[r].content); + }), + (T.html_block = function (e, r) { + return e[r].content; + }), + (T.html_inline = function (e, r) { + return e[r].content; + }), + (I.prototype.renderAttrs = function (e) { + var r, t, n; + if (!e.attrs) return ''; + for (n = '', r = 0, t = e.attrs.length; r < t; r++) + n += ' ' + z(e.attrs[r][0]) + '="' + z(e.attrs[r][1]) + '"'; + return n; + }), + (I.prototype.renderToken = function (e, r, t) { + var n, + s = '', + o = !1, + i = e[r]; + return i.hidden + ? '' + : (i.block && -1 !== i.nesting && r && e[r - 1].hidden && (s += '\n'), + (s += (-1 === i.nesting ? '\n' : '>')); + }), + (I.prototype.renderInline = function (e, r, t) { + for (var n, s = '', o = this.rules, i = 0, a = e.length; i < a; i++) + void 0 !== o[(n = e[i].type)] + ? (s += o[n](e, i, r, t, this)) + : (s += this.renderToken(e, i, r)); + return s; + }), + (I.prototype.renderInlineAsText = function (e, r, t) { + for (var n = '', s = 0, o = e.length; s < o; s++) + 'text' === e[s].type + ? (n += e[s].content) + : 'image' === e[s].type && + (n += this.renderInlineAsText(e[s].children, r, t)); + return n; + }), + (I.prototype.render = function (e, r, t) { + var n, + s, + o, + i = '', + a = this.rules; + for (n = 0, s = e.length; n < s; n++) + 'inline' === (o = e[n].type) + ? (i += this.renderInline(e[n].children, r, t)) + : void 0 !== a[o] + ? (i += a[e[n].type](e, n, r, t, this)) + : (i += this.renderToken(e, n, r, t)); + return i; + }); + var R = I; + function M() { + (this.__rules__ = []), (this.__cache__ = null); + } + (M.prototype.__find__ = function (e) { + for (var r = 0; r < this.__rules__.length; r++) + if (this.__rules__[r].name === e) return r; + return -1; + }), + (M.prototype.__compile__ = function () { + var e = this, + r = ['']; + e.__rules__.forEach(function (e) { + e.enabled && + e.alt.forEach(function (e) { + r.indexOf(e) < 0 && r.push(e); + }); + }), + (e.__cache__ = {}), + r.forEach(function (r) { + (e.__cache__[r] = []), + e.__rules__.forEach(function (t) { + t.enabled && + ((r && t.alt.indexOf(r) < 0) || e.__cache__[r].push(t.fn)); + }); + }); + }), + (M.prototype.at = function (e, r, t) { + var n = this.__find__(e), + s = t || {}; + if (-1 === n) throw new Error('Parser rule not found: ' + e); + (this.__rules__[n].fn = r), + (this.__rules__[n].alt = s.alt || []), + (this.__cache__ = null); + }), + (M.prototype.before = function (e, r, t, n) { + var s = this.__find__(e), + o = n || {}; + if (-1 === s) throw new Error('Parser rule not found: ' + e); + this.__rules__.splice(s, 0, { + name: r, + enabled: !0, + fn: t, + alt: o.alt || [], + }), + (this.__cache__ = null); + }), + (M.prototype.after = function (e, r, t, n) { + var s = this.__find__(e), + o = n || {}; + if (-1 === s) throw new Error('Parser rule not found: ' + e); + this.__rules__.splice(s + 1, 0, { + name: r, + enabled: !0, + fn: t, + alt: o.alt || [], + }), + (this.__cache__ = null); + }), + (M.prototype.push = function (e, r, t) { + var n = t || {}; + this.__rules__.push({ name: e, enabled: !0, fn: r, alt: n.alt || [] }), + (this.__cache__ = null); + }), + (M.prototype.enable = function (e, r) { + Array.isArray(e) || (e = [e]); + var t = []; + return ( + e.forEach(function (e) { + var n = this.__find__(e); + if (n < 0) { + if (r) return; + throw new Error('Rules manager: invalid rule name ' + e); + } + (this.__rules__[n].enabled = !0), t.push(e); + }, this), + (this.__cache__ = null), + t + ); + }), + (M.prototype.enableOnly = function (e, r) { + Array.isArray(e) || (e = [e]), + this.__rules__.forEach(function (e) { + e.enabled = !1; + }), + this.enable(e, r); + }), + (M.prototype.disable = function (e, r) { + Array.isArray(e) || (e = [e]); + var t = []; + return ( + e.forEach(function (e) { + var n = this.__find__(e); + if (n < 0) { + if (r) return; + throw new Error('Rules manager: invalid rule name ' + e); + } + (this.__rules__[n].enabled = !1), t.push(e); + }, this), + (this.__cache__ = null), + t + ); + }), + (M.prototype.getRules = function (e) { + return ( + null === this.__cache__ && this.__compile__(), this.__cache__[e] || [] + ); + }); + var B = M, + N = /\r\n?|\n/g, + O = /\0/g, + P = w.arrayReplaceAt; + function j(e) { + return /^<\/a\s*>/i.test(e); + } + var U = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/, + V = /\((c|tm|r|p)\)/i, + Z = /\((c|tm|r|p)\)/gi, + G = { c: '\xa9', r: '\xae', p: '\xa7', tm: '\u2122' }; + function $(e, r) { + return G[r.toLowerCase()]; + } + function H(e) { + var r, + t, + n = 0; + for (r = e.length - 1; r >= 0; r--) + 'text' !== (t = e[r]).type || n || (t.content = t.content.replace(Z, $)), + 'link_open' === t.type && 'auto' === t.info && n--, + 'link_close' === t.type && 'auto' === t.info && n++; + } + function J(e) { + var r, + t, + n = 0; + for (r = e.length - 1; r >= 0; r--) + 'text' !== (t = e[r]).type || + n || + (U.test(t.content) && + (t.content = t.content + .replace(/\+-/g, '\xb1') + .replace(/\.{2,}/g, '\u2026') + .replace(/([?!])\u2026/g, '$1..') + .replace(/([?!]){4,}/g, '$1$1$1') + .replace(/,{2,}/g, ',') + .replace(/(^|[^-])---(?=[^-]|$)/gm, '$1\u2014') + .replace(/(^|\s)--(?=\s|$)/gm, '$1\u2013') + .replace(/(^|[^-\s])--(?=[^-\s]|$)/gm, '$1\u2013'))), + 'link_open' === t.type && 'auto' === t.info && n--, + 'link_close' === t.type && 'auto' === t.info && n++; + } + var W = w.isWhiteSpace, + Y = w.isPunctChar, + K = w.isMdAsciiPunct, + Q = /['"]/, + X = /['"]/g; + function ee(e, r, t) { + return e.substr(0, r) + t + e.substr(r + 1); + } + function re(e, r) { + var t, n, s, o, i, a, c, l, u, p, h, f, d, m, g, _, b, k, v, C, y; + for (v = [], t = 0; t < e.length; t++) { + for ( + n = e[t], c = e[t].level, b = v.length - 1; + b >= 0 && !(v[b].level <= c); + b-- + ); + if (((v.length = b + 1), 'text' === n.type)) { + (i = 0), (a = (s = n.content).length); + e: for (; i < a && ((X.lastIndex = i), (o = X.exec(s))); ) { + if ( + ((g = _ = !0), + (i = o.index + 1), + (k = "'" === o[0]), + (u = 32), + o.index - 1 >= 0) + ) + u = s.charCodeAt(o.index - 1); + else + for ( + b = t - 1; + b >= 0 && 'softbreak' !== e[b].type && 'hardbreak' !== e[b].type; + b-- + ) + if (e[b].content) { + u = e[b].content.charCodeAt(e[b].content.length - 1); + break; + } + if (((p = 32), i < a)) p = s.charCodeAt(i); + else + for ( + b = t + 1; + b < e.length && + 'softbreak' !== e[b].type && + 'hardbreak' !== e[b].type; + b++ + ) + if (e[b].content) { + p = e[b].content.charCodeAt(0); + break; + } + if ( + ((h = K(u) || Y(String.fromCharCode(u))), + (f = K(p) || Y(String.fromCharCode(p))), + (d = W(u)), + (m = W(p)) ? (g = !1) : f && (d || h || (g = !1)), + d ? (_ = !1) : h && (m || f || (_ = !1)), + 34 === p && '"' === o[0] && u >= 48 && u <= 57 && (_ = g = !1), + g && _ && ((g = h), (_ = f)), + g || _) + ) { + if (_) + for ( + b = v.length - 1; + b >= 0 && ((l = v[b]), !(v[b].level < c)); + b-- + ) + if (l.single === k && v[b].level === c) { + (l = v[b]), + k + ? ((C = r.md.options.quotes[2]), + (y = r.md.options.quotes[3])) + : ((C = r.md.options.quotes[0]), + (y = r.md.options.quotes[1])), + (n.content = ee(n.content, o.index, y)), + (e[l.token].content = ee(e[l.token].content, l.pos, C)), + (i += y.length - 1), + l.token === t && (i += C.length - 1), + (a = (s = n.content).length), + (v.length = b); + continue e; + } + g + ? v.push({ token: t, pos: o.index, single: k, level: c }) + : _ && k && (n.content = ee(n.content, o.index, '\u2019')); + } else k && (n.content = ee(n.content, o.index, '\u2019')); + } + } + } + } + function te(e, r, t) { + (this.type = e), + (this.tag = r), + (this.attrs = null), + (this.map = null), + (this.nesting = t), + (this.level = 0), + (this.children = null), + (this.content = ''), + (this.markup = ''), + (this.info = ''), + (this.meta = null), + (this.block = !1), + (this.hidden = !1); + } + (te.prototype.attrIndex = function (e) { + var r, t, n; + if (!this.attrs) return -1; + for (t = 0, n = (r = this.attrs).length; t < n; t++) + if (r[t][0] === e) return t; + return -1; + }), + (te.prototype.attrPush = function (e) { + this.attrs ? this.attrs.push(e) : (this.attrs = [e]); + }), + (te.prototype.attrSet = function (e, r) { + var t = this.attrIndex(e), + n = [e, r]; + t < 0 ? this.attrPush(n) : (this.attrs[t] = n); + }), + (te.prototype.attrGet = function (e) { + var r = this.attrIndex(e), + t = null; + return r >= 0 && (t = this.attrs[r][1]), t; + }), + (te.prototype.attrJoin = function (e, r) { + var t = this.attrIndex(e); + t < 0 + ? this.attrPush([e, r]) + : (this.attrs[t][1] = this.attrs[t][1] + ' ' + r); + }); + var ne = te; + function se(e, r, t) { + (this.src = e), + (this.env = t), + (this.tokens = []), + (this.inlineMode = !1), + (this.md = r); + } + se.prototype.Token = ne; + var oe = se, + ie = [ + [ + 'normalize', + function (e) { + var r; + (r = (r = e.src.replace(N, '\n')).replace(O, '\ufffd')), (e.src = r); + }, + ], + [ + 'block', + function (e) { + var r; + e.inlineMode + ? (((r = new e.Token('inline', '', 0)).content = e.src), + (r.map = [0, 1]), + (r.children = []), + e.tokens.push(r)) + : e.md.block.parse(e.src, e.md, e.env, e.tokens); + }, + ], + [ + 'inline', + function (e) { + var r, + t, + n, + s = e.tokens; + for (t = 0, n = s.length; t < n; t++) + 'inline' === (r = s[t]).type && + e.md.inline.parse(r.content, e.md, e.env, r.children); + }, + ], + [ + 'linkify', + function (e) { + var r, + t, + n, + s, + o, + i, + a, + c, + l, + u, + p, + h, + f, + d, + m, + g, + _, + b, + k = e.tokens; + if (e.md.options.linkify) + for (t = 0, n = k.length; t < n; t++) + if ('inline' === k[t].type && e.md.linkify.pretest(k[t].content)) + for (f = 0, r = (s = k[t].children).length - 1; r >= 0; r--) + if ('link_close' !== (i = s[r]).type) { + if ( + ('html_inline' === i.type && + ((b = i.content), + /^\s]/i.test(b) && f > 0 && f--, + j(i.content) && f++), + !(f > 0) && + 'text' === i.type && + e.md.linkify.test(i.content)) + ) { + for ( + l = i.content, + _ = e.md.linkify.match(l), + a = [], + h = i.level, + p = 0, + c = 0; + c < _.length; + c++ + ) + (d = _[c].url), + (m = e.md.normalizeLink(d)), + e.md.validateLink(m) && + ((g = _[c].text), + (g = _[c].schema + ? 'mailto:' !== _[c].schema || /^mailto:/i.test(g) + ? e.md.normalizeLinkText(g) + : e.md + .normalizeLinkText('mailto:' + g) + .replace(/^mailto:/, '') + : e.md + .normalizeLinkText('http://' + g) + .replace(/^http:\/\//, '')), + (u = _[c].index) > p && + (((o = new e.Token('text', '', 0)).content = + l.slice(p, u)), + (o.level = h), + a.push(o)), + ((o = new e.Token('link_open', 'a', 1)).attrs = [ + ['href', m], + ]), + (o.level = h++), + (o.markup = 'linkify'), + (o.info = 'auto'), + a.push(o), + ((o = new e.Token('text', '', 0)).content = g), + (o.level = h), + a.push(o), + ((o = new e.Token('link_close', 'a', -1)).level = + --h), + (o.markup = 'linkify'), + (o.info = 'auto'), + a.push(o), + (p = _[c].lastIndex)); + p < l.length && + (((o = new e.Token('text', '', 0)).content = + l.slice(p)), + (o.level = h), + a.push(o)), + (k[t].children = s = P(s, r, a)); + } + } else + for ( + r--; + s[r].level !== i.level && 'link_open' !== s[r].type; + + ) + r--; + }, + ], + [ + 'replacements', + function (e) { + var r; + if (e.md.options.typographer) + for (r = e.tokens.length - 1; r >= 0; r--) + 'inline' === e.tokens[r].type && + (V.test(e.tokens[r].content) && H(e.tokens[r].children), + U.test(e.tokens[r].content) && J(e.tokens[r].children)); + }, + ], + [ + 'smartquotes', + function (e) { + var r; + if (e.md.options.typographer) + for (r = e.tokens.length - 1; r >= 0; r--) + 'inline' === e.tokens[r].type && + Q.test(e.tokens[r].content) && + re(e.tokens[r].children, e); + }, + ], + ]; + function ae() { + this.ruler = new B(); + for (var e = 0; e < ie.length; e++) this.ruler.push(ie[e][0], ie[e][1]); + } + (ae.prototype.process = function (e) { + var r, t, n; + for (r = 0, t = (n = this.ruler.getRules('')).length; r < t; r++) n[r](e); + }), + (ae.prototype.State = oe); + var ce = ae, + le = w.isSpace; + function ue(e, r) { + var t = e.bMarks[r] + e.tShift[r], + n = e.eMarks[r]; + return e.src.substr(t, n - t); + } + function pe(e) { + var r, + t = [], + n = 0, + s = e.length, + o = !1, + i = 0, + a = ''; + for (r = e.charCodeAt(n); n < s; ) + 124 === r && + (o + ? ((a += e.substring(i, n - 1)), (i = n)) + : (t.push(a + e.substring(i, n)), (a = ''), (i = n + 1))), + (o = 92 === r), + n++, + (r = e.charCodeAt(n)); + return t.push(a + e.substring(i)), t; + } + var he = w.isSpace, + fe = w.isSpace, + de = w.isSpace; + function me(e, r) { + var t, n, s, o; + return ( + (n = e.bMarks[r] + e.tShift[r]), + (s = e.eMarks[r]), + (42 !== (t = e.src.charCodeAt(n++)) && 45 !== t && 43 !== t) || + (n < s && ((o = e.src.charCodeAt(n)), !de(o))) + ? -1 + : n + ); + } + function ge(e, r) { + var t, + n = e.bMarks[r] + e.tShift[r], + s = n, + o = e.eMarks[r]; + if (s + 1 >= o) return -1; + if ((t = e.src.charCodeAt(s++)) < 48 || t > 57) return -1; + for (;;) { + if (s >= o) return -1; + if (!((t = e.src.charCodeAt(s++)) >= 48 && t <= 57)) { + if (41 === t || 46 === t) break; + return -1; + } + if (s - n >= 10) return -1; + } + return s < o && ((t = e.src.charCodeAt(s)), !de(t)) ? -1 : s; + } + var _e = w.normalizeReference, + be = w.isSpace, + ke = w.isSpace, + ve = + '<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"\'=<>`\\x00-\\x20]+|\'[^\']*\'|"[^"]*"))?)*\\s*\\/?>', + Ce = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>', + ye = { + HTML_TAG_RE: new RegExp( + '^(?:' + + ve + + '|' + + Ce + + '|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)', + ), + HTML_OPEN_CLOSE_TAG_RE: new RegExp('^(?:' + ve + '|' + Ce + ')'), + }, + Ae = ye.HTML_OPEN_CLOSE_TAG_RE, + xe = [ + [/^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, !0], + [/^/, !0], + [/^<\?/, /\?>/, !0], + [/^/, !0], + [/^/, !0], + [ + new RegExp( + '^|$))', + 'i', + ), + /^$/, + !0, + ], + [new RegExp(Ae.source + '\\s*$'), /^$/, !1], + ], + De = w.isSpace; + function we(e, r, t, n) { + var s, o, i, a, c, l, u, p; + for ( + this.src = e, + this.md = r, + this.env = t, + this.tokens = n, + this.bMarks = [], + this.eMarks = [], + this.tShift = [], + this.sCount = [], + this.bsCount = [], + this.blkIndent = 0, + this.line = 0, + this.lineMax = 0, + this.tight = !1, + this.ddIndent = -1, + this.listIndent = -1, + this.parentType = 'root', + this.level = 0, + this.result = '', + p = !1, + i = a = l = u = 0, + c = (o = this.src).length; + a < c; + a++ + ) { + if (((s = o.charCodeAt(a)), !p)) { + if (De(s)) { + l++, 9 === s ? (u += 4 - (u % 4)) : u++; + continue; + } + p = !0; + } + (10 !== s && a !== c - 1) || + (10 !== s && a++, + this.bMarks.push(i), + this.eMarks.push(a), + this.tShift.push(l), + this.sCount.push(u), + this.bsCount.push(0), + (p = !1), + (l = 0), + (u = 0), + (i = a + 1)); + } + this.bMarks.push(o.length), + this.eMarks.push(o.length), + this.tShift.push(0), + this.sCount.push(0), + this.bsCount.push(0), + (this.lineMax = this.bMarks.length - 1); + } + (we.prototype.push = function (e, r, t) { + var n = new ne(e, r, t); + return ( + (n.block = !0), + t < 0 && this.level--, + (n.level = this.level), + t > 0 && this.level++, + this.tokens.push(n), + n + ); + }), + (we.prototype.isEmpty = function (e) { + return this.bMarks[e] + this.tShift[e] >= this.eMarks[e]; + }), + (we.prototype.skipEmptyLines = function (e) { + for ( + var r = this.lineMax; + e < r && !(this.bMarks[e] + this.tShift[e] < this.eMarks[e]); + e++ + ); + return e; + }), + (we.prototype.skipSpaces = function (e) { + for ( + var r, t = this.src.length; + e < t && ((r = this.src.charCodeAt(e)), De(r)); + e++ + ); + return e; + }), + (we.prototype.skipSpacesBack = function (e, r) { + if (e <= r) return e; + for (; e > r; ) if (!De(this.src.charCodeAt(--e))) return e + 1; + return e; + }), + (we.prototype.skipChars = function (e, r) { + for (var t = this.src.length; e < t && this.src.charCodeAt(e) === r; e++); + return e; + }), + (we.prototype.skipCharsBack = function (e, r, t) { + if (e <= t) return e; + for (; e > t; ) if (r !== this.src.charCodeAt(--e)) return e + 1; + return e; + }), + (we.prototype.getLines = function (e, r, t, n) { + var s, + o, + i, + a, + c, + l, + u, + p = e; + if (e >= r) return ''; + for (l = new Array(r - e), s = 0; p < r; p++, s++) { + for ( + o = 0, + u = a = this.bMarks[p], + c = p + 1 < r || n ? this.eMarks[p] + 1 : this.eMarks[p]; + a < c && o < t; + + ) { + if (((i = this.src.charCodeAt(a)), De(i))) + 9 === i ? (o += 4 - ((o + this.bsCount[p]) % 4)) : o++; + else { + if (!(a - u < this.tShift[p])) break; + o++; + } + a++; + } + l[s] = + o > t + ? new Array(o - t + 1).join(' ') + this.src.slice(a, c) + : this.src.slice(a, c); + } + return l.join(''); + }), + (we.prototype.Token = ne); + var Ee = we, + qe = [ + [ + 'table', + function (e, r, t, n) { + var s, o, i, a, c, l, u, p, h, f, d, m, g, _, b, k; + if (r + 2 > t) return !1; + if (((l = r + 1), e.sCount[l] < e.blkIndent)) return !1; + if (e.sCount[l] - e.blkIndent >= 4) return !1; + if ((i = e.bMarks[l] + e.tShift[l]) >= e.eMarks[l]) return !1; + if (124 !== (s = e.src.charCodeAt(i++)) && 45 !== s && 58 !== s) + return !1; + for (; i < e.eMarks[l]; ) { + if ( + 124 !== (s = e.src.charCodeAt(i)) && + 45 !== s && + 58 !== s && + !le(s) + ) + return !1; + i++; + } + for ( + u = (o = ue(e, r + 1)).split('|'), f = [], a = 0; + a < u.length; + a++ + ) { + if (!(d = u[a].trim())) { + if (0 === a || a === u.length - 1) continue; + return !1; + } + if (!/^:?-+:?$/.test(d)) return !1; + 58 === d.charCodeAt(d.length - 1) + ? f.push(58 === d.charCodeAt(0) ? 'center' : 'right') + : 58 === d.charCodeAt(0) + ? f.push('left') + : f.push(''); + } + if (-1 === (o = ue(e, r).trim()).indexOf('|')) return !1; + if (e.sCount[r] - e.blkIndent >= 4) return !1; + if ( + ((u = pe(o)).length && '' === u[0] && u.shift(), + u.length && '' === u[u.length - 1] && u.pop(), + 0 === (p = u.length) || p !== f.length) + ) + return !1; + if (n) return !0; + for ( + _ = e.parentType, + e.parentType = 'table', + k = e.md.block.ruler.getRules('blockquote'), + (h = e.push('table_open', 'table', 1)).map = m = [r, 0], + (h = e.push('thead_open', 'thead', 1)).map = [r, r + 1], + (h = e.push('tr_open', 'tr', 1)).map = [r, r + 1], + a = 0; + a < u.length; + a++ + ) + (h = e.push('th_open', 'th', 1)), + f[a] && (h.attrs = [['style', 'text-align:' + f[a]]]), + ((h = e.push('inline', '', 0)).content = u[a].trim()), + (h.children = []), + (h = e.push('th_close', 'th', -1)); + for ( + h = e.push('tr_close', 'tr', -1), + h = e.push('thead_close', 'thead', -1), + l = r + 2; + l < t && !(e.sCount[l] < e.blkIndent); + l++ + ) { + for (b = !1, a = 0, c = k.length; a < c; a++) + if (k[a](e, l, t, !0)) { + b = !0; + break; + } + if (b) break; + if (!(o = ue(e, l).trim())) break; + if (e.sCount[l] - e.blkIndent >= 4) break; + for ( + (u = pe(o)).length && '' === u[0] && u.shift(), + u.length && '' === u[u.length - 1] && u.pop(), + l === r + 2 && + ((h = e.push('tbody_open', 'tbody', 1)).map = g = [r + 2, 0]), + (h = e.push('tr_open', 'tr', 1)).map = [l, l + 1], + a = 0; + a < p; + a++ + ) + (h = e.push('td_open', 'td', 1)), + f[a] && (h.attrs = [['style', 'text-align:' + f[a]]]), + ((h = e.push('inline', '', 0)).content = u[a] + ? u[a].trim() + : ''), + (h.children = []), + (h = e.push('td_close', 'td', -1)); + h = e.push('tr_close', 'tr', -1); + } + return ( + g && ((h = e.push('tbody_close', 'tbody', -1)), (g[1] = l)), + (h = e.push('table_close', 'table', -1)), + (m[1] = l), + (e.parentType = _), + (e.line = l), + !0 + ); + }, + ['paragraph', 'reference'], + ], + [ + 'code', + function (e, r, t) { + var n, s, o; + if (e.sCount[r] - e.blkIndent < 4) return !1; + for (s = n = r + 1; n < t; ) + if (e.isEmpty(n)) n++; + else { + if (!(e.sCount[n] - e.blkIndent >= 4)) break; + s = ++n; + } + return ( + (e.line = s), + ((o = e.push('code_block', 'code', 0)).content = e.getLines( + r, + s, + 4 + e.blkIndent, + !0, + )), + (o.map = [r, e.line]), + !0 + ); + }, + ], + [ + 'fence', + function (e, r, t, n) { + var s, + o, + i, + a, + c, + l, + u, + p = !1, + h = e.bMarks[r] + e.tShift[r], + f = e.eMarks[r]; + if (e.sCount[r] - e.blkIndent >= 4) return !1; + if (h + 3 > f) return !1; + if (126 !== (s = e.src.charCodeAt(h)) && 96 !== s) return !1; + if (((c = h), (o = (h = e.skipChars(h, s)) - c) < 3)) return !1; + if ( + ((u = e.src.slice(c, h)), + (i = e.src.slice(h, f)), + 96 === s && i.indexOf(String.fromCharCode(s)) >= 0) + ) + return !1; + if (n) return !0; + for ( + a = r; + !(++a >= t) && + !( + (h = c = e.bMarks[a] + e.tShift[a]) < (f = e.eMarks[a]) && + e.sCount[a] < e.blkIndent + ); + + ) + if ( + e.src.charCodeAt(h) === s && + !( + e.sCount[a] - e.blkIndent >= 4 || + (h = e.skipChars(h, s)) - c < o || + (h = e.skipSpaces(h)) < f + ) + ) { + p = !0; + break; + } + return ( + (o = e.sCount[r]), + (e.line = a + (p ? 1 : 0)), + ((l = e.push('fence', 'code', 0)).info = i), + (l.content = e.getLines(r + 1, a, o, !0)), + (l.markup = u), + (l.map = [r, e.line]), + !0 + ); + }, + ['paragraph', 'reference', 'blockquote', 'list'], + ], + [ + 'blockquote', + function (e, r, t, n) { + var s, + o, + i, + a, + c, + l, + u, + p, + h, + f, + d, + m, + g, + _, + b, + k, + v, + C, + y, + A, + x = e.lineMax, + D = e.bMarks[r] + e.tShift[r], + w = e.eMarks[r]; + if (e.sCount[r] - e.blkIndent >= 4) return !1; + if (62 !== e.src.charCodeAt(D++)) return !1; + if (n) return !0; + for ( + a = h = e.sCount[r] + 1, + 32 === e.src.charCodeAt(D) + ? (D++, a++, h++, (s = !1), (k = !0)) + : 9 === e.src.charCodeAt(D) + ? ((k = !0), + (e.bsCount[r] + h) % 4 == 3 + ? (D++, a++, h++, (s = !1)) + : (s = !0)) + : (k = !1), + f = [e.bMarks[r]], + e.bMarks[r] = D; + D < w && ((o = e.src.charCodeAt(D)), he(o)); + + ) + 9 === o ? (h += 4 - ((h + e.bsCount[r] + (s ? 1 : 0)) % 4)) : h++, + D++; + for ( + d = [e.bsCount[r]], + e.bsCount[r] = e.sCount[r] + 1 + (k ? 1 : 0), + l = D >= w, + _ = [e.sCount[r]], + e.sCount[r] = h - a, + b = [e.tShift[r]], + e.tShift[r] = D - e.bMarks[r], + C = e.md.block.ruler.getRules('blockquote'), + g = e.parentType, + e.parentType = 'blockquote', + p = r + 1; + p < t && + ((A = e.sCount[p] < e.blkIndent), + !((D = e.bMarks[p] + e.tShift[p]) >= (w = e.eMarks[p]))); + p++ + ) + if (62 !== e.src.charCodeAt(D++) || A) { + if (l) break; + for (v = !1, i = 0, c = C.length; i < c; i++) + if (C[i](e, p, t, !0)) { + v = !0; + break; + } + if (v) { + (e.lineMax = p), + 0 !== e.blkIndent && + (f.push(e.bMarks[p]), + d.push(e.bsCount[p]), + b.push(e.tShift[p]), + _.push(e.sCount[p]), + (e.sCount[p] -= e.blkIndent)); + break; + } + f.push(e.bMarks[p]), + d.push(e.bsCount[p]), + b.push(e.tShift[p]), + _.push(e.sCount[p]), + (e.sCount[p] = -1); + } else { + for ( + a = h = e.sCount[p] + 1, + 32 === e.src.charCodeAt(D) + ? (D++, a++, h++, (s = !1), (k = !0)) + : 9 === e.src.charCodeAt(D) + ? ((k = !0), + (e.bsCount[p] + h) % 4 == 3 + ? (D++, a++, h++, (s = !1)) + : (s = !0)) + : (k = !1), + f.push(e.bMarks[p]), + e.bMarks[p] = D; + D < w && ((o = e.src.charCodeAt(D)), he(o)); + + ) + 9 === o + ? (h += 4 - ((h + e.bsCount[p] + (s ? 1 : 0)) % 4)) + : h++, + D++; + (l = D >= w), + d.push(e.bsCount[p]), + (e.bsCount[p] = e.sCount[p] + 1 + (k ? 1 : 0)), + _.push(e.sCount[p]), + (e.sCount[p] = h - a), + b.push(e.tShift[p]), + (e.tShift[p] = D - e.bMarks[p]); + } + for ( + m = e.blkIndent, + e.blkIndent = 0, + (y = e.push('blockquote_open', 'blockquote', 1)).markup = '>', + y.map = u = [r, 0], + e.md.block.tokenize(e, r, p), + (y = e.push('blockquote_close', 'blockquote', -1)).markup = '>', + e.lineMax = x, + e.parentType = g, + u[1] = e.line, + i = 0; + i < b.length; + i++ + ) + (e.bMarks[i + r] = f[i]), + (e.tShift[i + r] = b[i]), + (e.sCount[i + r] = _[i]), + (e.bsCount[i + r] = d[i]); + return (e.blkIndent = m), !0; + }, + ['paragraph', 'reference', 'blockquote', 'list'], + ], + [ + 'hr', + function (e, r, t, n) { + var s, + o, + i, + a, + c = e.bMarks[r] + e.tShift[r], + l = e.eMarks[r]; + if (e.sCount[r] - e.blkIndent >= 4) return !1; + if (42 !== (s = e.src.charCodeAt(c++)) && 45 !== s && 95 !== s) + return !1; + for (o = 1; c < l; ) { + if ((i = e.src.charCodeAt(c++)) !== s && !fe(i)) return !1; + i === s && o++; + } + return ( + !(o < 3) && + (n || + ((e.line = r + 1), + ((a = e.push('hr', 'hr', 0)).map = [r, e.line]), + (a.markup = Array(o + 1).join(String.fromCharCode(s)))), + !0) + ); + }, + ['paragraph', 'reference', 'blockquote', 'list'], + ], + [ + 'list', + function (e, r, t, n) { + var s, + o, + i, + a, + c, + l, + u, + p, + h, + f, + d, + m, + g, + _, + b, + k, + v, + C, + y, + A, + x, + D, + w, + E, + q, + S, + F, + L, + z = !1, + T = !0; + if (e.sCount[r] - e.blkIndent >= 4) return !1; + if ( + e.listIndent >= 0 && + e.sCount[r] - e.listIndent >= 4 && + e.sCount[r] < e.blkIndent + ) + return !1; + if ( + (n && + 'paragraph' === e.parentType && + e.tShift[r] >= e.blkIndent && + (z = !0), + (w = ge(e, r)) >= 0) + ) { + if ( + ((u = !0), + (q = e.bMarks[r] + e.tShift[r]), + (g = Number(e.src.substr(q, w - q - 1))), + z && 1 !== g) + ) + return !1; + } else { + if (!((w = me(e, r)) >= 0)) return !1; + u = !1; + } + if (z && e.skipSpaces(w) >= e.eMarks[r]) return !1; + if (((m = e.src.charCodeAt(w - 1)), n)) return !0; + for ( + d = e.tokens.length, + u + ? ((L = e.push('ordered_list_open', 'ol', 1)), + 1 !== g && (L.attrs = [['start', g]])) + : (L = e.push('bullet_list_open', 'ul', 1)), + L.map = f = [r, 0], + L.markup = String.fromCharCode(m), + b = r, + E = !1, + F = e.md.block.ruler.getRules('list'), + C = e.parentType, + e.parentType = 'list'; + b < t; + + ) { + for ( + D = w, + _ = e.eMarks[b], + l = k = e.sCount[b] + w - (e.bMarks[r] + e.tShift[r]); + D < _; + + ) { + if (9 === (s = e.src.charCodeAt(D))) + k += 4 - ((k + e.bsCount[b]) % 4); + else { + if (32 !== s) break; + k++; + } + D++; + } + if ( + ((c = (o = D) >= _ ? 1 : k - l) > 4 && (c = 1), + (a = l + c), + ((L = e.push('list_item_open', 'li', 1)).markup = + String.fromCharCode(m)), + (L.map = p = [r, 0]), + (x = e.tight), + (A = e.tShift[r]), + (y = e.sCount[r]), + (v = e.listIndent), + (e.listIndent = e.blkIndent), + (e.blkIndent = a), + (e.tight = !0), + (e.tShift[r] = o - e.bMarks[r]), + (e.sCount[r] = k), + o >= _ && e.isEmpty(r + 1) + ? (e.line = Math.min(e.line + 2, t)) + : e.md.block.tokenize(e, r, t, !0), + (e.tight && !E) || (T = !1), + (E = e.line - r > 1 && e.isEmpty(e.line - 1)), + (e.blkIndent = e.listIndent), + (e.listIndent = v), + (e.tShift[r] = A), + (e.sCount[r] = y), + (e.tight = x), + ((L = e.push('list_item_close', 'li', -1)).markup = + String.fromCharCode(m)), + (b = r = e.line), + (p[1] = b), + (o = e.bMarks[r]), + b >= t) + ) + break; + if (e.sCount[b] < e.blkIndent) break; + if (e.sCount[r] - e.blkIndent >= 4) break; + for (S = !1, i = 0, h = F.length; i < h; i++) + if (F[i](e, b, t, !0)) { + S = !0; + break; + } + if (S) break; + if (u) { + if ((w = ge(e, b)) < 0) break; + } else if ((w = me(e, b)) < 0) break; + if (m !== e.src.charCodeAt(w - 1)) break; + } + return ( + ((L = u + ? e.push('ordered_list_close', 'ol', -1) + : e.push('bullet_list_close', 'ul', -1)).markup = + String.fromCharCode(m)), + (f[1] = b), + (e.line = b), + (e.parentType = C), + T && + (function (e, r) { + var t, + n, + s = e.level + 2; + for (t = r + 2, n = e.tokens.length - 2; t < n; t++) + e.tokens[t].level === s && + 'paragraph_open' === e.tokens[t].type && + ((e.tokens[t + 2].hidden = !0), + (e.tokens[t].hidden = !0), + (t += 2)); + })(e, d), + !0 + ); + }, + ['paragraph', 'reference', 'blockquote'], + ], + [ + 'reference', + function (e, r, t, n) { + var s, + o, + i, + a, + c, + l, + u, + p, + h, + f, + d, + m, + g, + _, + b, + k, + v = 0, + C = e.bMarks[r] + e.tShift[r], + y = e.eMarks[r], + A = r + 1; + if (e.sCount[r] - e.blkIndent >= 4) return !1; + if (91 !== e.src.charCodeAt(C)) return !1; + for (; ++C < y; ) + if (93 === e.src.charCodeAt(C) && 92 !== e.src.charCodeAt(C - 1)) { + if (C + 1 === y) return !1; + if (58 !== e.src.charCodeAt(C + 1)) return !1; + break; + } + for ( + a = e.lineMax, + b = e.md.block.ruler.getRules('reference'), + f = e.parentType, + e.parentType = 'reference'; + A < a && !e.isEmpty(A); + A++ + ) + if (!(e.sCount[A] - e.blkIndent > 3 || e.sCount[A] < 0)) { + for (_ = !1, l = 0, u = b.length; l < u; l++) + if (b[l](e, A, a, !0)) { + _ = !0; + break; + } + if (_) break; + } + for ( + y = (g = e.getLines(r, A, e.blkIndent, !1).trim()).length, C = 1; + C < y; + C++ + ) { + if (91 === (s = g.charCodeAt(C))) return !1; + if (93 === s) { + h = C; + break; + } + (10 === s || (92 === s && ++C < y && 10 === g.charCodeAt(C))) && + v++; + } + if (h < 0 || 58 !== g.charCodeAt(h + 1)) return !1; + for (C = h + 2; C < y; C++) + if (10 === (s = g.charCodeAt(C))) v++; + else if (!be(s)) break; + if (!(d = e.md.helpers.parseLinkDestination(g, C, y)).ok) return !1; + if (((c = e.md.normalizeLink(d.str)), !e.md.validateLink(c))) + return !1; + for (o = C = d.pos, i = v += d.lines, m = C; C < y; C++) + if (10 === (s = g.charCodeAt(C))) v++; + else if (!be(s)) break; + for ( + d = e.md.helpers.parseLinkTitle(g, C, y), + C < y && m !== C && d.ok + ? ((k = d.str), (C = d.pos), (v += d.lines)) + : ((k = ''), (C = o), (v = i)); + C < y && ((s = g.charCodeAt(C)), be(s)); + + ) + C++; + if (C < y && 10 !== g.charCodeAt(C) && k) + for ( + k = '', C = o, v = i; + C < y && ((s = g.charCodeAt(C)), be(s)); + + ) + C++; + return ( + !(C < y && 10 !== g.charCodeAt(C)) && + !!(p = _e(g.slice(1, h))) && + (n || + (void 0 === e.env.references && (e.env.references = {}), + void 0 === e.env.references[p] && + (e.env.references[p] = { title: k, href: c }), + (e.parentType = f), + (e.line = r + v + 1)), + !0) + ); + }, + ], + [ + 'heading', + function (e, r, t, n) { + var s, + o, + i, + a, + c = e.bMarks[r] + e.tShift[r], + l = e.eMarks[r]; + if (e.sCount[r] - e.blkIndent >= 4) return !1; + if (35 !== (s = e.src.charCodeAt(c)) || c >= l) return !1; + for (o = 1, s = e.src.charCodeAt(++c); 35 === s && c < l && o <= 6; ) + o++, (s = e.src.charCodeAt(++c)); + return ( + !(o > 6 || (c < l && !ke(s))) && + (n || + ((l = e.skipSpacesBack(l, c)), + (i = e.skipCharsBack(l, 35, c)) > c && + ke(e.src.charCodeAt(i - 1)) && + (l = i), + (e.line = r + 1), + ((a = e.push('heading_open', 'h' + String(o), 1)).markup = + '########'.slice(0, o)), + (a.map = [r, e.line]), + ((a = e.push('inline', '', 0)).content = e.src + .slice(c, l) + .trim()), + (a.map = [r, e.line]), + (a.children = []), + ((a = e.push('heading_close', 'h' + String(o), -1)).markup = + '########'.slice(0, o))), + !0) + ); + }, + ['paragraph', 'reference', 'blockquote'], + ], + [ + 'lheading', + function (e, r, t) { + var n, + s, + o, + i, + a, + c, + l, + u, + p, + h, + f = r + 1, + d = e.md.block.ruler.getRules('paragraph'); + if (e.sCount[r] - e.blkIndent >= 4) return !1; + for ( + h = e.parentType, e.parentType = 'paragraph'; + f < t && !e.isEmpty(f); + f++ + ) + if (!(e.sCount[f] - e.blkIndent > 3)) { + if ( + e.sCount[f] >= e.blkIndent && + (c = e.bMarks[f] + e.tShift[f]) < (l = e.eMarks[f]) && + (45 === (p = e.src.charCodeAt(c)) || 61 === p) && + ((c = e.skipChars(c, p)), (c = e.skipSpaces(c)) >= l) + ) { + u = 61 === p ? 1 : 2; + break; + } + if (!(e.sCount[f] < 0)) { + for (s = !1, o = 0, i = d.length; o < i; o++) + if (d[o](e, f, t, !0)) { + s = !0; + break; + } + if (s) break; + } + } + return ( + !!u && + ((n = e.getLines(r, f, e.blkIndent, !1).trim()), + (e.line = f + 1), + ((a = e.push('heading_open', 'h' + String(u), 1)).markup = + String.fromCharCode(p)), + (a.map = [r, e.line]), + ((a = e.push('inline', '', 0)).content = n), + (a.map = [r, e.line - 1]), + (a.children = []), + ((a = e.push('heading_close', 'h' + String(u), -1)).markup = + String.fromCharCode(p)), + (e.parentType = h), + !0) + ); + }, + ], + [ + 'html_block', + function (e, r, t, n) { + var s, + o, + i, + a, + c = e.bMarks[r] + e.tShift[r], + l = e.eMarks[r]; + if (e.sCount[r] - e.blkIndent >= 4) return !1; + if (!e.md.options.html) return !1; + if (60 !== e.src.charCodeAt(c)) return !1; + for ( + a = e.src.slice(c, l), s = 0; + s < xe.length && !xe[s][0].test(a); + s++ + ); + if (s === xe.length) return !1; + if (n) return xe[s][2]; + if (((o = r + 1), !xe[s][1].test(a))) + for (; o < t && !(e.sCount[o] < e.blkIndent); o++) + if ( + ((c = e.bMarks[o] + e.tShift[o]), + (l = e.eMarks[o]), + (a = e.src.slice(c, l)), + xe[s][1].test(a)) + ) { + 0 !== a.length && o++; + break; + } + return ( + (e.line = o), + ((i = e.push('html_block', '', 0)).map = [r, o]), + (i.content = e.getLines(r, o, e.blkIndent, !0)), + !0 + ); + }, + ['paragraph', 'reference', 'blockquote'], + ], + [ + 'paragraph', + function (e, r) { + var t, + n, + s, + o, + i, + a, + c = r + 1, + l = e.md.block.ruler.getRules('paragraph'), + u = e.lineMax; + for ( + a = e.parentType, e.parentType = 'paragraph'; + c < u && !e.isEmpty(c); + c++ + ) + if (!(e.sCount[c] - e.blkIndent > 3 || e.sCount[c] < 0)) { + for (n = !1, s = 0, o = l.length; s < o; s++) + if (l[s](e, c, u, !0)) { + n = !0; + break; + } + if (n) break; + } + return ( + (t = e.getLines(r, c, e.blkIndent, !1).trim()), + (e.line = c), + ((i = e.push('paragraph_open', 'p', 1)).map = [r, e.line]), + ((i = e.push('inline', '', 0)).content = t), + (i.map = [r, e.line]), + (i.children = []), + (i = e.push('paragraph_close', 'p', -1)), + (e.parentType = a), + !0 + ); + }, + ], + ]; + function Se() { + this.ruler = new B(); + for (var e = 0; e < qe.length; e++) + this.ruler.push(qe[e][0], qe[e][1], { alt: (qe[e][2] || []).slice() }); + } + (Se.prototype.tokenize = function (e, r, t) { + for ( + var n, + s = this.ruler.getRules(''), + o = s.length, + i = r, + a = !1, + c = e.md.options.maxNesting; + i < t && + ((e.line = i = e.skipEmptyLines(i)), !(i >= t)) && + !(e.sCount[i] < e.blkIndent); + + ) { + if (e.level >= c) { + e.line = t; + break; + } + for (n = 0; n < o && !s[n](e, i, t, !1); n++); + (e.tight = !a), + e.isEmpty(e.line - 1) && (a = !0), + (i = e.line) < t && e.isEmpty(i) && ((a = !0), i++, (e.line = i)); + } + }), + (Se.prototype.parse = function (e, r, t, n) { + var s; + e && + ((s = new this.State(e, r, t, n)), this.tokenize(s, s.line, s.lineMax)); + }), + (Se.prototype.State = Ee); + var Fe = Se; + function Le(e) { + switch (e) { + case 10: + case 33: + case 35: + case 36: + case 37: + case 38: + case 42: + case 43: + case 45: + case 58: + case 60: + case 61: + case 62: + case 64: + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 123: + case 125: + case 126: + return !0; + default: + return !1; + } + } + for (var ze = w.isSpace, Te = w.isSpace, Ie = [], Re = 0; Re < 256; Re++) + Ie.push(0); + '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'.split('').forEach(function (e) { + Ie[e.charCodeAt(0)] = 1; + }); + function Me(e, r) { + var t, + n, + s, + o, + i, + a = [], + c = r.length; + for (t = 0; t < c; t++) + 126 === (s = r[t]).marker && + -1 !== s.end && + ((o = r[s.end]), + ((i = e.tokens[s.token]).type = 's_open'), + (i.tag = 's'), + (i.nesting = 1), + (i.markup = '~~'), + (i.content = ''), + ((i = e.tokens[o.token]).type = 's_close'), + (i.tag = 's'), + (i.nesting = -1), + (i.markup = '~~'), + (i.content = ''), + 'text' === e.tokens[o.token - 1].type && + '~' === e.tokens[o.token - 1].content && + a.push(o.token - 1)); + for (; a.length; ) { + for ( + n = (t = a.pop()) + 1; + n < e.tokens.length && 's_close' === e.tokens[n].type; + + ) + n++; + t !== --n && + ((i = e.tokens[n]), (e.tokens[n] = e.tokens[t]), (e.tokens[t] = i)); + } + } + var Be = { + tokenize: function (e, r) { + var t, + n, + s, + o, + i = e.pos, + a = e.src.charCodeAt(i); + if (r) return !1; + if (126 !== a) return !1; + if ( + ((s = (n = e.scanDelims(e.pos, !0)).length), + (o = String.fromCharCode(a)), + s < 2) + ) + return !1; + for ( + s % 2 && ((e.push('text', '', 0).content = o), s--), t = 0; + t < s; + t += 2 + ) + (e.push('text', '', 0).content = o + o), + e.delimiters.push({ + marker: a, + length: 0, + jump: t / 2, + token: e.tokens.length - 1, + end: -1, + open: n.can_open, + close: n.can_close, + }); + return (e.pos += n.length), !0; + }, + postProcess: function (e) { + var r, + t = e.tokens_meta, + n = e.tokens_meta.length; + for (Me(e, e.delimiters), r = 0; r < n; r++) + t[r] && t[r].delimiters && Me(e, t[r].delimiters); + }, + }; + function Ne(e, r) { + var t, n, s, o, i, a; + for (t = r.length - 1; t >= 0; t--) + (95 !== (n = r[t]).marker && 42 !== n.marker) || + (-1 !== n.end && + ((s = r[n.end]), + (a = + t > 0 && + r[t - 1].end === n.end + 1 && + r[t - 1].token === n.token - 1 && + r[n.end + 1].token === s.token + 1 && + r[t - 1].marker === n.marker), + (i = String.fromCharCode(n.marker)), + ((o = e.tokens[n.token]).type = a ? 'strong_open' : 'em_open'), + (o.tag = a ? 'strong' : 'em'), + (o.nesting = 1), + (o.markup = a ? i + i : i), + (o.content = ''), + ((o = e.tokens[s.token]).type = a ? 'strong_close' : 'em_close'), + (o.tag = a ? 'strong' : 'em'), + (o.nesting = -1), + (o.markup = a ? i + i : i), + (o.content = ''), + a && + ((e.tokens[r[t - 1].token].content = ''), + (e.tokens[r[n.end + 1].token].content = ''), + t--))); + } + var Oe = { + tokenize: function (e, r) { + var t, + n, + s = e.pos, + o = e.src.charCodeAt(s); + if (r) return !1; + if (95 !== o && 42 !== o) return !1; + for (n = e.scanDelims(e.pos, 42 === o), t = 0; t < n.length; t++) + (e.push('text', '', 0).content = String.fromCharCode(o)), + e.delimiters.push({ + marker: o, + length: n.length, + jump: t, + token: e.tokens.length - 1, + end: -1, + open: n.can_open, + close: n.can_close, + }); + return (e.pos += n.length), !0; + }, + postProcess: function (e) { + var r, + t = e.tokens_meta, + n = e.tokens_meta.length; + for (Ne(e, e.delimiters), r = 0; r < n; r++) + t[r] && t[r].delimiters && Ne(e, t[r].delimiters); + }, + }, + Pe = w.normalizeReference, + je = w.isSpace, + Ue = w.normalizeReference, + Ve = w.isSpace, + Ze = + /^([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])?)*)$/, + Ge = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/, + $e = ye.HTML_TAG_RE; + var He = w.has, + Je = w.isValidEntityCode, + We = w.fromCodePoint, + Ye = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i, + Ke = /^&([a-z][a-z0-9]{1,31});/i; + function Qe(e, r) { + var t, + n, + s, + o, + i, + a, + c, + l, + u = {}, + p = r.length; + for (t = 0; t < p; t++) + if ((((s = r[t]).length = s.length || 0), s.close)) { + for ( + u.hasOwnProperty(s.marker) || (u[s.marker] = [-1, -1, -1]), + i = u[s.marker][s.length % 3], + (n = t - s.jump - 1) < -1 && (n = -1), + a = n; + n > i; + n -= o.jump + 1 + ) + if ( + (o = r[n]).marker === s.marker && + o.open && + o.end < 0 && + ((c = !1), + (o.close || s.open) && + (o.length + s.length) % 3 == 0 && + ((o.length % 3 == 0 && s.length % 3 == 0) || (c = !0)), + !c) + ) { + (l = n > 0 && !r[n - 1].open ? r[n - 1].jump + 1 : 0), + (s.jump = t - n + l), + (s.open = !1), + (o.end = t), + (o.jump = l), + (o.close = !1), + (a = -1); + break; + } + -1 !== a && (u[s.marker][(s.length || 0) % 3] = a); + } + } + var Xe = w.isWhiteSpace, + er = w.isPunctChar, + rr = w.isMdAsciiPunct; + function tr(e, r, t, n) { + (this.src = e), + (this.env = t), + (this.md = r), + (this.tokens = n), + (this.tokens_meta = Array(n.length)), + (this.pos = 0), + (this.posMax = this.src.length), + (this.level = 0), + (this.pending = ''), + (this.pendingLevel = 0), + (this.cache = {}), + (this.delimiters = []), + (this._prev_delimiters = []), + (this.backticks = {}), + (this.backticksScanned = !1); + } + (tr.prototype.pushPending = function () { + var e = new ne('text', '', 0); + return ( + (e.content = this.pending), + (e.level = this.pendingLevel), + this.tokens.push(e), + (this.pending = ''), + e + ); + }), + (tr.prototype.push = function (e, r, t) { + this.pending && this.pushPending(); + var n = new ne(e, r, t), + s = null; + return ( + t < 0 && + (this.level--, (this.delimiters = this._prev_delimiters.pop())), + (n.level = this.level), + t > 0 && + (this.level++, + this._prev_delimiters.push(this.delimiters), + (this.delimiters = []), + (s = { delimiters: this.delimiters })), + (this.pendingLevel = this.level), + this.tokens.push(n), + this.tokens_meta.push(s), + n + ); + }), + (tr.prototype.scanDelims = function (e, r) { + var t, + n, + s, + o, + i, + a, + c, + l, + u, + p = e, + h = !0, + f = !0, + d = this.posMax, + m = this.src.charCodeAt(e); + for ( + t = e > 0 ? this.src.charCodeAt(e - 1) : 32; + p < d && this.src.charCodeAt(p) === m; + + ) + p++; + return ( + (s = p - e), + (n = p < d ? this.src.charCodeAt(p) : 32), + (c = rr(t) || er(String.fromCharCode(t))), + (u = rr(n) || er(String.fromCharCode(n))), + (a = Xe(t)), + (l = Xe(n)) ? (h = !1) : u && (a || c || (h = !1)), + a ? (f = !1) : c && (l || u || (f = !1)), + r ? ((o = h), (i = f)) : ((o = h && (!f || c)), (i = f && (!h || u))), + { can_open: o, can_close: i, length: s } + ); + }), + (tr.prototype.Token = ne); + var nr = tr, + sr = [ + [ + 'text', + function (e, r) { + for (var t = e.pos; t < e.posMax && !Le(e.src.charCodeAt(t)); ) t++; + return ( + t !== e.pos && + (r || (e.pending += e.src.slice(e.pos, t)), (e.pos = t), !0) + ); + }, + ], + [ + 'newline', + function (e, r) { + var t, + n, + s = e.pos; + if (10 !== e.src.charCodeAt(s)) return !1; + for ( + t = e.pending.length - 1, + n = e.posMax, + r || + (t >= 0 && 32 === e.pending.charCodeAt(t) + ? t >= 1 && 32 === e.pending.charCodeAt(t - 1) + ? ((e.pending = e.pending.replace(/ +$/, '')), + e.push('hardbreak', 'br', 0)) + : ((e.pending = e.pending.slice(0, -1)), + e.push('softbreak', 'br', 0)) + : e.push('softbreak', 'br', 0)), + s++; + s < n && ze(e.src.charCodeAt(s)); + + ) + s++; + return (e.pos = s), !0; + }, + ], + [ + 'escape', + function (e, r) { + var t, + n = e.pos, + s = e.posMax; + if (92 !== e.src.charCodeAt(n)) return !1; + if (++n < s) { + if ((t = e.src.charCodeAt(n)) < 256 && 0 !== Ie[t]) + return r || (e.pending += e.src[n]), (e.pos += 2), !0; + if (10 === t) { + for ( + r || e.push('hardbreak', 'br', 0), n++; + n < s && ((t = e.src.charCodeAt(n)), Te(t)); + + ) + n++; + return (e.pos = n), !0; + } + } + return r || (e.pending += '\\'), e.pos++, !0; + }, + ], + [ + 'backticks', + function (e, r) { + var t, + n, + s, + o, + i, + a, + c, + l, + u = e.pos; + if (96 !== e.src.charCodeAt(u)) return !1; + for (t = u, u++, n = e.posMax; u < n && 96 === e.src.charCodeAt(u); ) + u++; + if ( + ((c = (s = e.src.slice(t, u)).length), + e.backticksScanned && (e.backticks[c] || 0) <= t) + ) + return r || (e.pending += s), (e.pos += c), !0; + for (i = a = u; -1 !== (i = e.src.indexOf('`', a)); ) { + for (a = i + 1; a < n && 96 === e.src.charCodeAt(a); ) a++; + if ((l = a - i) === c) + return ( + r || + (((o = e.push('code_inline', 'code', 0)).markup = s), + (o.content = e.src + .slice(u, i) + .replace(/\n/g, ' ') + .replace(/^ (.+) $/, '$1'))), + (e.pos = a), + !0 + ); + e.backticks[l] = i; + } + return ( + (e.backticksScanned = !0), r || (e.pending += s), (e.pos += c), !0 + ); + }, + ], + ['strikethrough', Be.tokenize], + ['emphasis', Oe.tokenize], + [ + 'link', + function (e, r) { + var t, + n, + s, + o, + i, + a, + c, + l, + u = '', + p = '', + h = e.pos, + f = e.posMax, + d = e.pos, + m = !0; + if (91 !== e.src.charCodeAt(e.pos)) return !1; + if ( + ((i = e.pos + 1), + (o = e.md.helpers.parseLinkLabel(e, e.pos, !0)) < 0) + ) + return !1; + if ((a = o + 1) < f && 40 === e.src.charCodeAt(a)) { + for ( + m = !1, a++; + a < f && ((n = e.src.charCodeAt(a)), je(n) || 10 === n); + a++ + ); + if (a >= f) return !1; + if ( + ((d = a), + (c = e.md.helpers.parseLinkDestination(e.src, a, e.posMax)).ok) + ) { + for ( + u = e.md.normalizeLink(c.str), + e.md.validateLink(u) ? (a = c.pos) : (u = ''), + d = a; + a < f && ((n = e.src.charCodeAt(a)), je(n) || 10 === n); + a++ + ); + if ( + ((c = e.md.helpers.parseLinkTitle(e.src, a, e.posMax)), + a < f && d !== a && c.ok) + ) + for ( + p = c.str, a = c.pos; + a < f && ((n = e.src.charCodeAt(a)), je(n) || 10 === n); + a++ + ); + } + (a >= f || 41 !== e.src.charCodeAt(a)) && (m = !0), a++; + } + if (m) { + if (void 0 === e.env.references) return !1; + if ( + (a < f && 91 === e.src.charCodeAt(a) + ? ((d = a + 1), + (a = e.md.helpers.parseLinkLabel(e, a)) >= 0 + ? (s = e.src.slice(d, a++)) + : (a = o + 1)) + : (a = o + 1), + s || (s = e.src.slice(i, o)), + !(l = e.env.references[Pe(s)])) + ) + return (e.pos = h), !1; + (u = l.href), (p = l.title); + } + return ( + r || + ((e.pos = i), + (e.posMax = o), + (e.push('link_open', 'a', 1).attrs = t = [['href', u]]), + p && t.push(['title', p]), + e.md.inline.tokenize(e), + e.push('link_close', 'a', -1)), + (e.pos = a), + (e.posMax = f), + !0 + ); + }, + ], + [ + 'image', + function (e, r) { + var t, + n, + s, + o, + i, + a, + c, + l, + u, + p, + h, + f, + d, + m = '', + g = e.pos, + _ = e.posMax; + if (33 !== e.src.charCodeAt(e.pos)) return !1; + if (91 !== e.src.charCodeAt(e.pos + 1)) return !1; + if ( + ((a = e.pos + 2), + (i = e.md.helpers.parseLinkLabel(e, e.pos + 1, !1)) < 0) + ) + return !1; + if ((c = i + 1) < _ && 40 === e.src.charCodeAt(c)) { + for ( + c++; + c < _ && ((n = e.src.charCodeAt(c)), Ve(n) || 10 === n); + c++ + ); + if (c >= _) return !1; + for ( + d = c, + (u = e.md.helpers.parseLinkDestination(e.src, c, e.posMax)) + .ok && + ((m = e.md.normalizeLink(u.str)), + e.md.validateLink(m) ? (c = u.pos) : (m = '')), + d = c; + c < _ && ((n = e.src.charCodeAt(c)), Ve(n) || 10 === n); + c++ + ); + if ( + ((u = e.md.helpers.parseLinkTitle(e.src, c, e.posMax)), + c < _ && d !== c && u.ok) + ) + for ( + p = u.str, c = u.pos; + c < _ && ((n = e.src.charCodeAt(c)), Ve(n) || 10 === n); + c++ + ); + else p = ''; + if (c >= _ || 41 !== e.src.charCodeAt(c)) return (e.pos = g), !1; + c++; + } else { + if (void 0 === e.env.references) return !1; + if ( + (c < _ && 91 === e.src.charCodeAt(c) + ? ((d = c + 1), + (c = e.md.helpers.parseLinkLabel(e, c)) >= 0 + ? (o = e.src.slice(d, c++)) + : (c = i + 1)) + : (c = i + 1), + o || (o = e.src.slice(a, i)), + !(l = e.env.references[Ue(o)])) + ) + return (e.pos = g), !1; + (m = l.href), (p = l.title); + } + return ( + r || + ((s = e.src.slice(a, i)), + e.md.inline.parse(s, e.md, e.env, (f = [])), + ((h = e.push('image', 'img', 0)).attrs = t = + [ + ['src', m], + ['alt', ''], + ]), + (h.children = f), + (h.content = s), + p && t.push(['title', p])), + (e.pos = c), + (e.posMax = _), + !0 + ); + }, + ], + [ + 'autolink', + function (e, r) { + var t, + n, + s, + o, + i, + a, + c = e.pos; + if (60 !== e.src.charCodeAt(c)) return !1; + for (i = e.pos, a = e.posMax; ; ) { + if (++c >= a) return !1; + if (60 === (o = e.src.charCodeAt(c))) return !1; + if (62 === o) break; + } + return ( + (t = e.src.slice(i + 1, c)), + Ge.test(t) + ? ((n = e.md.normalizeLink(t)), + !!e.md.validateLink(n) && + (r || + (((s = e.push('link_open', 'a', 1)).attrs = [['href', n]]), + (s.markup = 'autolink'), + (s.info = 'auto'), + ((s = e.push('text', '', 0)).content = + e.md.normalizeLinkText(t)), + ((s = e.push('link_close', 'a', -1)).markup = 'autolink'), + (s.info = 'auto')), + (e.pos += t.length + 2), + !0)) + : !!Ze.test(t) && + ((n = e.md.normalizeLink('mailto:' + t)), + !!e.md.validateLink(n) && + (r || + (((s = e.push('link_open', 'a', 1)).attrs = [['href', n]]), + (s.markup = 'autolink'), + (s.info = 'auto'), + ((s = e.push('text', '', 0)).content = + e.md.normalizeLinkText(t)), + ((s = e.push('link_close', 'a', -1)).markup = 'autolink'), + (s.info = 'auto')), + (e.pos += t.length + 2), + !0)) + ); + }, + ], + [ + 'html_inline', + function (e, r) { + var t, + n, + s, + o = e.pos; + return ( + !!e.md.options.html && + ((s = e.posMax), + !(60 !== e.src.charCodeAt(o) || o + 2 >= s) && + !( + 33 !== (t = e.src.charCodeAt(o + 1)) && + 63 !== t && + 47 !== t && + !(function (e) { + var r = 32 | e; + return r >= 97 && r <= 122; + })(t) + ) && + !!(n = e.src.slice(o).match($e)) && + (r || + (e.push('html_inline', '', 0).content = e.src.slice( + o, + o + n[0].length, + )), + (e.pos += n[0].length), + !0)) + ); + }, + ], + [ + 'entity', + function (e, t) { + var n, + s, + o = e.pos, + i = e.posMax; + if (38 !== e.src.charCodeAt(o)) return !1; + if (o + 1 < i) + if (35 === e.src.charCodeAt(o + 1)) { + if ((s = e.src.slice(o).match(Ye))) + return ( + t || + ((n = + 'x' === s[1][0].toLowerCase() + ? parseInt(s[1].slice(1), 16) + : parseInt(s[1], 10)), + (e.pending += Je(n) ? We(n) : We(65533))), + (e.pos += s[0].length), + !0 + ); + } else if ((s = e.src.slice(o).match(Ke)) && He(r, s[1])) + return t || (e.pending += r[s[1]]), (e.pos += s[0].length), !0; + return t || (e.pending += '&'), e.pos++, !0; + }, + ], + ], + or = [ + [ + 'balance_pairs', + function (e) { + var r, + t = e.tokens_meta, + n = e.tokens_meta.length; + for (Qe(0, e.delimiters), r = 0; r < n; r++) + t[r] && t[r].delimiters && Qe(0, t[r].delimiters); + }, + ], + ['strikethrough', Be.postProcess], + ['emphasis', Oe.postProcess], + [ + 'text_collapse', + function (e) { + var r, + t, + n = 0, + s = e.tokens, + o = e.tokens.length; + for (r = t = 0; r < o; r++) + s[r].nesting < 0 && n--, + (s[r].level = n), + s[r].nesting > 0 && n++, + 'text' === s[r].type && r + 1 < o && 'text' === s[r + 1].type + ? (s[r + 1].content = s[r].content + s[r + 1].content) + : (r !== t && (s[t] = s[r]), t++); + r !== t && (s.length = t); + }, + ], + ]; + function ir() { + var e; + for (this.ruler = new B(), e = 0; e < sr.length; e++) + this.ruler.push(sr[e][0], sr[e][1]); + for (this.ruler2 = new B(), e = 0; e < or.length; e++) + this.ruler2.push(or[e][0], or[e][1]); + } + (ir.prototype.skipToken = function (e) { + var r, + t, + n = e.pos, + s = this.ruler.getRules(''), + o = s.length, + i = e.md.options.maxNesting, + a = e.cache; + if (void 0 === a[n]) { + if (e.level < i) + for ( + t = 0; + t < o && (e.level++, (r = s[t](e, !0)), e.level--, !r); + t++ + ); + else e.pos = e.posMax; + r || e.pos++, (a[n] = e.pos); + } else e.pos = a[n]; + }), + (ir.prototype.tokenize = function (e) { + for ( + var r, + t, + n = this.ruler.getRules(''), + s = n.length, + o = e.posMax, + i = e.md.options.maxNesting; + e.pos < o; + + ) { + if (e.level < i) for (t = 0; t < s && !(r = n[t](e, !1)); t++); + if (r) { + if (e.pos >= o) break; + } else e.pending += e.src[e.pos++]; + } + e.pending && e.pushPending(); + }), + (ir.prototype.parse = function (e, r, t, n) { + var s, + o, + i, + a = new this.State(e, r, t, n); + for ( + this.tokenize(a), i = (o = this.ruler2.getRules('')).length, s = 0; + s < i; + s++ + ) + o[s](a); + }), + (ir.prototype.State = nr); + var ar = ir; + function cr(e) { + var r = Array.prototype.slice.call(arguments, 1); + return ( + r.forEach(function (r) { + r && + Object.keys(r).forEach(function (t) { + e[t] = r[t]; + }); + }), + e + ); + } + function lr(e) { + return Object.prototype.toString.call(e); + } + function ur(e) { + return '[object Function]' === lr(e); + } + function pr(e) { + return e.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); + } + var hr = { fuzzyLink: !0, fuzzyEmail: !0, fuzzyIP: !1 }; + var fr = { + 'http:': { + validate: function (e, r, t) { + var n = e.slice(r); + return ( + t.re.http || + (t.re.http = new RegExp( + '^\\/\\/' + + t.re.src_auth + + t.re.src_host_port_strict + + t.re.src_path, + 'i', + )), + t.re.http.test(n) ? n.match(t.re.http)[0].length : 0 + ); + }, + }, + 'https:': 'http:', + 'ftp:': 'http:', + '//': { + validate: function (e, r, t) { + var n = e.slice(r); + return ( + t.re.no_http || + (t.re.no_http = new RegExp( + '^' + + t.re.src_auth + + '(?:localhost|(?:(?:' + + t.re.src_domain + + ')\\.)+' + + t.re.src_domain_root + + ')' + + t.re.src_port + + t.re.src_host_terminator + + t.re.src_path, + 'i', + )), + t.re.no_http.test(n) + ? (r >= 3 && ':' === e[r - 3]) || (r >= 3 && '/' === e[r - 3]) + ? 0 + : n.match(t.re.no_http)[0].length + : 0 + ); + }, + }, + 'mailto:': { + validate: function (e, r, t) { + var n = e.slice(r); + return ( + t.re.mailto || + (t.re.mailto = new RegExp( + '^' + t.re.src_email_name + '@' + t.re.src_host_strict, + 'i', + )), + t.re.mailto.test(n) ? n.match(t.re.mailto)[0].length : 0 + ); + }, + }, + }, + dr = + 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444'.split( + '|', + ); + function mr(e) { + var r = (e.re = (function (e) { + var r = {}; + return ( + (r.src_Any = y.source), + (r.src_Cc = A.source), + (r.src_Z = x.source), + (r.src_P = t.source), + (r.src_ZPCc = [r.src_Z, r.src_P, r.src_Cc].join('|')), + (r.src_ZCc = [r.src_Z, r.src_Cc].join('|')), + (r.src_pseudo_letter = + '(?:(?![><\uff5c]|' + r.src_ZPCc + ')' + r.src_Any + ')'), + (r.src_ip4 = + '(?:(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]?)'), + (r.src_auth = '(?:(?:(?!' + r.src_ZCc + '|[@/\\[\\]()]).)+@)?'), + (r.src_port = + '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'), + (r.src_host_terminator = + '(?=$|[><\uff5c]|' + + r.src_ZPCc + + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + + r.src_ZPCc + + '))'), + (r.src_path = + '(?:[/?#](?:(?!' + + r.src_ZCc + + '|[><\uff5c]|[()[\\]{}.,"\'?!\\-]).|\\[(?:(?!' + + r.src_ZCc + + '|\\]).)*\\]|\\((?:(?!' + + r.src_ZCc + + '|[)]).)*\\)|\\{(?:(?!' + + r.src_ZCc + + '|[}]).)*\\}|\\"(?:(?!' + + r.src_ZCc + + '|["]).)+\\"|\\\'(?:(?!' + + r.src_ZCc + + "|[']).)+\\'|\\'(?=" + + r.src_pseudo_letter + + '|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!' + + r.src_ZCc + + '|[.]).|' + + (e && e['---'] ? '\\-(?!--(?:[^-]|$))(?:-*)|' : '\\-+|') + + '\\,(?!' + + r.src_ZCc + + ').|\\!+(?!' + + r.src_ZCc + + '|[!]).|\\?(?!' + + r.src_ZCc + + '|[?]).)+|\\/)?'), + (r.src_email_name = + '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'), + (r.src_xn = 'xn--[a-z0-9\\-]{1,59}'), + (r.src_domain_root = + '(?:' + r.src_xn + '|' + r.src_pseudo_letter + '{1,63})'), + (r.src_domain = + '(?:' + + r.src_xn + + '|(?:' + + r.src_pseudo_letter + + ')|(?:' + + r.src_pseudo_letter + + '(?:-|' + + r.src_pseudo_letter + + '){0,61}' + + r.src_pseudo_letter + + '))'), + (r.src_host = + '(?:(?:(?:(?:' + r.src_domain + ')\\.)*' + r.src_domain + '))'), + (r.tpl_host_fuzzy = + '(?:' + + r.src_ip4 + + '|(?:(?:(?:' + + r.src_domain + + ')\\.)+(?:%TLDS%)))'), + (r.tpl_host_no_ip_fuzzy = + '(?:(?:(?:' + r.src_domain + ')\\.)+(?:%TLDS%))'), + (r.src_host_strict = r.src_host + r.src_host_terminator), + (r.tpl_host_fuzzy_strict = r.tpl_host_fuzzy + r.src_host_terminator), + (r.src_host_port_strict = + r.src_host + r.src_port + r.src_host_terminator), + (r.tpl_host_port_fuzzy_strict = + r.tpl_host_fuzzy + r.src_port + r.src_host_terminator), + (r.tpl_host_port_no_ip_fuzzy_strict = + r.tpl_host_no_ip_fuzzy + r.src_port + r.src_host_terminator), + (r.tpl_host_fuzzy_test = + 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + + r.src_ZPCc + + '|>|$))'), + (r.tpl_email_fuzzy = + '(^|[><\uff5c]|"|\\(|' + + r.src_ZCc + + ')(' + + r.src_email_name + + '@' + + r.tpl_host_fuzzy_strict + + ')'), + (r.tpl_link_fuzzy = + '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + + r.src_ZPCc + + '))((?![$+<=>^`|\uff5c])' + + r.tpl_host_port_fuzzy_strict + + r.src_path + + ')'), + (r.tpl_link_no_ip_fuzzy = + '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + + r.src_ZPCc + + '))((?![$+<=>^`|\uff5c])' + + r.tpl_host_port_no_ip_fuzzy_strict + + r.src_path + + ')'), + r + ); + })(e.__opts__)), + n = e.__tlds__.slice(); + function s(e) { + return e.replace('%TLDS%', r.src_tlds); + } + e.onCompile(), + e.__tlds_replaced__ || + n.push( + '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]', + ), + n.push(r.src_xn), + (r.src_tlds = n.join('|')), + (r.email_fuzzy = RegExp(s(r.tpl_email_fuzzy), 'i')), + (r.link_fuzzy = RegExp(s(r.tpl_link_fuzzy), 'i')), + (r.link_no_ip_fuzzy = RegExp(s(r.tpl_link_no_ip_fuzzy), 'i')), + (r.host_fuzzy_test = RegExp(s(r.tpl_host_fuzzy_test), 'i')); + var o = []; + function i(e, r) { + throw new Error('(LinkifyIt) Invalid schema "' + e + '": ' + r); + } + (e.__compiled__ = {}), + Object.keys(e.__schemas__).forEach(function (r) { + var t = e.__schemas__[r]; + if (null !== t) { + var n = { validate: null, link: null }; + if (((e.__compiled__[r] = n), '[object Object]' === lr(t))) + return ( + !(function (e) { + return '[object RegExp]' === lr(e); + })(t.validate) + ? ur(t.validate) + ? (n.validate = t.validate) + : i(r, t) + : (n.validate = (function (e) { + return function (r, t) { + var n = r.slice(t); + return e.test(n) ? n.match(e)[0].length : 0; + }; + })(t.validate)), + void (ur(t.normalize) + ? (n.normalize = t.normalize) + : t.normalize + ? i(r, t) + : (n.normalize = function (e, r) { + r.normalize(e); + })) + ); + !(function (e) { + return '[object String]' === lr(e); + })(t) + ? i(r, t) + : o.push(r); + } + }), + o.forEach(function (r) { + e.__compiled__[e.__schemas__[r]] && + ((e.__compiled__[r].validate = + e.__compiled__[e.__schemas__[r]].validate), + (e.__compiled__[r].normalize = + e.__compiled__[e.__schemas__[r]].normalize)); + }), + (e.__compiled__[''] = { + validate: null, + normalize: function (e, r) { + r.normalize(e); + }, + }); + var a = Object.keys(e.__compiled__) + .filter(function (r) { + return r.length > 0 && e.__compiled__[r]; + }) + .map(pr) + .join('|'); + (e.re.schema_test = RegExp( + '(^|(?!_)(?:[><\uff5c]|' + r.src_ZPCc + '))(' + a + ')', + 'i', + )), + (e.re.schema_search = RegExp( + '(^|(?!_)(?:[><\uff5c]|' + r.src_ZPCc + '))(' + a + ')', + 'ig', + )), + (e.re.pretest = RegExp( + '(' + + e.re.schema_test.source + + ')|(' + + e.re.host_fuzzy_test.source + + ')|@', + 'i', + )), + (function (e) { + (e.__index__ = -1), (e.__text_cache__ = ''); + })(e); + } + function gr(e, r) { + var t = e.__index__, + n = e.__last_index__, + s = e.__text_cache__.slice(t, n); + (this.schema = e.__schema__.toLowerCase()), + (this.index = t + r), + (this.lastIndex = n + r), + (this.raw = s), + (this.text = s), + (this.url = s); + } + function _r(e, r) { + var t = new gr(e, r); + return e.__compiled__[t.schema].normalize(t, e), t; + } + function br(e, r) { + if (!(this instanceof br)) return new br(e, r); + var t; + r || + ((t = e), + Object.keys(t || {}).reduce(function (e, r) { + return e || hr.hasOwnProperty(r); + }, !1) && ((r = e), (e = {}))), + (this.__opts__ = cr({}, hr, r)), + (this.__index__ = -1), + (this.__last_index__ = -1), + (this.__schema__ = ''), + (this.__text_cache__ = ''), + (this.__schemas__ = cr({}, fr, e)), + (this.__compiled__ = {}), + (this.__tlds__ = dr), + (this.__tlds_replaced__ = !1), + (this.re = {}), + mr(this); + } + (br.prototype.add = function (e, r) { + return (this.__schemas__[e] = r), mr(this), this; + }), + (br.prototype.set = function (e) { + return (this.__opts__ = cr(this.__opts__, e)), this; + }), + (br.prototype.test = function (e) { + if (((this.__text_cache__ = e), (this.__index__ = -1), !e.length)) + return !1; + var r, t, n, s, o, i, a, c; + if (this.re.schema_test.test(e)) + for ( + (a = this.re.schema_search).lastIndex = 0; + null !== (r = a.exec(e)); + + ) + if ((s = this.testSchemaAt(e, r[2], a.lastIndex))) { + (this.__schema__ = r[2]), + (this.__index__ = r.index + r[1].length), + (this.__last_index__ = r.index + r[0].length + s); + break; + } + return ( + this.__opts__.fuzzyLink && + this.__compiled__['http:'] && + (c = e.search(this.re.host_fuzzy_test)) >= 0 && + (this.__index__ < 0 || c < this.__index__) && + null !== + (t = e.match( + this.__opts__.fuzzyIP + ? this.re.link_fuzzy + : this.re.link_no_ip_fuzzy, + )) && + ((o = t.index + t[1].length), + (this.__index__ < 0 || o < this.__index__) && + ((this.__schema__ = ''), + (this.__index__ = o), + (this.__last_index__ = t.index + t[0].length))), + this.__opts__.fuzzyEmail && + this.__compiled__['mailto:'] && + e.indexOf('@') >= 0 && + null !== (n = e.match(this.re.email_fuzzy)) && + ((o = n.index + n[1].length), + (i = n.index + n[0].length), + (this.__index__ < 0 || + o < this.__index__ || + (o === this.__index__ && i > this.__last_index__)) && + ((this.__schema__ = 'mailto:'), + (this.__index__ = o), + (this.__last_index__ = i))), + this.__index__ >= 0 + ); + }), + (br.prototype.pretest = function (e) { + return this.re.pretest.test(e); + }), + (br.prototype.testSchemaAt = function (e, r, t) { + return this.__compiled__[r.toLowerCase()] + ? this.__compiled__[r.toLowerCase()].validate(e, t, this) + : 0; + }), + (br.prototype.match = function (e) { + var r = 0, + t = []; + this.__index__ >= 0 && + this.__text_cache__ === e && + (t.push(_r(this, r)), (r = this.__last_index__)); + for (var n = r ? e.slice(r) : e; this.test(n); ) + t.push(_r(this, r)), + (n = n.slice(this.__last_index__)), + (r += this.__last_index__); + return t.length ? t : null; + }), + (br.prototype.tlds = function (e, r) { + return ( + (e = Array.isArray(e) ? e : [e]), + r + ? ((this.__tlds__ = this.__tlds__ + .concat(e) + .sort() + .filter(function (e, r, t) { + return e !== t[r - 1]; + }) + .reverse()), + mr(this), + this) + : ((this.__tlds__ = e.slice()), + (this.__tlds_replaced__ = !0), + mr(this), + this) + ); + }), + (br.prototype.normalize = function (e) { + e.schema || (e.url = 'http://' + e.url), + 'mailto:' !== e.schema || + /^mailto:/i.test(e.url) || + (e.url = 'mailto:' + e.url); + }), + (br.prototype.onCompile = function () {}); + var kr = br, + vr = 2147483647, + Cr = 36, + yr = /^xn--/, + Ar = /[^\x20-\x7E]/, + xr = /[\x2E\u3002\uFF0E\uFF61]/g, + Dr = { + overflow: 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input', + }, + wr = Math.floor, + Er = String.fromCharCode; + /*! https://mths.be/punycode v1.4.1 by @mathias */ function qr(e) { + throw new RangeError(Dr[e]); + } + function Sr(e, r) { + for (var t = e.length, n = []; t--; ) n[t] = r(e[t]); + return n; + } + function Fr(e, r) { + var t = e.split('@'), + n = ''; + return ( + t.length > 1 && ((n = t[0] + '@'), (e = t[1])), + n + Sr((e = e.replace(xr, '.')).split('.'), r).join('.') + ); + } + function Lr(e) { + for (var r, t, n = [], s = 0, o = e.length; s < o; ) + (r = e.charCodeAt(s++)) >= 55296 && r <= 56319 && s < o + ? 56320 == (64512 & (t = e.charCodeAt(s++))) + ? n.push(((1023 & r) << 10) + (1023 & t) + 65536) + : (n.push(r), s--) + : n.push(r); + return n; + } + function zr(e) { + return Sr(e, function (e) { + var r = ''; + return ( + e > 65535 && + ((r += Er((((e -= 65536) >>> 10) & 1023) | 55296)), + (e = 56320 | (1023 & e))), + (r += Er(e)) + ); + }).join(''); + } + function Tr(e, r) { + return e + 22 + 75 * (e < 26) - ((0 != r) << 5); + } + function Ir(e, r, t) { + var n = 0; + for (e = t ? wr(e / 700) : e >> 1, e += wr(e / r); e > 455; n += Cr) + e = wr(e / 35); + return wr(n + (36 * e) / (e + 38)); + } + function Rr(e) { + var r, + t, + n, + s, + o, + i, + a, + c, + l, + u, + p, + h = [], + f = e.length, + d = 0, + m = 128, + g = 72; + for ((t = e.lastIndexOf('-')) < 0 && (t = 0), n = 0; n < t; ++n) + e.charCodeAt(n) >= 128 && qr('not-basic'), h.push(e.charCodeAt(n)); + for (s = t > 0 ? t + 1 : 0; s < f; ) { + for ( + o = d, i = 1, a = Cr; + s >= f && qr('invalid-input'), + ((c = + (p = e.charCodeAt(s++)) - 48 < 10 + ? p - 22 + : p - 65 < 26 + ? p - 65 + : p - 97 < 26 + ? p - 97 + : Cr) >= Cr || + c > wr((vr - d) / i)) && + qr('overflow'), + (d += c * i), + !(c < (l = a <= g ? 1 : a >= g + 26 ? 26 : a - g)); + a += Cr + ) + i > wr(vr / (u = Cr - l)) && qr('overflow'), (i *= u); + (g = Ir(d - o, (r = h.length + 1), 0 == o)), + wr(d / r) > vr - m && qr('overflow'), + (m += wr(d / r)), + (d %= r), + h.splice(d++, 0, m); + } + return zr(h); + } + function Mr(e) { + var r, + t, + n, + s, + o, + i, + a, + c, + l, + u, + p, + h, + f, + d, + m, + g = []; + for (h = (e = Lr(e)).length, r = 128, t = 0, o = 72, i = 0; i < h; ++i) + (p = e[i]) < 128 && g.push(Er(p)); + for (n = s = g.length, s && g.push('-'); n < h; ) { + for (a = vr, i = 0; i < h; ++i) (p = e[i]) >= r && p < a && (a = p); + for ( + a - r > wr((vr - t) / (f = n + 1)) && qr('overflow'), + t += (a - r) * f, + r = a, + i = 0; + i < h; + ++i + ) + if (((p = e[i]) < r && ++t > vr && qr('overflow'), p == r)) { + for ( + c = t, l = Cr; + !(c < (u = l <= o ? 1 : l >= o + 26 ? 26 : l - o)); + l += Cr + ) + (m = c - u), + (d = Cr - u), + g.push(Er(Tr(u + (m % d), 0))), + (c = wr(m / d)); + g.push(Er(Tr(c, 0))), (o = Ir(t, f, n == s)), (t = 0), ++n; + } + ++t, ++r; + } + return g.join(''); + } + function Br(e) { + return Fr(e, function (e) { + return yr.test(e) ? Rr(e.slice(4).toLowerCase()) : e; + }); + } + function Nr(e) { + return Fr(e, function (e) { + return Ar.test(e) ? 'xn--' + Mr(e) : e; + }); + } + var Or = '1.4.1', + Pr = { decode: Lr, encode: zr }, + jr = { + version: Or, + ucs2: Pr, + toASCII: Nr, + toUnicode: Br, + encode: Mr, + decode: Rr, + }, + Ur = e( + Object.freeze({ + __proto__: null, + decode: Rr, + encode: Mr, + toUnicode: Br, + toASCII: Nr, + version: Or, + ucs2: Pr, + default: jr, + }), + ), + Vr = { + default: { + options: { + html: !1, + xhtmlOut: !1, + breaks: !1, + langPrefix: 'language-', + linkify: !1, + typographer: !1, + quotes: '\u201c\u201d\u2018\u2019', + highlight: null, + maxNesting: 100, + }, + components: { core: {}, block: {}, inline: {} }, + }, + zero: { + options: { + html: !1, + xhtmlOut: !1, + breaks: !1, + langPrefix: 'language-', + linkify: !1, + typographer: !1, + quotes: '\u201c\u201d\u2018\u2019', + highlight: null, + maxNesting: 20, + }, + components: { + core: { rules: ['normalize', 'block', 'inline'] }, + block: { rules: ['paragraph'] }, + inline: { + rules: ['text'], + rules2: ['balance_pairs', 'text_collapse'], + }, + }, + }, + commonmark: { + options: { + html: !0, + xhtmlOut: !0, + breaks: !1, + langPrefix: 'language-', + linkify: !1, + typographer: !1, + quotes: '\u201c\u201d\u2018\u2019', + highlight: null, + maxNesting: 20, + }, + components: { + core: { rules: ['normalize', 'block', 'inline'] }, + block: { + rules: [ + 'blockquote', + 'code', + 'fence', + 'heading', + 'hr', + 'html_block', + 'lheading', + 'list', + 'reference', + 'paragraph', + ], + }, + inline: { + rules: [ + 'autolink', + 'backticks', + 'emphasis', + 'entity', + 'escape', + 'html_inline', + 'image', + 'link', + 'newline', + 'text', + ], + rules2: ['balance_pairs', 'emphasis', 'text_collapse'], + }, + }, + }, + }, + Zr = /^(vbscript|javascript|file|data):/, + Gr = /^data:image\/(gif|png|jpeg|webp);/; + function $r(e) { + var r = e.trim().toLowerCase(); + return !Zr.test(r) || !!Gr.test(r); + } + var Hr = ['http:', 'https:', 'mailto:']; + function Jr(e) { + var r = C.parse(e, !0); + if (r.hostname && (!r.protocol || Hr.indexOf(r.protocol) >= 0)) + try { + r.hostname = Ur.toASCII(r.hostname); + } catch (e) {} + return C.encode(C.format(r)); + } + function Wr(e) { + var r = C.parse(e, !0); + if (r.hostname && (!r.protocol || Hr.indexOf(r.protocol) >= 0)) + try { + r.hostname = Ur.toUnicode(r.hostname); + } catch (e) {} + return C.decode(C.format(r), C.decode.defaultChars + '%'); + } + function Yr(e, r) { + if (!(this instanceof Yr)) return new Yr(e, r); + r || w.isString(e) || ((r = e || {}), (e = 'default')), + (this.inline = new ar()), + (this.block = new Fe()), + (this.core = new ce()), + (this.renderer = new R()), + (this.linkify = new kr()), + (this.validateLink = $r), + (this.normalizeLink = Jr), + (this.normalizeLinkText = Wr), + (this.utils = w), + (this.helpers = w.assign({}, S)), + (this.options = {}), + this.configure(e), + r && this.set(r); + } + return ( + (Yr.prototype.set = function (e) { + return w.assign(this.options, e), this; + }), + (Yr.prototype.configure = function (e) { + var r, + t = this; + if (w.isString(e) && !(e = Vr[(r = e)])) + throw new Error('Wrong `markdown-it` preset "' + r + '", check name'); + if (!e) throw new Error("Wrong `markdown-it` preset, can't be empty"); + return ( + e.options && t.set(e.options), + e.components && + Object.keys(e.components).forEach(function (r) { + e.components[r].rules && + t[r].ruler.enableOnly(e.components[r].rules), + e.components[r].rules2 && + t[r].ruler2.enableOnly(e.components[r].rules2); + }), + this + ); + }), + (Yr.prototype.enable = function (e, r) { + var t = []; + Array.isArray(e) || (e = [e]), + ['core', 'block', 'inline'].forEach(function (r) { + t = t.concat(this[r].ruler.enable(e, !0)); + }, this), + (t = t.concat(this.inline.ruler2.enable(e, !0))); + var n = e.filter(function (e) { + return t.indexOf(e) < 0; + }); + if (n.length && !r) + throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + n); + return this; + }), + (Yr.prototype.disable = function (e, r) { + var t = []; + Array.isArray(e) || (e = [e]), + ['core', 'block', 'inline'].forEach(function (r) { + t = t.concat(this[r].ruler.disable(e, !0)); + }, this), + (t = t.concat(this.inline.ruler2.disable(e, !0))); + var n = e.filter(function (e) { + return t.indexOf(e) < 0; + }); + if (n.length && !r) + throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + n); + return this; + }), + (Yr.prototype.use = function (e) { + var r = [this].concat(Array.prototype.slice.call(arguments, 1)); + return e.apply(e, r), this; + }), + (Yr.prototype.parse = function (e, r) { + if ('string' != typeof e) + throw new Error('Input data should be a String'); + var t = new this.core.State(e, this, r); + return this.core.process(t), t.tokens; + }), + (Yr.prototype.render = function (e, r) { + return ( + (r = r || {}), this.renderer.render(this.parse(e, r), this.options, r) + ); + }), + (Yr.prototype.parseInline = function (e, r) { + var t = new this.core.State(e, this, r); + return (t.inlineMode = !0), this.core.process(t), t.tokens; + }), + (Yr.prototype.renderInline = function (e, r) { + return ( + (r = r || {}), + this.renderer.render(this.parseInline(e, r), this.options, r) + ); + }), + Yr + ); +}); diff --git a/app/assets/javascripts/markdownlint-browser.min.js b/app/assets/javascripts/markdownlint-browser.min.js new file mode 100644 index 000000000..e2319e001 --- /dev/null +++ b/app/assets/javascripts/markdownlint-browser.min.js @@ -0,0 +1,2827 @@ +/* eslint-disable */ +/*! For license information please see markdownlint-browser.min.js.LICENSE.txt */ +var markdownlint; +markdownlint = (() => { + var e = { + 7490: (e) => { + function n(e) { + var n = new Error("Cannot find module '" + e + "'"); + throw ((n.code = 'MODULE_NOT_FOUND'), n); + } + (n.keys = () => []), (n.resolve = n), (n.id = 7490), (e.exports = n); + }, + 3079: (e, n, t) => { + 'use strict'; + var r = t(4219), + i = /\r\n?|\n/g; + (e.exports.newLineRe = i), + (e.exports.frontMatterRe = + /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m); + var o = + //gi; + (e.exports.inlineCommentRe = o), + (e.exports.bareUrlRe = + /(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/gi), + (e.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/), + (e.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/); + var a = /[_*]/g, + s = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g; + e.exports.utf8Encoding = 'utf8'; + var l = '.,;:!?。,;:!?'; + (e.exports.allPunctuation = l), + (e.exports.allPunctuationNoQuestion = l.replace(/[??]/gu, '')), + (e.exports.isNumber = function (e) { + return 'number' == typeof e; + }), + (e.exports.isString = function (e) { + return 'string' == typeof e; + }), + (e.exports.isEmptyString = function (e) { + return 0 === e.length; + }), + (e.exports.isObject = function (e) { + return null !== e && 'object' == typeof e && !Array.isArray(e); + }); + var u = />|(?:)/g; + (e.exports.isBlankLine = function (e) { + return !e || !e.trim() || !e.replace(u, '').trim(); + }), + (e.exports.numericSortAscending = function (e, n) { + return e - n; + }), + (e.exports.includesSorted = function (e, n) { + for (var t = 0, r = e.length - 1; t <= r; ) { + var i = (t + r) >> 1; + if (e[i] < n) t = i + 1; + else { + if (!(e[i] > n)) return !0; + r = i - 1; + } + } + return !1; + }); + var c = '\x3c!--', + f = '--\x3e'; + (e.exports.clearHtmlCommentText = function (e) { + for (var n = 0; -1 !== (n = e.indexOf(c, n)); ) { + var t = e.indexOf(f, n + 2); + if (-1 === t) break; + if (t > n + c.length) { + for (var r = n - 1; ' ' === e[r]; ) r--; + if (r >= n - 4) { + var i = e.slice(n + c.length, t); + (r < 0 || + '\n' === e[r] || + (!i.startsWith('>') && + !i.startsWith('->') && + !i.endsWith('-') && + !i.includes('--'))) && + -1 === e.slice(n, t + f.length).search(o) && + (e = + e.slice(0, n + c.length) + + i.replace(/[^\r\n]/g, '.') + + e.slice(t)); + } + } + n = t + f.length; + } + return e; + }), + (e.exports.escapeForRegExp = function (e) { + return e.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); + }); + var d = /\\./g; + function p(e) { + var n = e.line.replace(/^[\s>]*(> |>)/, ''); + return n.length - n.trimStart().length; + } + function m(e, n, t) { + e.tokens.forEach(function (e) { + e.type === n && t(e); + }); + } + function h(e) { + return ( + 'math' === e.tag && + e.type.startsWith('math_block') && + !e.type.endsWith('_end') + ); + } + function g(e, n) { + for (var t = 0, r = 0, i = 0; i < e.length; ) { + for ( + var o = -1, a = -1, s = -1, l = 0, u = 0, c = 'normal'; + i <= e.length; + i++ + ) { + var f = e[i]; + '[' === f && 'normal' === c + ? (c = 'linkTextOpen') + : ']' === f && 'linkTextOpen' === c + ? (c = 'linkTextClosed') + : '(' === f && 'linkTextClosed' === c + ? (c = 'linkDestinationOpen') + : (('(' === f && 'linkDestinationOpen' === c) || + (')' === f && 'linkDestinationOpen' === c) || + 'linkTextClosed' === c) && + (c = 'normal'), + '`' === f && 'linkDestinationOpen' !== c + ? (u++, (-1 !== o && -1 !== s) || (o = i + 1)) + : (o >= 0 && s >= 0 && l === u + ? (n(e.substring(o, i - u), a, s, l), (o = -1), (s = -1)) + : o >= 0 && -1 === s && ((l = u), (a = t), (s = r)), + (u = 0)), + '\n' === f + ? (t++, (r = 0)) + : '\\' !== f || (-1 !== o && -1 !== s) || '\n' === e[i + 1] + ? r++ + : (i++, (r += 2)); + } + o >= 0 && ((i = o), (t = a), (r = s)); + } + } + function v(e, n, t, r, i, o) { + e({ lineNumber: n, detail: t, context: r, range: i, fixInfo: o }); + } + function x(e) { + var n = 0, + t = 0, + o = 0; + return ( + (e.match(i) || []).forEach(function (e) { + switch (e) { + case '\r': + n++; + break; + case '\n': + t++; + break; + case '\r\n': + o++; + } + }), + n || t || o + ? t >= o && t >= n + ? '\n' + : o >= n + ? '\r\n' + : '\r' + : r.EOL + ); + } + function b(e, n) { + return { + lineNumber: e.lineNumber || n, + editColumn: e.editColumn || 1, + deleteCount: e.deleteCount || 0, + insertText: e.insertText || '', + }; + } + function E(e, n, t) { + var r = b(n), + i = r.editColumn, + o = r.deleteCount, + a = r.insertText, + s = i - 1; + return -1 === o + ? null + : e.slice(0, s) + a.replace(/\n/g, t || '\n') + e.slice(s + o); + } + (e.exports.unescapeMarkdown = function (e, n) { + return e.replace(d, function (e) { + var t = e[1]; + return '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'.includes(t) + ? n || t + : e; + }); + }), + (e.exports.fencedCodeBlockStyleFor = function (e) { + switch (e[0]) { + case '~': + return 'tilde'; + default: + return 'backtick'; + } + }), + (e.exports.indentFor = p), + (e.exports.headingStyleFor = function (e) { + return e.map[1] - e.map[0] == 1 + ? /[^\\]#\s*$/.test(e.line) + ? 'atx_closed' + : 'atx' + : 'setext'; + }), + (e.exports.unorderedListStyleFor = function (e) { + switch (e.markup) { + case '-': + return 'dash'; + case '+': + return 'plus'; + default: + return 'asterisk'; + } + }), + (e.exports.filterTokens = m), + (e.exports.getLineMetadata = function (e) { + var n = e.lines.map(function (e, n) { + return [e, n, !1, 0, !1, !1, !1, !1]; + }); + return ( + m(e, 'fence', function (e) { + (n[e.map[0]][3] = 1), (n[e.map[1] - 1][3] = -1); + for (var t = e.map[0] + 1; t < e.map[1] - 1; t++) n[t][2] = !0; + }), + m(e, 'code_block', function (e) { + for (var t = e.map[0]; t < e.map[1]; t++) n[t][2] = !0; + }), + m(e, 'table_open', function (e) { + for (var t = e.map[0]; t < e.map[1]; t++) n[t][4] = !0; + }), + m(e, 'list_item_open', function (e) { + for (var t = 1, r = e.map[0]; r < e.map[1]; r++) + (n[r][5] = t), t++; + }), + m(e, 'hr', function (e) { + n[e.map[0]][6] = !0; + }), + e.tokens.filter(h).forEach(function (e) { + for (var t = e.map[0]; t < e.map[1]; t++) n[t][7] = !0; + }), + n + ); + }), + (e.exports.forEachLine = function (e, n) { + e.forEach(function (e) { + n.apply(void 0, e); + }); + }), + (e.exports.flattenLists = function (e) { + var n = [], + t = [], + r = null, + i = 0, + o = [], + a = { map: [0, 1] }; + return ( + e.tokens.forEach(function (e) { + h(e) && e.map[1] && e.map[1]++, + 'bullet_list_open' === e.type || + 'ordered_list_open' === e.type + ? (t.push(r), + (r = { + unordered: 'bullet_list_open' === e.type, + parentsUnordered: + !r || (r.unordered && r.parentsUnordered), + open: e, + indent: p(e), + parentIndent: (r && r.indent) || 0, + items: [], + nesting: i, + lastLineIndex: -1, + insert: n.length, + }), + i++) + : 'bullet_list_close' === e.type || + 'ordered_list_close' === e.type + ? ((r.lastLineIndex = a.map[1]), + n.splice(r.insert, 0, r), + delete r.insert, + (r = t.pop()), + i--) + : 'list_item_open' === e.type + ? r.items.push(e) + : 'blockquote_open' === e.type + ? (o.push(i), (i = 0)) + : 'blockquote_close' === e.type + ? (i = o.pop()) + : e.map && (a = e); + }), + n + ); + }), + (e.exports.forEachInlineChild = function (e, n, t) { + m(e, 'inline', function (e) { + e.children.forEach(function (r) { + r.type === n && t(r, e); + }); + }); + }), + (e.exports.forEachHeading = function (e, n) { + var t = null; + e.tokens.forEach(function (e) { + 'heading_open' === e.type + ? (t = e) + : 'heading_close' === e.type + ? (t = null) + : 'inline' === e.type && t && n(t, e.content); + }); + }), + (e.exports.forEachInlineCodeSpan = g), + (e.exports.addError = v), + (e.exports.addErrorDetailIf = function (e, n, t, r, i, o, a, s) { + t !== r && + v( + e, + n, + 'Expected: ' + t + '; Actual: ' + r + (i ? '; ' + i : ''), + o, + a, + s, + ); + }), + (e.exports.addErrorContext = function (e, n, t, r, i, o, a) { + t.length <= 30 || + (t = + r && i + ? t.substr(0, 15) + '...' + t.substr(-15) + : i + ? '...' + t.substr(-30) + : t.substr(0, 30) + '...'), + v(e, n, null, t, o, a); + }), + (e.exports.rangeFromRegExp = function (e, n) { + var t = null, + r = e.match(n); + return r && (t = [r.index + 1, r[0].length]), t; + }), + (e.exports.frontMatterHasTitle = function (e, n) { + var t = void 0 !== n && !n, + r = new RegExp(String(n || '^\\s*"?title"?\\s*[:=]'), 'i'); + return ( + !t && + e.some(function (e) { + return r.test(e); + }) + ); + }), + (e.exports.emphasisMarkersInContent = function (e) { + var n = e.lines, + t = new Array(n.length); + return ( + m(e, 'inline', function (e) { + var r = e.children, + o = e.lineNumber, + s = e.map; + r.some(function (e) { + return 'code_inline' === e.type; + }) && + g(n.slice(s[0], s[1]).join('\n'), function (e, n, r, s) { + e.split(i).forEach(function (e, i) { + for (var l = null; (l = a.exec(e)); ) { + var u = o - 1 + n + i, + c = t[u] || [], + f = i ? 0 : r - 1 + s; + c.push(f + l.index), (t[u] = c); + } + }); + }); + }), + n.forEach(function (e, n) { + for (var r = null; (r = s.exec(e)); ) + for (var i = null; (i = a.exec(r[0])); ) { + var o = t[n] || []; + o.push(r.index + i.index), (t[n] = o); + } + }), + t + ); + }), + (e.exports.getPreferredLineEnding = x), + (e.exports.applyFix = E), + (e.exports.applyFixes = function (e, n) { + var t = x(e), + r = e.split(i), + o = n + .filter(function (e) { + return e.fixInfo; + }) + .map(function (e) { + return b(e.fixInfo, e.lineNumber); + }); + o.sort(function (e, n) { + var t = -1 === e.deleteCount, + r = -1 === n.deleteCount; + return ( + n.lineNumber - e.lineNumber || + (t ? 1 : r ? -1 : 0) || + n.editColumn - e.editColumn || + n.insertText.length - e.insertText.length + ); + }); + var a = {}; + (o = o.filter(function (e) { + var n = + e.lineNumber !== a.lineNumber || + e.editColumn !== a.editColumn || + e.deleteCount !== a.deleteCount || + e.insertText !== a.insertText; + return (a = e), n; + })), + (a = {}), + o.forEach(function (e) { + e.lineNumber === a.lineNumber && + e.editColumn === a.editColumn && + !e.insertText && + e.deleteCount > 0 && + a.insertText && + !a.deleteCount && + ((e.insertText = a.insertText), (a.lineNumber = 0)), + (a = e); + }), + (o = o.filter(function (e) { + return e.lineNumber; + })); + var s = -1, + l = -1; + return ( + o.forEach(function (e) { + var n = e.lineNumber, + i = e.editColumn, + o = e.deleteCount, + a = n - 1, + u = i - 1; + (a !== s || -1 === o || u + o <= l - (o > 0 ? 0 : 1)) && + (r[a] = E(r[a], e, t)), + (s = a), + (l = u); + }), + r + .filter(function (e) { + return null !== e; + }) + .join(t) + ); + }); + }, + 7754: (e) => { + 'use strict'; + var n = null; + e.exports.lineMetadata = function (e) { + return e && (n = e), n; + }; + var t = null; + (e.exports.flattenedLists = function (e) { + return e && (t = e), t; + }), + (e.exports.clear = function () { + (n = null), (t = null); + }); + }, + 3411: function (e, n, t) { + 'use strict'; + var r = + (this && this.__assign) || + function () { + return (r = + Object.assign || + function (e) { + for (var n, t = 1, r = arguments.length; t < r; t++) + for (var i in (n = arguments[t])) + Object.prototype.hasOwnProperty.call(n, i) && + (e[i] = n[i]); + return e; + }).apply(this, arguments); + }, + i = + (this && this.__spreadArrays) || + function () { + for (var e = 0, n = 0, t = arguments.length; n < t; n++) + e += arguments[n].length; + var r = Array(e), + i = 0; + for (n = 0; n < t; n++) + for (var o = arguments[n], a = 0, s = o.length; a < s; a++, i++) + r[i] = o[a]; + return r; + }, + o = t(2993), + a = t(1386), + s = t(1758).promisify, + l = t(4470), + u = t(3966), + c = t(3079), + f = t(7754), + d = 'undefined' == typeof require ? t(7490) : require, + p = ['MD002', 'MD006']; + function m(e, n) { + return e.lineNumber - n.lineNumber; + } + function h() { + return !0; + } + function g(e, n, t) { + return 0 === n || e.lineNumber > t[n - 1].lineNumber; + } + function v(e, n, t, o, a, s, l, u, d, v) { + var x = (function (e, n) { + var t = []; + if (n) { + var r = e.match(n); + if (r && !r.index) { + var i = r[0]; + (e = e.slice(i.length)), + (t = i.split(c.newLineRe)).length > 0 && + '' === t[t.length - 1] && + t.length--; + } + } + return { content: e, frontMatterLines: t }; + })((t = t.replace(/^\uFEFF/, '')), s), + b = x.frontMatterLines; + t = c.clearHtmlCommentText(x.content); + var E = o.parse(t, {}), + k = t.split(c.newLineRe); + !(function (e, n) { + var t = null; + e.forEach(function (e) { + if ( + ('thead_open' === e.type || 'tbody_open' === e.type + ? (t = e.map.slice()) + : 'tr_close' === e.type && t + ? t[0]++ + : ('thead_close' !== e.type && 'tbody_close' !== e.type) || + (t = null), + t && !e.map && (e.map = t.slice()), + e.map) + ) { + for ( + e.line = n[e.map[0]], e.lineNumber = e.map[0] + 1; + e.map[1] && !(n[e.map[1] - 1] || '').trim(); + + ) + e.map[1]--; + var r = e.lineNumber, + i = []; + c.forEachInlineCodeSpan(e.content, function (e) { + i.push(e.split(c.newLineRe).length - 1); + }), + (e.children || []).forEach(function (e) { + (e.lineNumber = r), + (e.line = n[r - 1]), + 'softbreak' === e.type || 'hardbreak' === e.type + ? r++ + : 'code_inline' === e.type && (r += i.shift()); + }); + } + }); + })(E, k); + var y = (function (e) { + var n = {}; + return ( + e.forEach(function (e) { + var t = e.names[0].toUpperCase(); + e.names.forEach(function (e) { + var r = e.toUpperCase(); + n[r] = [t]; + }), + e.tags.forEach(function (e) { + var r = e.toUpperCase(), + i = n[r] || []; + i.push(t), (n[r] = i); + }); + }), + n + ); + })(e), + C = (function (e, n, t, i, o, a) { + var s = {}, + l = {}, + u = [], + f = new Array(1 + t.length); + function d(e, t, r) { + (e ? n : [n.join('\n')]).forEach(function (e, n) { + if (!i) + for (var o = null; (o = c.inlineCommentRe.exec(e)); ) { + var a = (o[1] || o[3]).toUpperCase(), + s = o[2] || o[4]; + t(a, s, n + 1); + } + r && r(); + }); + } + function m(e, n, t) { + var r = e.startsWith('ENABLE'); + (n ? n.trim().toUpperCase().split(/\s+/) : u).forEach(function ( + e, + ) { + (a[e] || []).forEach(function (e) { + t[e] = r; + }); + }); + } + d(!1, function (e, n) { + if ('CONFIGURE-FILE' === e) + try { + var t = JSON.parse(n); + o = r(r({}, o), t); + } catch (e) {} + }); + var h = (function (e, n, t) { + var r = Object.keys(n).filter(function (e) { + return 'DEFAULT' === e.toUpperCase(); + }), + i = 0 === r.length || !!n[r[0]], + o = {}; + return ( + e.forEach(function (e) { + var n = e.names[0].toUpperCase(); + o[n] = i; + }), + p.forEach(function (e) { + o[e] = !1; + }), + Object.keys(n).forEach(function (e) { + var r = n[e]; + r ? r instanceof Object || (r = {}) : (r = !1); + var i = e.toUpperCase(); + (t[i] || []).forEach(function (e) { + o[e] = r; + }); + }), + o + ); + })(e, o, a); + return ( + e.forEach(function (e) { + var n = e.names[0].toUpperCase(); + u.push(n), (s[n] = !!h[n]); + }), + (l = s), + d(!0, function (e, n) { + ('ENABLE-FILE' !== e && 'DISABLE-FILE' !== e) || m(e, n, s); + }), + d( + !0, + function (e, n) { + 'CAPTURE' === e + ? (l = r({}, s)) + : 'RESTORE' === e + ? (s = r({}, l)) + : ('ENABLE' !== e && 'DISABLE' !== e) || + m(e, n, (s = r({}, s))); + }, + function () { + f.push(r({}, s)); + }, + ), + d(!0, function (e, n, t) { + 'DISABLE-NEXT-LINE' === e && m(e, n, f[t + 1] || {}); + }), + { effectiveConfig: h, enabledRulesPerLineNumber: f } + ); + })(e, k, b, u, a, y), + _ = C.effectiveConfig, + N = C.enabledRulesPerLineNumber, + w = { name: n, tokens: E, lines: k, frontMatterLines: b }; + f.lineMetadata(c.getLineMetadata(w)), + f.flattenedLists(c.flattenLists(w)); + var M = 0 === d ? {} : []; + try { + e.forEach(function (e) { + var n = e.names[0], + t = n.toUpperCase(); + function r(e) { + throw new Error( + "Property '" + e + "' of onError parameter is incorrect.", + ); + } + w.config = _[t]; + var o = []; + function a(e) { + (!e || + !c.isNumber(e.lineNumber) || + e.lineNumber < 1 || + e.lineNumber > k.length) && + r('lineNumber'), + e.detail && !c.isString(e.detail) && r('detail'), + e.context && !c.isString(e.context) && r('context'), + e.range && + (!Array.isArray(e.range) || + 2 !== e.range.length || + !c.isNumber(e.range[0]) || + e.range[0] < 1 || + !c.isNumber(e.range[1]) || + e.range[1] < 1 || + e.range[0] + e.range[1] - 1 > + k[e.lineNumber - 1].length) && + r('range'); + var n = e.fixInfo, + t = {}; + if (n) { + c.isObject(n) || r('fixInfo'), + void 0 !== n.lineNumber && + ((!c.isNumber(n.lineNumber) || + n.lineNumber < 1 || + n.lineNumber > k.length) && + r('fixInfo.lineNumber'), + (t.lineNumber = n.lineNumber + b.length)); + var a = n.lineNumber || e.lineNumber; + void 0 !== n.editColumn && + ((!c.isNumber(n.editColumn) || + n.editColumn < 1 || + n.editColumn > k[a - 1].length + 1) && + r('fixInfo.editColumn'), + (t.editColumn = n.editColumn)), + void 0 !== n.deleteCount && + ((!c.isNumber(n.deleteCount) || + n.deleteCount < -1 || + n.deleteCount > k[a - 1].length) && + r('fixInfo.deleteCount'), + (t.deleteCount = n.deleteCount)), + void 0 !== n.insertText && + (c.isString(n.insertText) || r('fixInfo.insertText'), + (t.insertText = n.insertText)); + } + o.push({ + lineNumber: e.lineNumber + b.length, + detail: e.detail || null, + context: e.context || null, + range: e.range ? i(e.range) : null, + fixInfo: n ? t : null, + }); + } + if (l) + try { + e.function(w, a); + } catch (e) { + a({ + lineNumber: 1, + detail: 'This rule threw an exception: ' + e.message, + }); + } + else e.function(w, a); + if (o.length > 0) { + o.sort(m); + var s = o + .filter(3 === d ? h : g) + .filter(function (e) { + return N[e.lineNumber][t]; + }) + .map(function (t) { + if (0 === d) return t.lineNumber; + var r = {}; + return ( + (r.lineNumber = t.lineNumber), + 1 === d + ? ((r.ruleName = n), + (r.ruleAlias = e.names[1] || e.names[0])) + : (r.ruleNames = e.names), + (r.ruleDescription = e.description), + (r.ruleInformation = e.information + ? e.information.href + : null), + (r.errorDetail = t.detail), + (r.errorContext = t.context), + (r.errorRange = t.range), + 3 === d && (r.fixInfo = t.fixInfo), + r + ); + }); + s.length > 0 && + (0 === d ? (M[n] = s) : Array.prototype.push.apply(M, s)); + } + }); + } catch (e) { + return f.clear(), v(e); + } + return f.clear(), v(null, M); + } + function x(e, n, t, r, i, a, s, l, u, f) { + function d(o, u) { + return o ? f(o) : v(e, n, u, t, r, i, a, s, l, f); + } + u + ? d(null, o.readFileSync(n, c.utf8Encoding)) + : o.readFile(n, c.utf8Encoding, d); + } + function b(e, n, t) { + (e = e || {}), (t = t || function () {}); + var r = u.concat(e.customRules || []), + i = (function (e) { + var n = null; + if (e.length === u.length) return n; + var t = {}; + return ( + e.forEach(function (e, r) { + var i = r - u.length; + function o(e) { + return new Error( + "Property '" + + e + + "' of custom rule at index " + + i + + ' is incorrect.', + ); + } + ['names', 'tags'].forEach(function (t) { + var r = e[t]; + n || + (r && + Array.isArray(r) && + 0 !== r.length && + r.every(c.isString) && + !r.some(c.isEmptyString)) || + (n = o(t)); + }), + [ + ['description', 'string'], + ['function', 'function'], + ].forEach(function (t) { + var r = t[0], + i = e[r]; + n || (i && typeof i === t[1]) || (n = o(r)); + }), + !n && + e.information && + Object.getPrototypeOf(e.information) !== URL.prototype && + (n = o('information')), + n || + (e.names.forEach(function (e) { + var r = e.toUpperCase(); + n || + void 0 === t[r] || + (n = new Error( + "Name '" + + e + + "' of custom rule at index " + + i + + ' is already used as a name or tag.', + )), + (t[r] = !0); + }), + e.tags.forEach(function (e) { + var r = e.toUpperCase(); + !n && + t[r] && + (n = new Error( + "Tag '" + + e + + "' of custom rule at index " + + i + + ' is already used as a name.', + )), + (t[r] = !1); + })); + }), + n + ); + })(r); + if (i) return t(i); + var o = []; + Array.isArray(e.files) + ? (o = e.files.slice()) + : e.files && (o = [String(e.files)]); + var a = e.strings || {}, + s = Object.keys(a), + f = e.config || { default: !0 }, + d = void 0 === e.frontMatter ? c.frontMatterRe : e.frontMatter, + p = !!e.handleRuleFailures, + m = !!e.noInlineConfig, + h = void 0 === e.resultVersion ? 2 : e.resultVersion, + g = l({ html: !0 }); + (e.markdownItPlugins || []).forEach(function (e) { + g.use.apply(g, e); + }); + var b = (function (e) { + var n = {}; + return ( + Object.defineProperty(n, 'toString', { + value: function (t) { + var r = null, + i = [], + o = Object.keys(n); + return ( + o.sort(), + o.forEach(function (o) { + var a = n[o]; + Array.isArray(a) + ? a.forEach(function (e) { + var n = e.ruleNames + ? e.ruleNames.join('/') + : e.ruleName + '/' + e.ruleAlias; + i.push( + o + + ': ' + + e.lineNumber + + ': ' + + n + + ' ' + + e.ruleDescription + + (e.errorDetail + ? ' [' + e.errorDetail + ']' + : '') + + (e.errorContext + ? ' [Context: "' + e.errorContext + '"]' + : ''), + ); + }) + : (r || + ((r = {}), + e.forEach(function (e) { + var n = e.names[0].toUpperCase(); + r[n] = e; + })), + Object.keys(a).forEach(function (e) { + var n = r[e.toUpperCase()]; + a[e].forEach(function (e) { + var r = Math.min(t ? 1 : 0, n.names.length - 1), + a = + o + + ': ' + + e + + ': ' + + n.names[r] + + ' ' + + n.description; + i.push(a); + }); + })); + }), + i.join('\n') + ); + }, + }), + n + ); + })(r), + E = !1, + k = null; + function y(e, n) { + return e ? ((E = !0), t(e)) : ((b[k] = n), null); + } + for (; !E && (k = s.shift()); ) + v(r, k, a[k] || '', g, f, d, p, m, h, y); + if (n) { + for (; !E && (k = o.shift()); ) x(r, k, g, f, d, p, m, h, n, y); + return E || t(null, b); + } + var C = 0; + function _() { + var e = o.shift(); + if (E); + else if (e) + C++, + x(r, e, g, f, d, p, m, h, n, function (n, r) { + return C--, n ? ((E = !0), t(n)) : ((b[e] = r), _(), null); + }); + else if (0 === C) return (E = !0), t(null, b); + return null; + } + return _(), _(), _(), _(), _(), _(), _(), _(), null; + } + function E(e, n) { + return b(e, !1, n); + } + var k = s && s(E); + function y(e, n, t) { + var r = null, + i = '', + o = []; + return ( + (t || [JSON.parse]).every(function (e) { + try { + r = e(n); + } catch (e) { + o.push(e.message); + } + return !r; + }), + r || (o.unshift("Unable to parse '" + e + "'"), (i = o.join('; '))), + { config: r, message: i } + ); + } + function C(e, n) { + var t = a.dirname(e), + r = a.resolve(t, n); + try { + if (o.statSync(r).isFile()) return r; + } catch (e) {} + try { + return d.resolve(n, { paths: [t] }); + } catch (e) {} + return r; + } + function _(e, n, t) { + t || ((t = n), (n = null)), + o.readFile(e, c.utf8Encoding, function (i, o) { + if (i) return t(i); + var a = y(e, o, n), + s = a.config, + l = a.message; + if (!s) return t(new Error(l)); + var u = s.extends; + return u + ? (delete s.extends, + _(C(e, u), n, function (e, n) { + return e ? t(e) : t(null, r(r({}, n), s)); + })) + : t(null, s); + }); + } + var N = s && s(_); + (E.sync = function (e) { + var n = null; + return ( + b(e, !0, function (e, t) { + if (e) throw e; + n = t; + }), + n + ); + }), + (E.readConfig = _), + (E.readConfigSync = function e(n, t) { + var i = y(n, o.readFileSync(n, c.utf8Encoding), t), + a = i.config, + s = i.message; + if (!a) throw new Error(s); + var l = a.extends; + if (l) { + delete a.extends; + var u = C(n, l); + return r(r({}, e(u, t)), a); + } + return a; + }), + (E.getVersion = function () { + return t(1500).version; + }), + (E.promises = { + markdownlint: function (e) { + return k(e); + }, + readConfig: function (e, n) { + return N(e, n); + }, + }), + (e.exports = E); + }, + 1408: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.filterTokens; + e.exports = { + names: ['MD001', 'heading-increment', 'header-increment'], + description: + 'Heading levels should only increment by one level at a time', + tags: ['headings', 'headers'], + function: function (e, n) { + var t = 0; + o(e, 'heading_open', function (e) { + var r = Number.parseInt(e.tag.slice(1), 10); + t && r > t && i(n, e.lineNumber, 'h' + (t + 1), 'h' + r), (t = r); + }); + }, + }; + }, + 7091: (e, n, t) => { + 'use strict'; + var r = t(3079).addErrorDetailIf; + e.exports = { + names: ['MD002', 'first-heading-h1', 'first-header-h1'], + description: 'First heading should be a top-level heading', + tags: ['headings', 'headers'], + function: function (e, n) { + var t = 'h' + Number(e.config.level || 1); + e.tokens.every(function (e) { + return ( + 'heading_open' !== e.type || (r(n, e.lineNumber, t, e.tag), !1) + ); + }); + }, + }; + }, + 4625: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.filterTokens, + a = r.headingStyleFor; + e.exports = { + names: ['MD003', 'heading-style', 'header-style'], + description: 'Heading style', + tags: ['headings', 'headers'], + function: function (e, n) { + var t = String(e.config.style || 'consistent'); + o(e, 'heading_open', function (e) { + var r = a(e); + if (('consistent' === t && (t = r), r !== t)) { + var o = /h[12]/.test(e.tag); + if ( + !( + ('setext_with_atx' === t && + ((o && 'setext' === r) || (!o && 'atx' === r))) || + ('setext_with_atx_closed' === t && + ((o && 'setext' === r) || (!o && 'atx_closed' === r))) + ) + ) { + var s = t; + 'setext_with_atx' === t + ? (s = o ? 'setext' : 'atx') + : 'setext_with_atx_closed' === t && + (s = o ? 'setext' : 'atx_closed'), + i(n, e.lineNumber, s, r); + } + } + }); + }, + }; + }, + 1648: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.listItemMarkerRe, + a = r.unorderedListStyleFor, + s = t(7754).flattenedLists, + l = { dash: '-', plus: '+', asterisk: '*' }, + u = { dash: 'plus', plus: 'asterisk', asterisk: 'dash' }, + c = Object.keys(l); + e.exports = { + names: ['MD004', 'ul-style'], + description: 'Unordered list style', + tags: ['bullet', 'ul'], + function: function (e, n) { + var t = String(e.config.style || 'consistent'), + r = t, + f = []; + s().forEach(function (e) { + e.unordered && + ('consistent' === r && (r = a(e.items[0])), + e.items.forEach(function (s) { + var d = a(s); + if ('sublist' === t) { + var p = e.nesting; + f[p] || (f[p] = d === f[p - 1] ? u[d] : d), (r = f[p]); + } + c.includes(r) || (r = c[0]); + var m = null, + h = null, + g = s.line.match(o); + g && + ((m = [g.index + 1, g[0].length]), + (h = { + editColumn: g[1].length + 1, + deleteCount: 1, + insertText: l[r], + })), + i(n, s.lineNumber, r, d, null, null, m, h); + })); + }); + }, + }; + }, + 4306: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addError, + o = r.addErrorDetailIf, + a = r.indentFor, + s = r.listItemMarkerRe, + l = r.orderedListItemMarkerRe, + u = r.rangeFromRegExp, + c = t(7754).flattenedLists; + e.exports = { + names: ['MD005', 'list-indent'], + description: + 'Inconsistent indentation for list items at the same level', + tags: ['bullet', 'ul', 'indentation'], + function: function (e, n) { + c().forEach(function (e) { + var t = e.indent, + r = 0, + c = -1, + f = !1; + e.items.forEach(function (d) { + var p = d.line, + m = d.lineNumber, + h = a(d), + g = null; + if (e.unordered) o(n, m, t, h, null, null, u(p, s)); + else if ((g = l.exec(p))) { + (c = g[0].length), (r = r || c); + var v = g[1].length + 1; + if (t !== h || f) + if (r === c) f = !0; + else { + var x = f ? r - v : t, + b = f ? c - v : h; + i( + n, + m, + f + ? 'Expected: (' + r + '); Actual: (' + c + ')' + : 'Expected: ' + t + '; Actual: ' + h, + null, + u(p, s), + { + editColumn: Math.min(b, x) + 1, + deleteCount: Math.max(b - x, 0), + insertText: ''.padEnd(Math.max(x - b, 0)), + }, + ); + } + } + }); + }); + }, + }; + }, + 8294: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.listItemMarkerRe, + a = r.rangeFromRegExp, + s = t(7754).flattenedLists; + e.exports = { + names: ['MD006', 'ul-start-left'], + description: + 'Consider starting bulleted lists at the beginning of the line', + tags: ['bullet', 'ul', 'indentation'], + function: function (e, n) { + s().forEach(function (e) { + e.unordered && + !e.nesting && + 0 !== e.indent && + e.items.forEach(function (t) { + var r = t.lineNumber, + s = t.line; + i(n, r, 0, e.indent, null, null, a(s, o), { + deleteCount: s.length - s.trimStart().length, + }); + }); + }); + }, + }; + }, + 7378: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.indentFor, + a = r.listItemMarkerRe, + s = t(7754).flattenedLists; + e.exports = { + names: ['MD007', 'ul-indent'], + description: 'Unordered list indentation', + tags: ['bullet', 'ul', 'indentation'], + function: function (e, n) { + var t = Number(e.config.indent || 2), + r = !!e.config.start_indented; + s().forEach(function (e) { + e.unordered && + e.parentsUnordered && + e.items.forEach(function (s) { + var l = s.lineNumber, + u = s.line, + c = (e.nesting + (r ? 1 : 0)) * t, + f = o(s), + d = null, + p = 1, + m = u.match(a); + m && ((d = [1, m[0].length]), (p += m[1].length - f)), + i(n, l, c, f, null, null, d, { + editColumn: p, + deleteCount: f, + insertText: ''.padEnd(c), + }); + }); + }); + }, + }; + }, + 8984: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addError, + o = r.filterTokens, + a = r.forEachInlineCodeSpan, + s = r.forEachLine, + l = r.includesSorted, + u = r.newLineRe, + c = r.numericSortAscending, + f = t(7754).lineMetadata; + e.exports = { + names: ['MD009', 'no-trailing-spaces'], + description: 'Trailing spaces', + tags: ['whitespace'], + function: function (e, n) { + var t = e.config.br_spaces; + t = Number(void 0 === t ? 2 : t); + var r = !!e.config.list_item_empty_lines, + d = !!e.config.strict, + p = []; + r && + (o(e, 'list_item_open', function (e) { + for (var n = e.map[0]; n < e.map[1]; n++) p.push(n + 1); + }), + p.sort(c)); + var m = [], + h = []; + d && + (o(e, 'paragraph_open', function (e) { + for (var n = e.map[0]; n < e.map[1] - 1; n++) m.push(n + 1); + }), + m.sort(c), + o(e, 'inline', function (n) { + if ( + n.children.some(function (e) { + return 'code_inline' === e.type; + }) + ) { + var t = e.lines.slice(n.map[0], n.map[1]); + a(t.join('\n'), function (e, t) { + for (var r = e.split(u).length, i = 0; i < r; i++) + h.push(n.lineNumber + t + i); + }); + } + }), + h.sort(c)); + var g = t < 2 ? 0 : t; + s(f(), function (e, t, r) { + var o = t + 1, + a = e.length - e.trimEnd().length; + if ( + a && + !r && + !l(p, o) && + (g !== a || (d && (!l(m, o) || l(h, o)))) + ) { + var s = e.length - a + 1; + i( + n, + o, + 'Expected: ' + + (0 === g ? '' : '0 or ') + + g + + '; Actual: ' + + a, + null, + [s, a], + { editColumn: s, deleteCount: a }, + ); + } + }); + }, + }; + }, + 9124: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addError, + o = r.forEachLine, + a = t(7754).lineMetadata, + s = /\t+/g; + e.exports = { + names: ['MD010', 'no-hard-tabs'], + description: 'Hard tabs', + tags: ['whitespace', 'hard_tab'], + function: function (e, n) { + var t = e.config.code_blocks, + r = void 0 === t || !!t; + o(a(), function (e, t, o) { + if (!o || r) + for (var a = null; null !== (a = s.exec(e)); ) { + var l = a.index + 1, + u = a[0].length; + i(n, t + 1, 'Column: ' + l, null, [l, u], { + editColumn: l, + deleteCount: u, + insertText: ''.padEnd(u), + }); + } + }); + }, + }; + }, + 373: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addError, + o = r.forEachInlineChild, + a = r.unescapeMarkdown, + s = /\(([^)]+)\)\[([^\]^][^\]]*)]/g; + e.exports = { + names: ['MD011', 'no-reversed-links'], + description: 'Reversed link syntax', + tags: ['links'], + function: function (e, n) { + o(e, 'text', function (t) { + for ( + var r = t.lineNumber, o = t.content, l = null; + null !== (l = s.exec(o)); + + ) { + var u = l[0], + c = l[1], + f = l[2], + d = e.lines[r - 1], + p = a(d).indexOf(u) + 1, + m = u.length; + i( + n, + r, + u, + null, + p ? [p, m] : null, + p + ? { + editColumn: p, + deleteCount: m, + insertText: '[' + c + '](' + f + ')', + } + : null, + ); + } + }); + }, + }; + }, + 8298: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.forEachLine, + a = t(7754).lineMetadata; + e.exports = { + names: ['MD012', 'no-multiple-blanks'], + description: 'Multiple consecutive blank lines', + tags: ['whitespace', 'blank_lines'], + function: function (e, n) { + var t = Number(e.config.maximum || 1), + r = 0; + o(a(), function (e, o, a) { + (r = a || e.trim().length > 0 ? 0 : r + 1), + t < r && + i(n, o + 1, t, r, null, null, null, { deleteCount: -1 }); + }); + }, + }; + }, + 5402: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.filterTokens, + a = r.forEachHeading, + s = r.forEachLine, + l = r.includesSorted, + u = t(7754).lineMetadata, + c = '^.{', + f = /^\s*\[.*[^\\]]:/, + d = /^[es]*(lT?L|I)[ES]*$/, + p = /^([#>\s]*\s)?\S*$/, + m = { + em_open: 'e', + em_close: 'E', + image: 'I', + link_open: 'l', + link_close: 'L', + strong_open: 's', + strong_close: 'S', + text: 'T', + }; + e.exports = { + names: ['MD013', 'line-length'], + description: 'Line length', + tags: ['line_length'], + function: function (e, n) { + var t = Number(e.config.line_length || 80), + r = Number(e.config.heading_line_length || t), + h = Number(e.config.code_block_line_length || t), + g = !!e.config.strict, + v = !!e.config.stern, + x = g || v ? '}.+$' : '}.*\\s.*$', + b = new RegExp(c + t + x), + E = new RegExp(c + r + x), + k = new RegExp(c + h + x), + y = e.config.code_blocks, + C = void 0 === y || !!y, + _ = e.config.tables, + N = void 0 === _ || !!_, + w = e.config.headings; + void 0 === w && (w = e.config.headers); + var M = void 0 === w || !!w, + D = []; + a(e, function (e) { + D.push(e.lineNumber); + }); + var L = []; + o(e, 'inline', function (e) { + var n = ''; + e.children.forEach(function (e) { + ('text' === e.type && '' === e.content) || + (n += m[e.type] || 'x'); + }), + d.test(n) && L.push(e.lineNumber); + }), + s(u(), function (e, o, a, s, u) { + var c = o + 1, + d = l(D, c), + m = a ? h : d ? r : t, + x = a ? k : d ? E : b; + (!C && a) || + (!N && u) || + (!M && d) || + (!g && ((v && p.test(e)) || l(L, c) || f.test(e))) || + !x.test(e) || + i(n, c, m, e.length, null, null, [m + 1, e.length - m]); + }); + }, + }; + }, + 4509: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens, + a = /^(\s*)(\$\s+)/; + e.exports = { + names: ['MD014', 'commands-show-output'], + description: + 'Dollar signs used before commands without showing output', + tags: ['code'], + function: function (e, n) { + ['code_block', 'fence'].forEach(function (t) { + o(e, t, function (t) { + for ( + var r = 'fence' === t.type ? 1 : 0, + o = [], + s = !0, + l = t.map[0] + r; + l < t.map[1] - r; + l++ + ) { + var u = e.lines[l], + c = u.trim(); + if (c) { + var f = a.exec(u); + if (f) { + var d = f[1].length + 1, + p = f[2].length; + o.push([l, c, d, p]); + } else s = !1; + } + } + s && + o.forEach(function (e) { + var t = e[0], + r = e[1], + o = e[2], + a = e[3]; + i(n, t + 1, r, null, null, [o, a], { + editColumn: o, + deleteCount: a, + }); + }); + }); + }); + }, + }; + }, + 4825: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.forEachLine, + a = t(7754).lineMetadata; + e.exports = { + names: ['MD018', 'no-missing-space-atx'], + description: 'No space after hash on atx style heading', + tags: ['headings', 'headers', 'atx', 'spaces'], + function: function (e, n) { + o(a(), function (e, t, r) { + if ( + !r && + /^#+[^# \t]/.test(e) && + !/#\s*$/.test(e) && + !e.startsWith('#️⃣') + ) { + var o = /^#+/.exec(e)[0].length; + i(n, t + 1, e.trim(), null, null, [1, o + 1], { + editColumn: o + 1, + insertText: ' ', + }); + } + }); + }, + }; + }, + 2138: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens, + a = r.headingStyleFor; + e.exports = { + names: ['MD019', 'no-multiple-space-atx'], + description: 'Multiple spaces after hash on atx style heading', + tags: ['headings', 'headers', 'atx', 'spaces'], + function: function (e, n) { + o(e, 'heading_open', function (e) { + if ('atx' === a(e)) { + var t = e.line, + r = e.lineNumber, + o = /^(#+)([ \t]{2,})(?:\S)/.exec(t); + if (o) { + var s = o[1].length, + l = o[2].length; + i(n, r, t.trim(), null, null, [1, s + l + 1], { + editColumn: s + 1, + deleteCount: l - 1, + }); + } + } + }); + }, + }; + }, + 7786: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.forEachLine, + a = t(7754).lineMetadata; + e.exports = { + names: ['MD020', 'no-missing-space-closed-atx'], + description: 'No space inside hashes on closed atx style heading', + tags: ['headings', 'headers', 'atx_closed', 'spaces'], + function: function (e, n) { + o(a(), function (e, t, r) { + if (!r) { + var o = + /^(#+)([ \t]*)([^#]*?[^#\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec( + e, + ); + if (o) { + var a = o[1], + s = o[2].length, + l = o[3], + u = o[4].length, + c = o[5], + f = o[6], + d = o[7].length, + p = a.length, + m = f.length, + h = !s, + g = !u || c, + v = c ? c + ' ' : ''; + if (h || g) { + var x = h ? [1, p + 1] : [e.length - d - m, m + 1]; + i(n, t + 1, e.trim(), h, g, x, { + editColumn: 1, + deleteCount: e.length, + insertText: a + ' ' + l + ' ' + v + f, + }); + } + } + } + }); + }, + }; + }, + 9435: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens, + a = r.headingStyleFor; + e.exports = { + names: ['MD021', 'no-multiple-space-closed-atx'], + description: + 'Multiple spaces inside hashes on closed atx style heading', + tags: ['headings', 'headers', 'atx_closed', 'spaces'], + function: function (e, n) { + o(e, 'heading_open', function (e) { + if ('atx_closed' === a(e)) { + var t = e.line, + r = e.lineNumber, + o = /^(#+)([ \t]+)([^#]+?)([ \t]+)(#+)(\s*)$/.exec(t); + if (o) { + var s = o[1], + l = o[2].length, + u = o[3], + c = o[4].length, + f = o[5], + d = o[6].length, + p = l > 1, + m = c > 1; + if (p || m) { + var h = t.length, + g = s.length, + v = f.length, + x = p ? [1, g + l + 1] : [h - d - v - c, c + v + 1]; + i(n, r, t.trim(), p, m, x, { + editColumn: 1, + deleteCount: h, + insertText: s + ' ' + u + ' ' + f, + }); + } + } + } + }); + }, + }; + }, + 6354: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.filterTokens, + a = r.isBlankLine; + e.exports = { + names: ['MD022', 'blanks-around-headings', 'blanks-around-headers'], + description: 'Headings should be surrounded by blank lines', + tags: ['headings', 'headers', 'blank_lines'], + function: function (e, n) { + var t = e.config.lines_above; + t = Number(void 0 === t ? 1 : t); + var r = e.config.lines_below; + r = Number(void 0 === r ? 1 : r); + var s = e.lines; + o(e, 'heading_open', function (e) { + for (var o = e.map, l = o[0], u = o[1], c = 0, f = 0; f < t; f++) + a(s[l - f - 1]) && c++; + i(n, l + 1, t, c, 'Above', s[l].trim(), null, { + insertText: ''.padEnd(t - c, '\n'), + }); + var d = 0; + for (f = 0; f < r; f++) a(s[u + f]) && d++; + i(n, l + 1, r, d, 'Below', s[l].trim(), null, { + lineNumber: u + 1, + insertText: ''.padEnd(r - d, '\n'), + }); + }); + }, + }; + }, + 3851: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens, + a = /^((?:\s+)|(?:[>\s]+\s\s))[^>\s]/; + e.exports = { + names: ['MD023', 'heading-start-left', 'header-start-left'], + description: 'Headings must start at the beginning of the line', + tags: ['headings', 'headers', 'spaces'], + function: function (e, n) { + o(e, 'heading_open', function (e) { + var t = e.lineNumber, + r = e.line, + o = r.match(a); + if (o) { + var s = o[0], + l = o[1], + u = l.length, + c = l.trimEnd().length; + c && (u -= c - 1), + i(n, t, r, null, null, [1, s.length], { + editColumn: c + 1, + deleteCount: u, + }); + } + }); + }, + }; + }, + 7507: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.forEachHeading; + e.exports = { + names: ['MD024', 'no-duplicate-heading', 'no-duplicate-header'], + description: 'Multiple headings with the same content', + tags: ['headings', 'headers'], + function: function (e, n) { + var t = + !!e.config.siblings_only || + !!e.config.allow_different_nesting || + !1, + r = [null, []], + a = 1, + s = r[a]; + o(e, function (e, o) { + if (t) { + for (var l = e.tag.slice(1); a < l; ) a++, (r[a] = []); + for (; a > l; ) (r[a] = []), a--; + s = r[l]; + } + s.includes(o) ? i(n, e.lineNumber, e.line.trim()) : s.push(o); + }); + }, + }; + }, + 8434: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens, + a = r.frontMatterHasTitle; + e.exports = { + names: ['MD025', 'single-title', 'single-h1'], + description: 'Multiple top-level headings in the same document', + tags: ['headings', 'headers'], + function: function (e, n) { + var t = 'h' + Number(e.config.level || 1), + r = a(e.frontMatterLines, e.config.front_matter_title), + s = !1; + o(e, 'heading_open', function (e) { + e.tag === t && + (s || r + ? i(n, e.lineNumber, e.line.trim()) + : 1 === e.lineNumber && (s = !0)); + }); + }, + }; + }, + 134: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addError, + o = r.allPunctuationNoQuestion, + a = r.escapeForRegExp, + s = r.forEachHeading, + l = /&#?[0-9a-zA-Z]+;$/; + e.exports = { + names: ['MD026', 'no-trailing-punctuation'], + description: 'Trailing punctuation in heading', + tags: ['headings', 'headers'], + function: function (e, n) { + var t = e.config.punctuation; + t = String(void 0 === t ? o : t); + var r = new RegExp('\\s*[' + a(t) + ']+$'); + s(e, function (e) { + var t = e.line, + o = e.lineNumber, + a = t.replace(/[\s#]*$/, ''), + s = r.exec(a); + if (s && !l.test(a)) { + var u = s[0], + c = s.index + 1, + f = u.length; + i(n, o, "Punctuation: '" + u + "'", null, [c, f], { + editColumn: c, + deleteCount: f, + }); + } + }); + }, + }; + }, + 947: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.newLineRe, + a = /^((?:\s*>)+)(\s{2,})\S/; + e.exports = { + names: ['MD027', 'no-multiple-space-blockquote'], + description: 'Multiple spaces after blockquote symbol', + tags: ['blockquote', 'whitespace', 'indentation'], + function: function (e, n) { + var t = 0, + r = 0; + e.tokens.forEach(function (s) { + var l = s.content, + u = s.lineNumber, + c = s.type; + if ('blockquote_open' === c) t++; + else if ('blockquote_close' === c) t--; + else if ('list_item_open' === c) r++; + else if ('list_item_close' === c) r--; + else if ('inline' === c && t) + for (var f = l.split(o).length, d = 0; d < f; d++) { + var p = e.lines[u + d - 1], + m = p.match(a); + if (m) { + var h = m[0], + g = m[1].length, + v = m[2].length; + (r && '>' !== h[h.length - 1]) || + i(n, u + d, p, null, null, [1, h.length], { + editColumn: g + 1, + deleteCount: v - 1, + }); + } + } + }); + }, + }; + }, + 3753: (e, n, t) => { + 'use strict'; + var r = t(3079).addError; + e.exports = { + names: ['MD028', 'no-blanks-blockquote'], + description: 'Blank line inside blockquote', + tags: ['blockquote', 'whitespace'], + function: function (e, n) { + var t = {}, + i = null; + e.tokens.forEach(function (e) { + if ('blockquote_open' === e.type && 'blockquote_close' === t.type) + for (var o = i; o < e.lineNumber; o++) r(n, o); + (t = e), 'blockquote_open' === e.type && (i = e.map[1] + 1); + }); + }, + }; + }, + 358: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.listItemMarkerRe, + a = r.orderedListItemMarkerRe, + s = r.rangeFromRegExp, + l = t(7754).flattenedLists, + u = { one: '1/1/1', ordered: '1/2/3', zero: '0/0/0' }; + e.exports = { + names: ['MD029', 'ol-prefix'], + description: 'Ordered list item prefix', + tags: ['ol'], + function: function (e, n) { + var t = String(e.config.style || 'one_or_ordered'); + l() + .filter(function (e) { + return !e.unordered; + }) + .forEach(function (e) { + var r = e.items, + l = 1, + c = !1; + if (r.length >= 2) { + var f = a.exec(r[0].line), + d = a.exec(r[1].line); + if (f && d) { + var p = f[1]; + ('1' === d[1] && '0' !== p) || + ((c = !0), '0' === p && (l = 0)); + } + } + var m = t; + 'one_or_ordered' === m && (m = c ? 'ordered' : 'one'), + 'zero' === m ? (l = 0) : 'one' === m && (l = 1), + r.forEach(function (e) { + var t = a.exec(e.line); + t && + (i( + n, + e.lineNumber, + String(l), + t[1], + 'Style: ' + u[m], + null, + s(e.line, o), + ), + 'ordered' === m && l++); + }); + }); + }, + }; + }, + 8016: (e, n, t) => { + 'use strict'; + var r = t(3079).addErrorDetailIf, + i = t(7754).flattenedLists; + e.exports = { + names: ['MD030', 'list-marker-space'], + description: 'Spaces after list markers', + tags: ['ol', 'ul', 'whitespace'], + function: function (e, n) { + var t = Number(e.config.ul_single || 1), + o = Number(e.config.ol_single || 1), + a = Number(e.config.ul_multi || 1), + s = Number(e.config.ol_multi || 1); + i().forEach(function (e) { + var i = e.lastLineIndex - e.open.map[0] === e.items.length, + l = e.unordered ? (i ? t : a) : i ? o : s; + e.items.forEach(function (e) { + var t = e.line, + i = e.lineNumber, + o = /^[\s>]*\S+(\s*)/.exec(t), + a = o[0].length, + s = o[1].length; + if (a < t.length) { + var u = null; + l !== s && + (u = { + editColumn: a - s + 1, + deleteCount: s, + insertText: ''.padEnd(l), + }), + r(n, i, l, s, null, null, [1, a], u); + } + }); + }); + }, + }; + }, + 9192: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.forEachLine, + a = r.isBlankLine, + s = t(7754).lineMetadata, + l = /^(.*?)\s*[`~]/; + e.exports = { + names: ['MD031', 'blanks-around-fences'], + description: 'Fenced code blocks should be surrounded by blank lines', + tags: ['code', 'blank_lines'], + function: function (e, n) { + var t = e.config.list_items, + r = void 0 === t || !!t, + u = e.lines; + o(s(), function (e, t, o, s, c, f) { + var d = s > 0, + p = s < 0; + if ((r || !f) && ((d && !a(u[t - 1])) || (p && !a(u[t + 1])))) { + var m = (e.match(l) || [])[1], + h = + void 0 === m + ? null + : { lineNumber: t + (d ? 1 : 2), insertText: m + '\n' }; + i(n, t + 1, u[t].trim(), null, null, null, h); + } + }); + }, + }; + }, + 1067: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.isBlankLine, + a = t(7754).flattenedLists, + s = /^[>\s]*/; + e.exports = { + names: ['MD032', 'blanks-around-lists'], + description: 'Lists should be surrounded by blank lines', + tags: ['bullet', 'ul', 'ol', 'blank_lines'], + function: function (e, n) { + var t = e.lines; + a() + .filter(function (e) { + return !e.nesting; + }) + .forEach(function (e) { + var r = e.open.map[0]; + if (!o(t[r - 1])) { + var a = (l = t[r]).match(s)[0].trimEnd(); + i(n, r + 1, l.trim(), null, null, null, { + insertText: a + '\n', + }); + } + var l, + u = e.lastLineIndex - 1; + o(t[u + 1]) || + ((a = (l = t[u]).match(s)[0].trimEnd()), + i(n, u + 1, l.trim(), null, null, null, { + lineNumber: u + 2, + insertText: a + '\n', + })); + }); + }, + }; + }, + 4745: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addError, + o = r.forEachLine, + a = r.unescapeMarkdown, + s = t(7754).lineMetadata, + l = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)\/?>/g, + u = /]\(\s*$/, + c = /^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/, + f = + /^[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])?)*$/; + e.exports = { + names: ['MD033', 'no-inline-html'], + description: 'Inline HTML', + tags: ['html'], + function: function (e, n) { + var t = e.config.allowed_elements; + (t = (t = Array.isArray(t) ? t : []).map(function (e) { + return e.toLowerCase(); + })), + o(s(), function (e, r, o) { + for (var s = null; !o && null !== (s = l.exec(e)); ) { + var d = s[0], + p = s[1], + m = s[2]; + if ( + !t.includes(m.toLowerCase()) && + !d.endsWith('\\>') && + !f.test(p) + ) { + var h = e.substring(0, s.index); + if (!u.test(h) && !c.test(h)) { + var g = a(h + '<', '_'); + !g.endsWith('_') && + (g + '`').match(/`/g).length % 2 && + i(n, r + 1, 'Element: ' + m, null, [ + s.index + 1, + d.length, + ]); + } + } + } + }); + }, + }; + }, + 6090: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.bareUrlRe, + a = r.filterTokens; + e.exports = { + names: ['MD034', 'no-bare-urls'], + description: 'Bare URL used', + tags: ['links', 'url'], + function: function (e, n) { + a(e, 'inline', function (e) { + var t = !1; + e.children.forEach(function (e) { + var r = e.content, + a = e.line, + s = e.lineNumber, + l = e.type, + u = null; + if ('link_open' === l) t = !0; + else if ('link_close' === l) t = !1; + else if ('text' === l && !t) + for (; null !== (u = o.exec(r)); ) { + var c = u[0], + f = u.index, + d = c.length, + p = r[f - 1], + m = r[f + d]; + if ( + !( + ('[' === p && ']' === m) || + ('"' === p && '"' === m) || + ("'" === p && "'" === m) + ) + ) { + var h = a.indexOf(r), + g = -1 === h ? null : [h + f + 1, d], + v = g + ? { + editColumn: g[0], + deleteCount: g[1], + insertText: '<' + c + '>', + } + : null; + i(n, s, c, null, null, g, v); + } + } + }); + }); + }, + }; + }, + 614: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.filterTokens; + e.exports = { + names: ['MD035', 'hr-style'], + description: 'Horizontal rule style', + tags: ['hr'], + function: function (e, n) { + var t = String(e.config.style || 'consistent'); + o(e, 'hr', function (e) { + var r = e.line.trim(); + 'consistent' === t && (t = r), i(n, e.lineNumber, t, r); + }); + }, + }; + }, + 4335: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.allPunctuation; + e.exports = { + names: ['MD036', 'no-emphasis-as-heading', 'no-emphasis-as-header'], + description: 'Emphasis used instead of a heading', + tags: ['headings', 'headers', 'emphasis'], + function: function (e, n) { + var t = e.config.punctuation; + t = String(void 0 === t ? o : t); + var r = new RegExp('[' + t + ']$'), + a = function e(t) { + return 'paragraph_open' === t.type + ? function (t) { + var o = t.children.filter(function (e) { + return 'text' !== e.type || '' !== e.content; + }); + return ( + 3 !== o.length || + ('strong_open' !== o[0].type && + 'em_open' !== o[0].type) || + 'text' !== o[1].type || + r.test(o[1].content) || + i(n, t.lineNumber, o[1].content), + e + ); + } + : 'blockquote_open' === t.type + ? function n(t) { + return 'blockquote_close' !== t.type ? n : e; + } + : 'list_item_open' === t.type + ? function n(t) { + return 'list_item_close' !== t.type ? n : e; + } + : e; + }; + e.tokens.forEach(function (e) { + a = a(e); + }); + }, + }; + }, + 3409: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.emphasisMarkersInContent, + a = r.forEachLine, + s = r.isBlankLine, + l = t(7754).lineMetadata, + u = /(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g, + c = /^([\s>]*)\*(\s+)/, + f = /^\s+/, + d = /\s+$/, + p = /\|/; + e.exports = { + names: ['MD037', 'no-space-in-emphasis'], + description: 'Spaces inside emphasis markers', + tags: ['whitespace', 'emphasis'], + function: function (e, n) { + var t, + r, + m, + h, + g = null; + function v() { + (r = -1), (h = 0), (m = ''), (t = 0), (g = null); + } + function x(e, t, i, o, a, s) { + var l = e.substring(r, a); + h || (l = l.trimStart()), o || (l = l.trimEnd()); + var u = f.test(l), + c = d.test(l); + if ((u || c) && (!s || !p.test(l))) { + var m = r - h, + g = a + i, + v = e.substring(m, g), + x = m + 1, + b = g - m, + E = e.substring(m, r), + k = o ? o[2] || o[3] : '', + y = '' + E + l.trim() + k; + return [ + n, + t + 1, + v, + u, + c, + [x, b], + { editColumn: x, deleteCount: b, insertText: y }, + ]; + } + return null; + } + var b = o(e); + v(), + a(l(), function (e, n, o, a, l, f, d, p) { + var E = 1 === f; + if (((o || l || d || E || s(e)) && v(), !(o || d || p))) { + E && (e = e.replace(c, '$1 $2')); + for (var k = null; (k = u.exec(e)); ) { + var y = b[n] || [], + C = k.index + k[1].length; + if (!y.includes(C)) { + var _ = k[0].length - k[1].length, + N = (k[2] || k[3])[0]; + if (-1 === r) (r = C + _), (h = _), (m = N), (t = _); + else if (N === m) { + if (_ === t) { + g && (i.apply(void 0, g), (g = null)); + var w = x(e, n, t, k, C, l); + w && i.apply(void 0, w), v(); + } else + 3 === _ ? (t = _ - t) : 3 === t ? (t -= _) : (t += _); + u.lastIndex > 1 && u.lastIndex--; + } else u.lastIndex > 1 && u.lastIndex--; + } + } + -1 !== r && + ((g = g || x(e, n, 0, null, e.length, l)), + (r = 0), + (h = 0)); + } + }); + }, + }; + }, + 3549: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens, + a = r.forEachInlineCodeSpan, + s = r.newLineRe, + l = /^\s([^`]|$)/, + u = /[^`]\s$/, + c = /^\s(?:\S.*\S|\S)\s$/; + e.exports = { + names: ['MD038', 'no-space-in-code'], + description: 'Spaces inside code span elements', + tags: ['whitespace', 'code'], + function: function (e, n) { + o(e, 'inline', function (t) { + if ( + t.children.some(function (e) { + return 'code_inline' === e.type; + }) + ) { + var r = e.lines.slice(t.map[0], t.map[1]); + a(r.join('\n'), function (e, o, a, f) { + var d = a - f, + p = e.length + 2 * f, + m = 0, + h = a, + g = e.length, + v = e.split(s), + x = l.test(e), + b = !x && u.test(e); + b && v.length > 1 && ((d = 0), (m = v.length - 1), (h = 0)); + var E = c.test(e); + if ((x || b) && !E) { + var k = v[m]; + v.length > 1 && ((p = k.length + f), (g = k.length)); + var y = r[o + m].substring(d, d + p), + C = k.trim(), + _ = + (C.startsWith('`') ? ' ' : '') + + C + + (C.endsWith('`') ? ' ' : ''); + i(n, t.lineNumber + o + m, y, x, b, [d + 1, p], { + editColumn: h + 1, + deleteCount: g, + insertText: _, + }); + } + }); + } + }); + }, + }; + }, + 5007: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens, + a = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/; + e.exports = { + names: ['MD039', 'no-space-in-links'], + description: 'Spaces inside link text', + tags: ['whitespace', 'links'], + function: function (e, n) { + o(e, 'inline', function (t) { + var r = t.children, + o = t.lineNumber, + s = !1, + l = '', + u = 0; + r.forEach(function (t) { + var r = t.content, + c = t.type; + if ('link_open' === c) (s = !0), (l = ''); + else if ('link_close' === c) { + s = !1; + var f = l.trimStart().length !== l.length, + d = l.trimEnd().length !== l.length; + if (f || d) { + var p = null, + m = null, + h = e.lines[o - 1].slice(u).match(a); + if (h) { + var g = h.index + u + 1, + v = h[0].length; + (p = [g, v]), + (m = { + editColumn: g + 1, + deleteCount: v - 2, + insertText: l.trim(), + }), + (u = g + v - 1); + } + i(n, o, '[' + l + ']', f, d, p, m); + } + } else + 'softbreak' === c || 'hardbreak' === c + ? (o++, (u = 0)) + : s && (l += r); + }); + }); + }, + }; + }, + 9021: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens; + e.exports = { + names: ['MD040', 'fenced-code-language'], + description: 'Fenced code blocks should have a language specified', + tags: ['code', 'language'], + function: function (e, n) { + o(e, 'fence', function (e) { + e.info.trim() || i(n, e.lineNumber, e.line); + }); + }, + }; + }, + 3186: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.frontMatterHasTitle; + e.exports = { + names: ['MD041', 'first-line-heading', 'first-line-h1'], + description: 'First line in a file should be a top-level heading', + tags: ['headings', 'headers'], + function: function (e, n) { + var t = Number(e.config.level || 1), + r = 'h' + t; + if (!o(e.frontMatterLines, e.config.front_matter_title)) { + var a = new RegExp('^]', 'i'); + e.tokens.every(function (e) { + var t = !1; + if ('html_block' === e.type) { + if (e.content.startsWith('\x3c!--')) return !0; + a.test(e.content) || (t = !0); + } else ('heading_open' === e.type && e.tag === r) || (t = !0); + return t && i(n, e.lineNumber, e.line), !1; + }); + } + }, + }; + }, + 7551: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.filterTokens, + a = r.rangeFromRegExp, + s = /\[[^\]]*](?:\((?:#?|(?:<>))\))/; + e.exports = { + names: ['MD042', 'no-empty-links'], + description: 'No empty links', + tags: ['links'], + function: function (e, n) { + o(e, 'inline', function (e) { + var t = !1, + r = '', + o = !1; + e.children.forEach(function (e) { + 'link_open' === e.type + ? ((t = !0), + (r = ''), + e.attrs.forEach(function (e) { + 'href' !== e[0] || (e[1] && '#' !== e[1]) || (o = !0); + })) + : 'link_close' === e.type + ? ((t = !1), + o && + (i( + n, + e.lineNumber, + '[' + r + ']()', + null, + null, + a(e.line, s), + ), + (o = !1))) + : t && (r += e.content); + }); + }); + }, + }; + }, + 2916: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorContext, + o = r.addErrorDetailIf, + a = r.forEachHeading; + e.exports = { + names: ['MD043', 'required-headings', 'required-headers'], + description: 'Required heading structure', + tags: ['headings', 'headers'], + function: function (e, n) { + var t = e.config.headings || e.config.headers; + if (Array.isArray(t)) { + var r = {}; + [1, 2, 3, 4, 5, 6].forEach(function (e) { + r['h' + e] = '######'.substr(-e); + }); + var s = 0, + l = !1, + u = !1, + c = !1, + f = function () { + return t[s++] || '[None]'; + }; + a(e, function (e, t) { + if (!u) { + c = !0; + var i = r[e.tag] + ' ' + t, + a = f(); + '*' === a + ? ((l = !0), f()) + : '+' === a + ? (l = !0) + : a.toLowerCase() === i.toLowerCase() + ? (l = !1) + : l + ? s-- + : (o(n, e.lineNumber, a, i), (u = !0)); + } + }), + !u && + s < t.length && + (c || + !t.every(function (e) { + return '*' === e; + })) && + i(n, e.lines.length, t[s]); + } + }, + }; + }, + 2741: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.bareUrlRe, + a = r.escapeForRegExp, + s = r.filterTokens, + l = r.forEachInlineChild, + u = r.newLineRe, + c = /^\W/, + f = /\W$/; + e.exports = { + names: ['MD044', 'proper-names'], + description: 'Proper names should have the correct capitalization', + tags: ['spelling'], + function: function (e, n) { + var t = e.config.names; + t = Array.isArray(t) ? t : []; + var r = e.config.code_blocks, + d = void 0 === r || !!r, + p = new Set(); + s(e, 'inline', function (e) { + var n = !1; + e.children.forEach(function (e) { + var t = e.info, + r = e.type; + 'link_open' === r && 'auto' === t + ? (n = !0) + : 'link_close' === r + ? (n = !1) + : 'text' === r && n && p.add(e); + }); + }), + t.forEach(function (r) { + var m = a(r), + h = c.test(r) ? '' : '\\S*\\b', + g = f.test(r) ? '' : '\\b\\S*', + v = new RegExp('(' + h + ')(' + m + ')(' + g + ')', 'gi'); + function x(a) { + if (!p.has(a)) { + var s = 'fence' === a.type ? 1 : 0; + a.content.split(u).forEach(function (l, u) { + for (var c = null; null !== (c = v.exec(l)); ) { + var f = c[0], + d = c[1], + p = c[2], + m = c[3]; + if (-1 === f.search(o)) { + var h = f + .replace(new RegExp('^\\W{0,' + d.length + '}'), '') + .replace( + new RegExp('\\W{0,' + m.length + '}$'), + '', + ); + if (!t.includes(h)) { + var g = a.lineNumber + u + s, + x = e.lines[g - 1], + b = h.length, + E = x.indexOf(h); + i( + n, + g, + r, + p, + null, + null, + -1 === E ? null : [E + 1, b], + -1 === E + ? null + : { + editColumn: E + 1, + deleteCount: b, + insertText: r, + }, + ); + } + } + } + }); + } + } + l(e, 'text', x), + d && + (l(e, 'code_inline', x), + s(e, 'code_block', x), + s(e, 'fence', x)); + }); + }, + }; + }, + 5191: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addError, + o = r.forEachInlineChild; + e.exports = { + names: ['MD045', 'no-alt-text'], + description: 'Images should have alternate text (alt text)', + tags: ['accessibility', 'images'], + function: function (e, n) { + o(e, 'image', function (e) { + '' === e.content && i(n, e.lineNumber); + }); + }, + }; + }, + 1309: (e, n, t) => { + 'use strict'; + var r = t(3079).addErrorDetailIf, + i = { fence: 'fenced', code_block: 'indented' }; + e.exports = { + names: ['MD046', 'code-block-style'], + description: 'Code block style', + tags: ['code'], + function: function (e, n) { + var t = String(e.config.style || 'consistent'); + e.tokens + .filter(function (e) { + return 'code_block' === e.type || 'fence' === e.type; + }) + .forEach(function (e) { + var o = e.lineNumber, + a = e.type; + 'consistent' === t && (t = i[a]), r(n, o, t, i[a]); + }); + }, + }; + }, + 5386: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addError, + o = r.isBlankLine; + e.exports = { + names: ['MD047', 'single-trailing-newline'], + description: 'Files should end with a single newline character', + tags: ['blank_lines'], + function: function (e, n) { + var t = e.lines.length, + r = e.lines[t - 1]; + o(r) || + i(n, t, null, null, [r.length, 1], { + insertText: '\n', + editColumn: r.length + 1, + }); + }, + }; + }, + 8616: (e, n, t) => { + 'use strict'; + var r = t(3079), + i = r.addErrorDetailIf, + o = r.fencedCodeBlockStyleFor; + e.exports = { + names: ['MD048', 'code-fence-style'], + description: 'Code fence style', + tags: ['code'], + function: function (e, n) { + var t = String(e.config.style || 'consistent'); + e.tokens + .filter(function (e) { + return 'fence' === e.type; + }) + .forEach(function (e) { + var r = e.lineNumber, + a = e.markup; + 'consistent' === t && (t = o(a)), i(n, r, t, o(a)); + }); + }, + }; + }, + 3966: (e, n, t) => { + 'use strict'; + var r = t(1500), + i = r.homepage, + o = r.version, + a = [ + t(1408), + t(7091), + t(4625), + t(1648), + t(4306), + t(8294), + t(7378), + t(8984), + t(9124), + t(373), + t(8298), + t(5402), + t(4509), + t(4825), + t(2138), + t(7786), + t(9435), + t(6354), + t(3851), + t(7507), + t(8434), + t(134), + t(947), + t(3753), + t(358), + t(8016), + t(9192), + t(1067), + t(4745), + t(6090), + t(614), + t(4335), + t(3409), + t(3549), + t(5007), + t(9021), + t(3186), + t(7551), + t(2916), + t(2741), + t(5191), + t(1309), + t(5386), + t(8616), + ]; + a.forEach(function (e) { + var n = e.names[0].toLowerCase(); + e.information = new URL(i + '/blob/v' + o + '/doc/Rules.md#' + n); + }), + (e.exports = a); + }, + 1500: (e) => { + 'use strict'; + e.exports = JSON.parse( + '{"name":"markdownlint","version":"0.23.1","description":"A Node.js style checker and lint tool for Markdown/CommonMark files.","main":"lib/markdownlint.js","types":"lib/markdownlint.d.ts","author":"David Anson (https://dlaa.me/)","license":"MIT","homepage":"https://github.com/DavidAnson/markdownlint","repository":{"type":"git","url":"https://github.com/DavidAnson/markdownlint.git"},"bugs":"https://github.com/DavidAnson/markdownlint/issues","scripts":{"build-config":"npm run build-config-schema && npm run build-config-example","build-config-example":"node schema/build-config-example.js","build-config-schema":"node schema/build-config-schema.js","build-declaration":"tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf \'lib/{c,md,r}*.d.ts\' \'helpers/*.d.ts\'","build-demo":"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats","build-example":"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2","ci":"npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code","clean-test-repos":"rimraf test-repos","clone-test-repos":"mkdir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet","clone-test-repos-large":"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet","declaration":"npm run build-declaration && npm run test-declaration","example":"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint","lint":"eslint --max-warnings 0 .","lint-test-repos":"ava --timeout=5m test/markdownlint-test-repos.js","test":"ava test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js","test-cover":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test","test-declaration":"cd example/typescript && tsc && node type-check.js","test-extra":"ava --timeout=5m test/markdownlint-test-extra.js"},"engines":{"node":">=10"},"dependencies":{"markdown-it":"12.0.4"},"devDependencies":{"ava":"~3.15.0","c8":"~7.5.0","cpy-cli":"~3.1.1","eslint":"~7.19.0","eslint-plugin-jsdoc":"~31.6.0","eslint-plugin-node":"~11.1.0","eslint-plugin-unicorn":"~27.0.0","globby":"~11.0.2","js-yaml":"~4.0.0","markdown-it-for-inline":"~0.1.1","markdown-it-sub":"~1.0.0","markdown-it-sup":"~1.0.0","markdown-it-texmath":"~0.8.0","markdownlint-rule-helpers":"~0.13.0","npm-run-all":"~4.1.5","rimraf":"~3.0.2","strip-json-comments":"~3.1.1","toml":"~3.0.0","ts-loader":"~8.0.15","tv4":"~1.3.0","typescript":"~4.1.3","webpack":"~5.21.1","webpack-cli":"~4.5.0"},"keywords":["markdown","lint","md","CommonMark","markdownlint"]}', + ); + }, + 4470: (e) => { + 'use strict'; + e.exports = markdownit; + }, + 2993: () => {}, + 4219: () => {}, + 1386: () => {}, + 1758: () => {}, + }, + n = {}; + function t(r) { + if (n[r]) return n[r].exports; + var i = (n[r] = { exports: {} }); + return e[r].call(i.exports, i, i.exports, t), i.exports; + } + return (t.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)), t(3411); +})(); diff --git a/app/javascript/article-form/articleForm.jsx b/app/javascript/article-form/articleForm.jsx index d6085498e..dff7b6191 100644 --- a/app/javascript/article-form/articleForm.jsx +++ b/app/javascript/article-form/articleForm.jsx @@ -6,6 +6,12 @@ import { KeyboardShortcuts } from '../shared/components/useKeyboardShortcuts'; import { submitArticle, previewArticle } from './actions'; import { EditorActions, Form, Header, Help, Preview } from './components'; import { Button, Modal } from '@crayons'; +import { + noDefaultAltTextRule, + noEmptyAltTextRule, + noLevelOneHeadingsRule, + headingIncrement, +} from '@utilities/markdown/markdownLintCustomRules'; /* global activateRunkitTags */ @@ -14,6 +20,26 @@ import { Button, Modal } from '@crayons'; editing are not used in this file, they are important to the editor. */ + +/** + * Settings for the markdownlint library we use to identify potential accessibility failings in posts + */ +const LINT_OPTIONS = { + customRules: [ + noDefaultAltTextRule, + noLevelOneHeadingsRule, + headingIncrement, + noEmptyAltTextRule, + ], + config: { + default: false, // disable all default rules + [noDefaultAltTextRule.names[0]]: true, + [noLevelOneHeadingsRule.names[0]]: true, + [headingIncrement.names[0]]: true, + [noEmptyAltTextRule.names[0]]: true, + }, +}; + export class ArticleForm extends Component { static handleGistPreview() { const els = document.getElementsByClassName('ltag_gist-liquid-tag'); @@ -99,6 +125,7 @@ export class ArticleForm extends Component { helpFor: null, helpPosition: null, isModalOpen: false, + markdownLintErrors: [], ...previousContentState, }; } @@ -160,7 +187,41 @@ export class ArticleForm extends Component { } }; + lintMarkdown = () => { + const options = { + ...LINT_OPTIONS, + strings: { + content: this.state.bodyMarkdown, + }, + }; + const { content: markdownLintErrors } = window.markdownlint.sync(options); + this.setState({ markdownLintErrors }); + }; + + fetchMarkdownLint = async () => { + if (!window.markdownlint) { + const markdownItScript = document.createElement('script'); + markdownItScript.setAttribute('src', '/assets/markdown-it.min.js'); + document.body.appendChild(markdownItScript); + + // The markdownlint script needs the first script to have finished loading first + markdownItScript.addEventListener('load', () => { + const markdownLintScript = document.createElement('script'); + markdownLintScript.setAttribute( + 'src', + '/assets/markdownlint-browser.min.js', + ); + document.body.appendChild(markdownLintScript); + + markdownLintScript.addEventListener('load', this.lintMarkdown); + }); + } else { + this.lintMarkdown(); + } + }; + showPreview = (response) => { + this.fetchMarkdownLint(); this.setState({ ...this.setCommonProps({ previewShowing: true }), previewResponse: response, @@ -303,6 +364,7 @@ export class ArticleForm extends Component { helpFor, helpPosition, siteLogo, + markdownLintErrors, } = this.state; return ( @@ -328,6 +390,7 @@ export class ArticleForm extends Component { previewResponse={previewResponse} articleState={this.state} errors={errors} + markdownLintErrors={markdownLintErrors} /> ) : (
( + +); + +const extractRelevantErrors = (lintErrors) => { + const imageErrors = []; + const otherErrors = []; + + lintErrors.forEach((lintError) => { + if ( + lintError.ruleNames.includes('no-default-alt-text') || + lintError.ruleNames.includes('no-empty-alt-text') + ) { + imageErrors.push({ ...lintError, errorType: 'image' }); + } else { + otherErrors.push({ ...lintError, errorType: 'other' }); + } + }); + + // Truncate the errors, favouring image errors (as these accessibility suggestions are more impactful) + if (imageErrors.length > MAX_SUGGESTIONS) { + imageErrors.length = MAX_SUGGESTIONS; + } + + const remainingErrors = MAX_SUGGESTIONS - imageErrors.length; + if (otherErrors.length > remainingErrors) { + otherErrors.length = remainingErrors; + } + + return [...imageErrors, ...otherErrors]; +}; + +/** + * An information notice displayed to users in the Preview window when accessibility improvements could be made to their post. + * This component displays a maximum of 3 suggestions, favouring image-related suggestions (as these changes are more impactful). + * + * @param {Object} props + * @param {Object[]} props.markdownLintErrors The array of error objects returned from the markdownlint library + * + * @example + * + */ +export const AccessibilitySuggestions = ({ markdownLintErrors }) => { + return ( +
+

+ Improve the accessibility of your post +

+
    + {extractRelevantErrors(markdownLintErrors).map((lintError, index) => { + return ( +
  • + {lintError.errorContext} + + {' '} + + Learn more + + +
  • + ); + })} +
+
+ ); +}; + +AccessibilitySuggestions.propTypes = { + markdownLintErrors: PropTypes.arrayOf( + PropTypes.shape({ + errorContext: PropTypes.string, + errorDetail: PropTypes.string, + ruleNames: PropTypes.arrayOf(PropTypes.string), + }), + ), +}; diff --git a/app/javascript/article-form/components/Preview.jsx b/app/javascript/article-form/components/Preview.jsx index 4ab930eb8..58a99bb09 100644 --- a/app/javascript/article-form/components/Preview.jsx +++ b/app/javascript/article-form/components/Preview.jsx @@ -2,8 +2,14 @@ import { h } from 'preact'; import PropTypes from 'prop-types'; import { useEffect } from 'preact/hooks'; import { ErrorList } from './ErrorList'; +import { AccessibilitySuggestions } from './AccessibilitySuggestions'; -function titleArea(previewResponse, articleState, errors) { +function titleArea({ + previewResponse, + articleState, + errors, + markdownLintErrors, +}) { const tagArray = previewResponse.tags || articleState.tagList.split(', '); let tags = ''; if (tagArray.length > 0 && tagArray[0].length > 0) { @@ -51,6 +57,9 @@ function titleArea(previewResponse, articleState, errors) { )}
{errors && } + {!errors && markdownLintErrors?.length > 0 && ( + + )}

{previewTitle}

@@ -68,7 +77,12 @@ const previewResponsePropTypes = PropTypes.shape({ cover_image: PropTypes.string, }); -export const Preview = ({ previewResponse, articleState, errors }) => { +export const Preview = ({ + previewResponse, + articleState, + errors, + markdownLintErrors, +}) => { useEffect(() => { if (previewResponse.processed_html.includes('twitter-timeline')) { attachTwitterTimelineScript(); @@ -78,7 +92,12 @@ export const Preview = ({ previewResponse, articleState, errors }) => { return (
- {titleArea(previewResponse, articleState, errors)} + {titleArea({ + previewResponse, + articleState, + errors, + markdownLintErrors, + })}
', () => { + it('should have no a11y violations', async () => { + const { container } = render( + , + ); + + const results = await axe(container); + expect(results).toHaveNoViolations(); + }); + + it('should display a list of maximum 3 suggestions', () => { + const lintErrors = [1, 2, 3, 4].map((item) => ({ + errorDetail: '/detailUrl', + ruleNames: ['no-empty-alt-text'], + errorContext: `Suggestion ${item}`, + })); + + const { getAllByRole, getByText, queryByText } = render( + , + ); + + const listItems = getAllByRole('listitem'); + expect(listItems).toHaveLength(3); + expect(getByText('Suggestion 1')).toBeInTheDocument(); + expect(getByText('Suggestion 2')).toBeInTheDocument(); + expect(getByText('Suggestion 3')).toBeInTheDocument(); + expect(queryByText('Suggestion 4')).not.toBeInTheDocument(); + + const detailLinks = getAllByRole('link', { + name: 'Learn more about accessible images', + }); + expect(detailLinks).toHaveLength(3); + }); + + it('should only show image errors if there are 3 or more', () => { + const imageErrors = [ + { + errorDetail: '/detailUrl', + ruleNames: ['no-empty-alt-text'], + errorContext: 'No empty alt text 1', + }, + { + errorDetail: '/detailUrl', + ruleNames: ['no-default-alt-text'], + errorContext: 'No default alt text 1', + }, + { + errorDetail: '/detailUrl', + ruleNames: ['no-empty-alt-text'], + errorContext: 'No empty alt text 2', + }, + ]; + + const otherErrors = [ + { + errorDetail: '/detailUrl', + ruleNames: ['other'], + errorContext: 'Other 1', + }, + { + errorDetail: '/detailUrl', + ruleNames: ['other'], + errorContext: 'Other 2', + }, + ]; + + const { getAllByRole, getByText, queryByText } = render( + , + ); + + const listItems = getAllByRole('listitem'); + expect(listItems).toHaveLength(3); + imageErrors.forEach((imageError) => { + expect(getByText(imageError.errorContext)).toBeInTheDocument(); + }); + + const imageDetailLinks = getAllByRole('link', { + name: 'Learn more about accessible images', + }); + expect(imageDetailLinks).toHaveLength(3); + + otherErrors.forEach((otherError) => { + expect(queryByText(otherError.errorContext)).not.toBeInTheDocument(); + }); + }); + + it('should show other errors if there are fewer than 3 image errors', () => { + const imageErrors = [ + { + errorDetail: '/detailUrl', + ruleNames: ['no-empty-alt-text'], + errorContext: 'No empty alt text 1', + }, + { + errorDetail: '/detailUrl', + ruleNames: ['no-default-alt-text'], + errorContext: 'No default alt text 1', + }, + ]; + + const otherErrors = [ + { + errorDetail: '/detailUrl', + ruleNames: ['other'], + errorContext: 'Other 1', + }, + { + errorDetail: '/detailUrl', + ruleNames: ['other'], + errorContext: 'Other 2', + }, + ]; + + const { getAllByRole, getByText, queryByText } = render( + , + ); + + const listItems = getAllByRole('listitem'); + expect(listItems).toHaveLength(3); + imageErrors.forEach((imageError) => { + expect(getByText(imageError.errorContext)).toBeInTheDocument(); + }); + + expect( + getAllByRole('link', { + name: 'Learn more about accessible images', + }), + ).toHaveLength(2); + + expect(getByText('Other 1')).toBeInTheDocument(); + expect(queryByText('Other 2')).not.toBeInTheDocument(); + + expect( + getAllByRole('link', { + name: 'Learn more about accessible headings', + }), + ).toHaveLength(1); + }); +}); diff --git a/app/javascript/utilities/markdown/markdownLintCustomRules.js b/app/javascript/utilities/markdown/markdownLintCustomRules.js new file mode 100644 index 000000000..5bbd1686a --- /dev/null +++ b/app/javascript/utilities/markdown/markdownLintCustomRules.js @@ -0,0 +1,146 @@ +/** + * Helper function for the image markdown lint rules. + * + * It takes a full line of text which includes an image with empty or default alt text (i.e. format "![]()") and returns the image portion only. + * This allows us to point users towards the exact image markdown text that triggered the rule. + * + * @param {string} contentLine The full line of content as provided by markdownlint + * @returns {string} a substring containing only the image text - e.g. "![alt text]()" + */ +const getImageTextString = (contentLine) => { + let indexOfImageStart = contentLine.indexOf('!'); + while (contentLine.charAt(indexOfImageStart + 1) !== '[') { + // It's possible for an image to be inserted on a line with text preceding it, + // this check helps ensure that the '!' is actually the image start + indexOfImageStart = contentLine.indexOf('!', indexOfImageStart + 1); + if (indexOfImageStart === -1) { + return; + } + } + // Find the next closing bracket from the image start + // We don't need to worry about brackets inside the alt text as this check is only run on images with default or no alt text + const indexOfImageEnd = contentLine.indexOf(')', indexOfImageStart); + return contentLine.substring(indexOfImageStart, indexOfImageEnd + 1); +}; + +/** + * Custom markdown lint rule that detects if a user has uploaded an image, but not changed the default alt text + */ +export const noDefaultAltTextRule = { + names: ['no-default-alt-text'], + description: 'Images should not have the default alt text', + tags: ['images'], + function: (params, onError) => { + params.tokens + .filter((token) => token.type === 'inline') + .forEach(({ children }) => { + children.forEach((contentChild) => { + if ( + contentChild.type === 'image' && + contentChild.line.toLowerCase().includes('![alt text]') + ) { + onError({ + lineNumber: contentChild.lineNumber, + detail: '/p/editor_guide#alt-text-for-images', + context: `Consider replacing the 'alt text' in square brackets at ${getImageTextString( + contentChild.line, + )} with a description of the image`, + }); + } + }); + }); + }, +}; + +/** + * A custom rule that mirrors the default "no-alt-text" rule, but with a more helpful error message + */ +export const noEmptyAltTextRule = { + names: ['no-empty-alt-text'], + description: 'Images should not have empty alt text', + tags: ['images'], + function: (params, onError) => { + params.tokens + .filter((token) => token.type === 'inline') + .forEach((inlineToken) => { + inlineToken.children.forEach((contentChild) => { + if ( + contentChild.type === 'image' && + contentChild.line.toLowerCase().includes('![]') + ) { + onError({ + lineNumber: inlineToken.lineNumber, + detail: '/p/editor_guide#alt-text-for-images', + context: `Consider adding an image description in the square brackets at ${getImageTextString( + contentChild.line, + )}`, + }); + } + }); + }); + }, +}; + +/** + * Custom markdown lint rule that detects if a level one heading has been used in a post + */ +export const noLevelOneHeadingsRule = { + names: ['no-level-one-heading'], + description: 'Heading level one should not be used in posts', + tags: ['headings'], + function: (params, onError) => { + const levelOneHeadings = []; + params.tokens.filter((token, index) => { + const isHeadingOneStart = + token.type === 'heading_open' && token.tag === 'h1'; + if (isHeadingOneStart) { + // The next token is the actual content of the heading + levelOneHeadings.push(params.tokens[index + 1]); + } + }); + + levelOneHeadings.forEach((heading) => { + onError({ + lineNumber: heading.lineNumber, + context: `Consider changing "${heading.line}" to a level two heading by using "##"`, + detail: '/p/editor_guide#accessible-headings', + }); + }); + }, +}; + +/** + * A custom rule that mirrors the default "heading-increment" rule, but with a more helpful error message + */ +export const headingIncrement = { + names: ['custom-heading-increment'], + description: 'Heading levels should only increment by one level at a time', + tags: ['headings', 'headers'], + function: (params, onError) => { + let prevLevel = 0; + + const headings = params.tokens.filter( + (token) => token.type === 'heading_open', + ); + headings.forEach((heading) => { + const level = Number.parseInt(heading.tag.slice(1), 10); + if (prevLevel && level > prevLevel) { + // Heading level has increased + const suggestedHeadingLevel = prevLevel + 1; + + if (suggestedHeadingLevel !== level) { + const suggestedHeadingStart = Array(suggestedHeadingLevel) + .fill('#') + .join(''); + + onError({ + detail: '/p/editor_guide#accessible-headings', + lineNumber: heading.lineNumber, + context: `Consider changing the heading "${heading.line}" to a level ${suggestedHeadingLevel} heading by using "${suggestedHeadingStart}"`, + }); + } + } + prevLevel = level; + }); + }, +}; diff --git a/cypress/integration/publishingFlows/previewPost.spec.js b/cypress/integration/publishingFlows/previewPost.spec.js index 0f2cd5373..5e78d6f4d 100644 --- a/cypress/integration/publishingFlows/previewPost.spec.js +++ b/cypress/integration/publishingFlows/previewPost.spec.js @@ -45,6 +45,24 @@ describe('Post Editor', () => { cy.findByTestId('error-message').should('be.visible'); }); + it('should show the accessibility suggestions notice', () => { + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + // Add a heading level one which should cause an accessibility lint error + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type('# Heading level one'); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + cy.findByRole('heading', { + name: 'Improve the accessibility of your post', + }).should('exist'); + }); + it('should show the Edit tab by default', () => { cy.findByRole('form', { name: /^Edit post$/i }) .findByRole('navigation', { @@ -110,6 +128,24 @@ describe('Post Editor', () => { cy.findByTestId('error-message').should('be.visible'); }); + it('should show the accessibility suggestions notice', () => { + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + // Add a heading level one which should cause an accessibility lint error + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type('# Heading level one'); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + cy.findByRole('heading', { + name: 'Improve the accessibility of your post', + }).should('exist'); + }); + it('should show the Edit tab by default', () => { cy.findByRole('form', { name: /^Edit post$/i }) .findByRole('navigation', { @@ -128,4 +164,215 @@ describe('Post Editor', () => { }); }); }); + + describe('Accessibility suggestions', () => { + beforeEach(() => { + cy.testSetup(); + cy.fixture('users/articleEditorV2User.json').as('user'); + + cy.get('@user').then((user) => { + cy.loginUser(user).then(() => { + cy.visit('/new'); + }); + }); + }); + + it("shouldn't show accessibility suggestions if an error notice is present", () => { + const postTextWithError = '# Heading level one'; + + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + // Cause an error by having a non tag liquid tag without a tag name in the post body. + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type(`${postTextWithError}\n{%tag %}`, { + parseSpecialCharSequences: false, + }); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + cy.findByTestId('error-message').should('be.visible'); + + cy.findByRole('heading', { + name: 'Improve the accessibility of your post', + }).should('not.exist'); + }); + + it('should show a maximum of 3 accessibility suggestions', () => { + const postTextWithFourErrors = + '# Heading level 1\n![](http://imagewithoutalt.png)\n![alt text](http://imagewithdefaultalt.png)\n#### Heading level 4'; + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type(postTextWithFourErrors); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + // Check the notice has appeared + cy.findByRole('heading', { + name: 'Improve the accessibility of your post', + }); + + // Check each expected description has appeared + cy.findByText( + "Consider replacing the 'alt text' in square brackets at ![alt text](http://imagewithdefaultalt.png) with a description of the image", + ); + cy.findByText( + 'Consider adding an image description in the square brackets at ![](http://imagewithoutalt.png)', + ); + cy.findByText( + 'Consider changing "# Heading level 1" to a level two heading by using "##"', + ); + + // Check details links are shown for 3 errors + cy.findAllByRole('link', { + name: 'Learn more about accessible images', + }).should('have.length', 2); + cy.findAllByRole('link', { + name: 'Learn more about accessible headings', + }).should('have.length', 1); + }); + + it('should display image suggestions over heading suggestions', () => { + const textWithThreeImageErrors = + '![](http://imageerror1.png)\n![Alt Text](http://imageerror2.png)\n![Alt Text](http://imageerror3.png)'; + const textWithHeadingErrors = '# Heading level 1\n #### Heading level 4'; + + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type(`${textWithHeadingErrors}\n${textWithThreeImageErrors}`); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + // Verify the image suggestions are the only ones shown + cy.findByRole('link', { + name: 'Learn more about accessible headings', + }).should('not.exist'); + cy.findAllByRole('link', { + name: 'Learn more about accessible images', + }).should('have.length', 3); + }); + + it('should show a suggestion for level one headings', () => { + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type('# Level one heading'); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + cy.findByText( + 'Consider changing "# Level one heading" to a level two heading by using "##"', + ); + + cy.findByRole('link', { + name: 'Learn more about accessible headings', + }).should('have.attr', 'href', '/p/editor_guide#accessible-headings'); + }); + + it('should show a suggestion when heading level increases by more than one', () => { + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type('## Level two heading\n#### Level four heading'); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + cy.findByText( + 'Consider changing the heading "#### Level four heading" to a level 3 heading by using "###"', + ); + + cy.findByRole('link', { + name: 'Learn more about accessible headings', + }).should('have.attr', 'href', '/p/editor_guide#accessible-headings'); + }); + + it('should show a suggestion for empty alt text on images', () => { + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type('![](http://image1.png)'); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + cy.findByText( + 'Consider adding an image description in the square brackets at ![](http://image1.png)', + ); + + cy.findByRole('link', { + name: 'Learn more about accessible images', + }).should('have.attr', 'href', '/p/editor_guide#alt-text-for-images'); + }); + + it('should show a suggestion for default alt text on images', () => { + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type('![alt text](http://image1.png)\n![Alt Text](http://image2.png)'); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + cy.findByText( + "Consider replacing the 'alt text' in square brackets at ![alt text](http://image1.png) with a description of the image", + ); + + cy.findByText( + "Consider replacing the 'alt text' in square brackets at ![Alt Text](http://image2.png) with a description of the image", + ); + + cy.findAllByRole('link', { + name: 'Learn more about accessible images', + }).should('have.length', 2); + cy.findAllByRole('link', { + name: 'Learn more about accessible images', + }) + .first() + .should('have.attr', 'href', '/p/editor_guide#alt-text-for-images'); + }); + + it('should show the correct suggestion for alt text when other text exists on the same line', () => { + cy.findByRole('form', { name: /^Edit post$/i }).as('articleForm'); + + cy.get('@articleForm') + .findByLabelText('Post Content') + .clear() + .type('Some text ![alt text](http://image1.png) Some more text'); + + cy.get('@articleForm') + .findByRole('button', { name: /^Preview$/i }) + .click(); + + cy.findByText( + "Consider replacing the 'alt text' in square brackets at ![alt text](http://image1.png) with a description of the image", + ); + }); + }); });