1 | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
2 | var md = require('markdown-it')(),
|
3 | mk = require('./index');
|
4 |
|
5 | md.use(mk);
|
6 |
|
7 | var input = document.getElementById('input'),
|
8 | output = document.getElementById('output'),
|
9 | button = document.getElementById('button');
|
10 |
|
11 | button.addEventListener('click', function(ev){
|
12 |
|
13 | var result = md.render(input.value);
|
14 |
|
15 | output.innerHTML = result;
|
16 |
|
17 | });
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | },{"./index":2,"markdown-it":28}],2:[function(require,module,exports){
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | 'use strict';
|
98 |
|
99 | var katex = require('katex');
|
100 |
|
101 |
|
102 | function scanDelims(state, start, delimLength) {
|
103 | var pos = start, lastChar, nextChar, count, can_open, can_close,
|
104 | isLastWhiteSpace, isLastPunctChar,
|
105 | isNextWhiteSpace, isNextPunctChar,
|
106 | left_flanking = true,
|
107 | right_flanking = true,
|
108 | max = state.posMax,
|
109 | isWhiteSpace = state.md.utils.isWhiteSpace,
|
110 | isPunctChar = state.md.utils.isPunctChar,
|
111 | isMdAsciiPunct = state.md.utils.isMdAsciiPunct;
|
112 |
|
113 |
|
114 | lastChar = start > 0 ? state.src.charCodeAt(start - 1) : 0x20;
|
115 |
|
116 | if (pos >= max) {
|
117 | can_open = false;
|
118 | }
|
119 |
|
120 | pos += delimLength;
|
121 |
|
122 | count = pos - start;
|
123 |
|
124 |
|
125 | nextChar = pos < max ? state.src.charCodeAt(pos) : 0x20;
|
126 |
|
127 | isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
|
128 | isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
|
129 |
|
130 | isLastWhiteSpace = isWhiteSpace(lastChar);
|
131 | isNextWhiteSpace = isWhiteSpace(nextChar);
|
132 |
|
133 | if (isNextWhiteSpace) {
|
134 | left_flanking = false;
|
135 | } else if (isNextPunctChar) {
|
136 | if (!(isLastWhiteSpace || isLastPunctChar)) {
|
137 | left_flanking = false;
|
138 | }
|
139 | }
|
140 |
|
141 | if (isLastWhiteSpace) {
|
142 | right_flanking = false;
|
143 | } else if (isLastPunctChar) {
|
144 | if (!(isNextWhiteSpace || isNextPunctChar)) {
|
145 | right_flanking = false;
|
146 | }
|
147 | }
|
148 |
|
149 | can_open = left_flanking;
|
150 | can_close = right_flanking;
|
151 |
|
152 | return {
|
153 | can_open: can_open,
|
154 | can_close: can_close,
|
155 | delims: count
|
156 | };
|
157 | }
|
158 |
|
159 |
|
160 | function makeMath_inline(open, close) {
|
161 | return function math_inline(state, silent) {
|
162 | var startCount,
|
163 | found,
|
164 | res,
|
165 | token,
|
166 | closeDelim,
|
167 | max = state.posMax,
|
168 | start = state.pos,
|
169 | openDelim = state.src.slice(start, start + open.length);
|
170 |
|
171 | if (openDelim !== open) { return false; }
|
172 | if (silent) { return false; }
|
173 |
|
174 | res = scanDelims(state, start, openDelim.length);
|
175 | startCount = res.delims;
|
176 |
|
177 | if (!res.can_open) {
|
178 | state.pos += startCount;
|
179 |
|
180 | state.pending += state.src.slice(start, state.pos);
|
181 | return true;
|
182 | }
|
183 |
|
184 | state.pos = start + open.length;
|
185 |
|
186 | while (state.pos < max) {
|
187 | closeDelim = state.src.slice(state.pos, state.pos + close.length);
|
188 | if (closeDelim === close) {
|
189 | res = scanDelims(state, state.pos, close.length);
|
190 | if (res.can_close) {
|
191 | found = true;
|
192 | break;
|
193 | }
|
194 | }
|
195 |
|
196 | state.md.inline.skipToken(state);
|
197 | }
|
198 |
|
199 | if (!found) {
|
200 |
|
201 | state.pos = start;
|
202 | return false;
|
203 | }
|
204 |
|
205 |
|
206 | state.posMax = state.pos;
|
207 | state.pos = start + close.length;
|
208 |
|
209 |
|
210 | token = state.push('math_inline', 'math', 0);
|
211 | token.content = state.src.slice(state.pos, state.posMax);
|
212 | token.markup = open;
|
213 |
|
214 | state.pos = state.posMax + close.length;
|
215 | state.posMax = max;
|
216 |
|
217 | return true;
|
218 | };
|
219 | }
|
220 |
|
221 | function makeMath_block(open, close) {
|
222 | return function math_block(state, startLine, endLine, silent) {
|
223 | var openDelim, len, params, nextLine, token, firstLine, lastLine, lastLinePos,
|
224 | haveEndMarker = false,
|
225 | pos = state.bMarks[startLine] + state.tShift[startLine],
|
226 | max = state.eMarks[startLine];
|
227 |
|
228 | if (pos + open.length > max) { return false; }
|
229 |
|
230 | openDelim = state.src.slice(pos, pos + open.length);
|
231 |
|
232 | if (openDelim !== open) { return false; }
|
233 |
|
234 | pos += open.length;
|
235 | firstLine = state.src.slice(pos, max);
|
236 |
|
237 |
|
238 | if (silent) { return true; }
|
239 |
|
240 | if (firstLine.trim().slice(-close.length) === close) {
|
241 |
|
242 | firstLine = firstLine.trim().slice(0, -close.length);
|
243 | haveEndMarker = true;
|
244 | }
|
245 |
|
246 |
|
247 | nextLine = startLine;
|
248 |
|
249 | for (;;) {
|
250 | if (haveEndMarker) { break; }
|
251 |
|
252 | nextLine++;
|
253 |
|
254 | if (nextLine >= endLine) {
|
255 |
|
256 |
|
257 | break;
|
258 | }
|
259 |
|
260 | pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
261 | max = state.eMarks[nextLine];
|
262 |
|
263 | if (pos < max && state.tShift[nextLine] < state.blkIndent) {
|
264 |
|
265 | break;
|
266 | }
|
267 |
|
268 | if (state.src.slice(pos, max).trim().slice(-close.length) !== close) {
|
269 | continue;
|
270 | }
|
271 |
|
272 | if (state.tShift[nextLine] - state.blkIndent >= 4) {
|
273 |
|
274 | continue;
|
275 | }
|
276 |
|
277 | lastLinePos = state.src.slice(0, max).lastIndexOf(close);
|
278 | lastLine = state.src.slice(pos, lastLinePos);
|
279 |
|
280 | pos += lastLine.length + close.length;
|
281 |
|
282 |
|
283 | pos = state.skipSpaces(pos);
|
284 |
|
285 | if (pos < max) { continue; }
|
286 |
|
287 |
|
288 | haveEndMarker = true;
|
289 | }
|
290 |
|
291 |
|
292 | len = state.tShift[startLine];
|
293 |
|
294 | state.line = nextLine + (haveEndMarker ? 1 : 0);
|
295 |
|
296 | token = state.push('math_block', 'math', 0);
|
297 | token.block = true;
|
298 | token.content = (firstLine && firstLine.trim() ? firstLine + '\n' : '') +
|
299 | state.getLines(startLine + 1, nextLine, len, true) +
|
300 | (lastLine && lastLine.trim() ? lastLine : '');
|
301 | token.info = params;
|
302 | token.map = [ startLine, state.line ];
|
303 | token.markup = open;
|
304 |
|
305 | return true;
|
306 | };
|
307 | }
|
308 |
|
309 |
|
310 | module.exports = function math_plugin(md) {
|
311 |
|
312 |
|
313 | var inlineOpen = '$',
|
314 | inlineClose = '$',
|
315 | blockOpen = '$$',
|
316 | blockClose = '$$';
|
317 |
|
318 | var katexInline = function(latex){
|
319 | return katex.renderToString(latex, {"displayMode" : false});
|
320 | };
|
321 |
|
322 | var inlineRenderer = function(tokens, idx){
|
323 | return katexInline(tokens[idx].content);
|
324 | };
|
325 |
|
326 | var katexBlock = function(latex){
|
327 | return katex.renderToString(latex, {"displayMode" : true});
|
328 | }
|
329 |
|
330 | var blockRenderer = function(tokens, idx){
|
331 | return katexBlock(tokens[idx].content) + '\n';
|
332 | }
|
333 |
|
334 | var math_inline = makeMath_inline(inlineOpen, inlineClose);
|
335 | var math_block = makeMath_block(blockOpen, blockClose);
|
336 |
|
337 | md.inline.ruler.before('escape', 'math_inline', math_inline);
|
338 | md.block.ruler.after('blockquote', 'math_block', math_block, {
|
339 | alt: [ 'paragraph', 'reference', 'blockquote', 'list' ]
|
340 | });
|
341 | md.renderer.rules.math_inline = inlineRenderer;
|
342 | md.renderer.rules.math_block = blockRenderer;
|
343 | };
|
344 |
|
345 | },{"katex":4}],3:[function(require,module,exports){
|
346 | module.exports={"Aacute":"\u00C1","aacute":"\u00E1","Abreve":"\u0102","abreve":"\u0103","ac":"\u223E","acd":"\u223F","acE":"\u223E\u0333","Acirc":"\u00C2","acirc":"\u00E2","acute":"\u00B4","Acy":"\u0410","acy":"\u0430","AElig":"\u00C6","aelig":"\u00E6","af":"\u2061","Afr":"\uD835\uDD04","afr":"\uD835\uDD1E","Agrave":"\u00C0","agrave":"\u00E0","alefsym":"\u2135","aleph":"\u2135","Alpha":"\u0391","alpha":"\u03B1","Amacr":"\u0100","amacr":"\u0101","amalg":"\u2A3F","amp":"&","AMP":"&","andand":"\u2A55","And":"\u2A53","and":"\u2227","andd":"\u2A5C","andslope":"\u2A58","andv":"\u2A5A","ang":"\u2220","ange":"\u29A4","angle":"\u2220","angmsdaa":"\u29A8","angmsdab":"\u29A9","angmsdac":"\u29AA","angmsdad":"\u29AB","angmsdae":"\u29AC","angmsdaf":"\u29AD","angmsdag":"\u29AE","angmsdah":"\u29AF","angmsd":"\u2221","angrt":"\u221F","angrtvb":"\u22BE","angrtvbd":"\u299D","angsph":"\u2222","angst":"\u00C5","angzarr":"\u237C","Aogon":"\u0104","aogon":"\u0105","Aopf":"\uD835\uDD38","aopf":"\uD835\uDD52","apacir":"\u2A6F","ap":"\u2248","apE":"\u2A70","ape":"\u224A","apid":"\u224B","apos":"'","ApplyFunction":"\u2061","approx":"\u2248","approxeq":"\u224A","Aring":"\u00C5","aring":"\u00E5","Ascr":"\uD835\uDC9C","ascr":"\uD835\uDCB6","Assign":"\u2254","ast":"*","asymp":"\u2248","asympeq":"\u224D","Atilde":"\u00C3","atilde":"\u00E3","Auml":"\u00C4","auml":"\u00E4","awconint":"\u2233","awint":"\u2A11","backcong":"\u224C","backepsilon":"\u03F6","backprime":"\u2035","backsim":"\u223D","backsimeq":"\u22CD","Backslash":"\u2216","Barv":"\u2AE7","barvee":"\u22BD","barwed":"\u2305","Barwed":"\u2306","barwedge":"\u2305","bbrk":"\u23B5","bbrktbrk":"\u23B6","bcong":"\u224C","Bcy":"\u0411","bcy":"\u0431","bdquo":"\u201E","becaus":"\u2235","because":"\u2235","Because":"\u2235","bemptyv":"\u29B0","bepsi":"\u03F6","bernou":"\u212C","Bernoullis":"\u212C","Beta":"\u0392","beta":"\u03B2","beth":"\u2136","between":"\u226C","Bfr":"\uD835\uDD05","bfr":"\uD835\uDD1F","bigcap":"\u22C2","bigcirc":"\u25EF","bigcup":"\u22C3","bigodot":"\u2A00","bigoplus":"\u2A01","bigotimes":"\u2A02","bigsqcup":"\u2A06","bigstar":"\u2605","bigtriangledown":"\u25BD","bigtriangleup":"\u25B3","biguplus":"\u2A04","bigvee":"\u22C1","bigwedge":"\u22C0","bkarow":"\u290D","blacklozenge":"\u29EB","blacksquare":"\u25AA","blacktriangle":"\u25B4","blacktriangledown":"\u25BE","blacktriangleleft":"\u25C2","blacktriangleright":"\u25B8","blank":"\u2423","blk12":"\u2592","blk14":"\u2591","blk34":"\u2593","block":"\u2588","bne":"=\u20E5","bnequiv":"\u2261\u20E5","bNot":"\u2AED","bnot":"\u2310","Bopf":"\uD835\uDD39","bopf":"\uD835\uDD53","bot":"\u22A5","bottom":"\u22A5","bowtie":"\u22C8","boxbox":"\u29C9","boxdl":"\u2510","boxdL":"\u2555","boxDl":"\u2556","boxDL":"\u2557","boxdr":"\u250C","boxdR":"\u2552","boxDr":"\u2553","boxDR":"\u2554","boxh":"\u2500","boxH":"\u2550","boxhd":"\u252C","boxHd":"\u2564","boxhD":"\u2565","boxHD":"\u2566","boxhu":"\u2534","boxHu":"\u2567","boxhU":"\u2568","boxHU":"\u2569","boxminus":"\u229F","boxplus":"\u229E","boxtimes":"\u22A0","boxul":"\u2518","boxuL":"\u255B","boxUl":"\u255C","boxUL":"\u255D","boxur":"\u2514","boxuR":"\u2558","boxUr":"\u2559","boxUR":"\u255A","boxv":"\u2502","boxV":"\u2551","boxvh":"\u253C","boxvH":"\u256A","boxVh":"\u256B","boxVH":"\u256C","boxvl":"\u2524","boxvL":"\u2561","boxVl":"\u2562","boxVL":"\u2563","boxvr":"\u251C","boxvR":"\u255E","boxVr":"\u255F","boxVR":"\u2560","bprime":"\u2035","breve":"\u02D8","Breve":"\u02D8","brvbar":"\u00A6","bscr":"\uD835\uDCB7","Bscr":"\u212C","bsemi":"\u204F","bsim":"\u223D","bsime":"\u22CD","bsolb":"\u29C5","bsol":"\\","bsolhsub":"\u27C8","bull":"\u2022","bullet":"\u2022","bump":"\u224E","bumpE":"\u2AAE","bumpe":"\u224F","Bumpeq":"\u224E","bumpeq":"\u224F","Cacute":"\u0106","cacute":"\u0107","capand":"\u2A44","capbrcup":"\u2A49","capcap":"\u2A4B","cap":"\u2229","Cap":"\u22D2","capcup":"\u2A47","capdot":"\u2A40","CapitalDifferentialD":"\u2145","caps":"\u2229\uFE00","caret":"\u2041","caron":"\u02C7","Cayleys":"\u212D","ccaps":"\u2A4D","Ccaron":"\u010C","ccaron":"\u010D","Ccedil":"\u00C7","ccedil":"\u00E7","Ccirc":"\u0108","ccirc":"\u0109","Cconint":"\u2230","ccups":"\u2A4C","ccupssm":"\u2A50","Cdot":"\u010A","cdot":"\u010B","cedil":"\u00B8","Cedilla":"\u00B8","cemptyv":"\u29B2","cent":"\u00A2","centerdot":"\u00B7","CenterDot":"\u00B7","cfr":"\uD835\uDD20","Cfr":"\u212D","CHcy":"\u0427","chcy":"\u0447","check":"\u2713","checkmark":"\u2713","Chi":"\u03A7","chi":"\u03C7","circ":"\u02C6","circeq":"\u2257","circlearrowleft":"\u21BA","circlearrowright":"\u21BB","circledast":"\u229B","circledcirc":"\u229A","circleddash":"\u229D","CircleDot":"\u2299","circledR":"\u00AE","circledS":"\u24C8","CircleMinus":"\u2296","CirclePlus":"\u2295","CircleTimes":"\u2297","cir":"\u25CB","cirE":"\u29C3","cire":"\u2257","cirfnint":"\u2A10","cirmid":"\u2AEF","cirscir":"\u29C2","ClockwiseContourIntegral":"\u2232","CloseCurlyDoubleQuote":"\u201D","CloseCurlyQuote":"\u2019","clubs":"\u2663","clubsuit":"\u2663","colon":":","Colon":"\u2237","Colone":"\u2A74","colone":"\u2254","coloneq":"\u2254","comma":",","commat":"@","comp":"\u2201","compfn":"\u2218","complement":"\u2201","complexes":"\u2102","cong":"\u2245","congdot":"\u2A6D","Congruent":"\u2261","conint":"\u222E","Conint":"\u222F","ContourIntegral":"\u222E","copf":"\uD835\uDD54","Copf":"\u2102","coprod":"\u2210","Coproduct":"\u2210","copy":"\u00A9","COPY":"\u00A9","copysr":"\u2117","CounterClockwiseContourIntegral":"\u2233","crarr":"\u21B5","cross":"\u2717","Cross":"\u2A2F","Cscr":"\uD835\uDC9E","cscr":"\uD835\uDCB8","csub":"\u2ACF","csube":"\u2AD1","csup":"\u2AD0","csupe":"\u2AD2","ctdot":"\u22EF","cudarrl":"\u2938","cudarrr":"\u2935","cuepr":"\u22DE","cuesc":"\u22DF","cularr":"\u21B6","cularrp":"\u293D","cupbrcap":"\u2A48","cupcap":"\u2A46","CupCap":"\u224D","cup":"\u222A","Cup":"\u22D3","cupcup":"\u2A4A","cupdot":"\u228D","cupor":"\u2A45","cups":"\u222A\uFE00","curarr":"\u21B7","curarrm":"\u293C","curlyeqprec":"\u22DE","curlyeqsucc":"\u22DF","curlyvee":"\u22CE","curlywedge":"\u22CF","curren":"\u00A4","curvearrowleft":"\u21B6","curvearrowright":"\u21B7","cuvee":"\u22CE","cuwed":"\u22CF","cwconint":"\u2232","cwint":"\u2231","cylcty":"\u232D","dagger":"\u2020","Dagger":"\u2021","daleth":"\u2138","darr":"\u2193","Darr":"\u21A1","dArr":"\u21D3","dash":"\u2010","Dashv":"\u2AE4","dashv":"\u22A3","dbkarow":"\u290F","dblac":"\u02DD","Dcaron":"\u010E","dcaron":"\u010F","Dcy":"\u0414","dcy":"\u0434","ddagger":"\u2021","ddarr":"\u21CA","DD":"\u2145","dd":"\u2146","DDotrahd":"\u2911","ddotseq":"\u2A77","deg":"\u00B0","Del":"\u2207","Delta":"\u0394","delta":"\u03B4","demptyv":"\u29B1","dfisht":"\u297F","Dfr":"\uD835\uDD07","dfr":"\uD835\uDD21","dHar":"\u2965","dharl":"\u21C3","dharr":"\u21C2","DiacriticalAcute":"\u00B4","DiacriticalDot":"\u02D9","DiacriticalDoubleAcute":"\u02DD","DiacriticalGrave":"`","DiacriticalTilde":"\u02DC","diam":"\u22C4","diamond":"\u22C4","Diamond":"\u22C4","diamondsuit":"\u2666","diams":"\u2666","die":"\u00A8","DifferentialD":"\u2146","digamma":"\u03DD","disin":"\u22F2","div":"\u00F7","divide":"\u00F7","divideontimes":"\u22C7","divonx":"\u22C7","DJcy":"\u0402","djcy":"\u0452","dlcorn":"\u231E","dlcrop":"\u230D","dollar":"$","Dopf":"\uD835\uDD3B","dopf":"\uD835\uDD55","Dot":"\u00A8","dot":"\u02D9","DotDot":"\u20DC","doteq":"\u2250","doteqdot":"\u2251","DotEqual":"\u2250","dotminus":"\u2238","dotplus":"\u2214","dotsquare":"\u22A1","doublebarwedge":"\u2306","DoubleContourIntegral":"\u222F","DoubleDot":"\u00A8","DoubleDownArrow":"\u21D3","DoubleLeftArrow":"\u21D0","DoubleLeftRightArrow":"\u21D4","DoubleLeftTee":"\u2AE4","DoubleLongLeftArrow":"\u27F8","DoubleLongLeftRightArrow":"\u27FA","DoubleLongRightArrow":"\u27F9","DoubleRightArrow":"\u21D2","DoubleRightTee":"\u22A8","DoubleUpArrow":"\u21D1","DoubleUpDownArrow":"\u21D5","DoubleVerticalBar":"\u2225","DownArrowBar":"\u2913","downarrow":"\u2193","DownArrow":"\u2193","Downarrow":"\u21D3","DownArrowUpArrow":"\u21F5","DownBreve":"\u0311","downdownarrows":"\u21CA","downharpoonleft":"\u21C3","downharpoonright":"\u21C2","DownLeftRightVector":"\u2950","DownLeftTeeVector":"\u295E","DownLeftVectorBar":"\u2956","DownLeftVector":"\u21BD","DownRightTeeVector":"\u295F","DownRightVectorBar":"\u2957","DownRightVector":"\u21C1","DownTeeArrow":"\u21A7","DownTee":"\u22A4","drbkarow":"\u2910","drcorn":"\u231F","drcrop":"\u230C","Dscr":"\uD835\uDC9F","dscr":"\uD835\uDCB9","DScy":"\u0405","dscy":"\u0455","dsol":"\u29F6","Dstrok":"\u0110","dstrok":"\u0111","dtdot":"\u22F1","dtri":"\u25BF","dtrif":"\u25BE","duarr":"\u21F5","duhar":"\u296F","dwangle":"\u29A6","DZcy":"\u040F","dzcy":"\u045F","dzigrarr":"\u27FF","Eacute":"\u00C9","eacute":"\u00E9","easter":"\u2A6E","Ecaron":"\u011A","ecaron":"\u011B","Ecirc":"\u00CA","ecirc":"\u00EA","ecir":"\u2256","ecolon":"\u2255","Ecy":"\u042D","ecy":"\u044D","eDDot":"\u2A77","Edot":"\u0116","edot":"\u0117","eDot":"\u2251","ee":"\u2147","efDot":"\u2252","Efr":"\uD835\uDD08","efr":"\uD835\uDD22","eg":"\u2A9A","Egrave":"\u00C8","egrave":"\u00E8","egs":"\u2A96","egsdot":"\u2A98","el":"\u2A99","Element":"\u2208","elinters":"\u23E7","ell":"\u2113","els":"\u2A95","elsdot":"\u2A97","Emacr":"\u0112","emacr":"\u0113","empty":"\u2205","emptyset":"\u2205","EmptySmallSquare":"\u25FB","emptyv":"\u2205","EmptyVerySmallSquare":"\u25AB","emsp13":"\u2004","emsp14":"\u2005","emsp":"\u2003","ENG":"\u014A","eng":"\u014B","ensp":"\u2002","Eogon":"\u0118","eogon":"\u0119","Eopf":"\uD835\uDD3C","eopf":"\uD835\uDD56","epar":"\u22D5","eparsl":"\u29E3","eplus":"\u2A71","epsi":"\u03B5","Epsilon":"\u0395","epsilon":"\u03B5","epsiv":"\u03F5","eqcirc":"\u2256","eqcolon":"\u2255","eqsim":"\u2242","eqslantgtr":"\u2A96","eqslantless":"\u2A95","Equal":"\u2A75","equals":"=","EqualTilde":"\u2242","equest":"\u225F","Equilibrium":"\u21CC","equiv":"\u2261","equivDD":"\u2A78","eqvparsl":"\u29E5","erarr":"\u2971","erDot":"\u2253","escr":"\u212F","Escr":"\u2130","esdot":"\u2250","Esim":"\u2A73","esim":"\u2242","Eta":"\u0397","eta":"\u03B7","ETH":"\u00D0","eth":"\u00F0","Euml":"\u00CB","euml":"\u00EB","euro":"\u20AC","excl":"!","exist":"\u2203","Exists":"\u2203","expectation":"\u2130","exponentiale":"\u2147","ExponentialE":"\u2147","fallingdotseq":"\u2252","Fcy":"\u0424","fcy":"\u0444","female":"\u2640","ffilig":"\uFB03","fflig":"\uFB00","ffllig":"\uFB04","Ffr":"\uD835\uDD09","ffr":"\uD835\uDD23","filig":"\uFB01","FilledSmallSquare":"\u25FC","FilledVerySmallSquare":"\u25AA","fjlig":"fj","flat":"\u266D","fllig":"\uFB02","fltns":"\u25B1","fnof":"\u0192","Fopf":"\uD835\uDD3D","fopf":"\uD835\uDD57","forall":"\u2200","ForAll":"\u2200","fork":"\u22D4","forkv":"\u2AD9","Fouriertrf":"\u2131","fpartint":"\u2A0D","frac12":"\u00BD","frac13":"\u2153","frac14":"\u00BC","frac15":"\u2155","frac16":"\u2159","frac18":"\u215B","frac23":"\u2154","frac25":"\u2156","frac34":"\u00BE","frac35":"\u2157","frac38":"\u215C","frac45":"\u2158","frac56":"\u215A","frac58":"\u215D","frac78":"\u215E","frasl":"\u2044","frown":"\u2322","fscr":"\uD835\uDCBB","Fscr":"\u2131","gacute":"\u01F5","Gamma":"\u0393","gamma":"\u03B3","Gammad":"\u03DC","gammad":"\u03DD","gap":"\u2A86","Gbreve":"\u011E","gbreve":"\u011F","Gcedil":"\u0122","Gcirc":"\u011C","gcirc":"\u011D","Gcy":"\u0413","gcy":"\u0433","Gdot":"\u0120","gdot":"\u0121","ge":"\u2265","gE":"\u2267","gEl":"\u2A8C","gel":"\u22DB","geq":"\u2265","geqq":"\u2267","geqslant":"\u2A7E","gescc":"\u2AA9","ges":"\u2A7E","gesdot":"\u2A80","gesdoto":"\u2A82","gesdotol":"\u2A84","gesl":"\u22DB\uFE00","gesles":"\u2A94","Gfr":"\uD835\uDD0A","gfr":"\uD835\uDD24","gg":"\u226B","Gg":"\u22D9","ggg":"\u22D9","gimel":"\u2137","GJcy":"\u0403","gjcy":"\u0453","gla":"\u2AA5","gl":"\u2277","glE":"\u2A92","glj":"\u2AA4","gnap":"\u2A8A","gnapprox":"\u2A8A","gne":"\u2A88","gnE":"\u2269","gneq":"\u2A88","gneqq":"\u2269","gnsim":"\u22E7","Gopf":"\uD835\uDD3E","gopf":"\uD835\uDD58","grave":"`","GreaterEqual":"\u2265","GreaterEqualLess":"\u22DB","GreaterFullEqual":"\u2267","GreaterGreater":"\u2AA2","GreaterLess":"\u2277","GreaterSlantEqual":"\u2A7E","GreaterTilde":"\u2273","Gscr":"\uD835\uDCA2","gscr":"\u210A","gsim":"\u2273","gsime":"\u2A8E","gsiml":"\u2A90","gtcc":"\u2AA7","gtcir":"\u2A7A","gt":">","GT":">","Gt":"\u226B","gtdot":"\u22D7","gtlPar":"\u2995","gtquest":"\u2A7C","gtrapprox":"\u2A86","gtrarr":"\u2978","gtrdot":"\u22D7","gtreqless":"\u22DB","gtreqqless":"\u2A8C","gtrless":"\u2277","gtrsim":"\u2273","gvertneqq":"\u2269\uFE00","gvnE":"\u2269\uFE00","Hacek":"\u02C7","hairsp":"\u200A","half":"\u00BD","hamilt":"\u210B","HARDcy":"\u042A","hardcy":"\u044A","harrcir":"\u2948","harr":"\u2194","hArr":"\u21D4","harrw":"\u21AD","Hat":"^","hbar":"\u210F","Hcirc":"\u0124","hcirc":"\u0125","hearts":"\u2665","heartsuit":"\u2665","hellip":"\u2026","hercon":"\u22B9","hfr":"\uD835\uDD25","Hfr":"\u210C","HilbertSpace":"\u210B","hksearow":"\u2925","hkswarow":"\u2926","hoarr":"\u21FF","homtht":"\u223B","hookleftarrow":"\u21A9","hookrightarrow":"\u21AA","hopf":"\uD835\uDD59","Hopf":"\u210D","horbar":"\u2015","HorizontalLine":"\u2500","hscr":"\uD835\uDCBD","Hscr":"\u210B","hslash":"\u210F","Hstrok":"\u0126","hstrok":"\u0127","HumpDownHump":"\u224E","HumpEqual":"\u224F","hybull":"\u2043","hyphen":"\u2010","Iacute":"\u00CD","iacute":"\u00ED","ic":"\u2063","Icirc":"\u00CE","icirc":"\u00EE","Icy":"\u0418","icy":"\u0438","Idot":"\u0130","IEcy":"\u0415","iecy":"\u0435","iexcl":"\u00A1","iff":"\u21D4","ifr":"\uD835\uDD26","Ifr":"\u2111","Igrave":"\u00CC","igrave":"\u00EC","ii":"\u2148","iiiint":"\u2A0C","iiint":"\u222D","iinfin":"\u29DC","iiota":"\u2129","IJlig":"\u0132","ijlig":"\u0133","Imacr":"\u012A","imacr":"\u012B","image":"\u2111","ImaginaryI":"\u2148","imagline":"\u2110","imagpart":"\u2111","imath":"\u0131","Im":"\u2111","imof":"\u22B7","imped":"\u01B5","Implies":"\u21D2","incare":"\u2105","in":"\u2208","infin":"\u221E","infintie":"\u29DD","inodot":"\u0131","intcal":"\u22BA","int":"\u222B","Int":"\u222C","integers":"\u2124","Integral":"\u222B","intercal":"\u22BA","Intersection":"\u22C2","intlarhk":"\u2A17","intprod":"\u2A3C","InvisibleComma":"\u2063","InvisibleTimes":"\u2062","IOcy":"\u0401","iocy":"\u0451","Iogon":"\u012E","iogon":"\u012F","Iopf":"\uD835\uDD40","iopf":"\uD835\uDD5A","Iota":"\u0399","iota":"\u03B9","iprod":"\u2A3C","iquest":"\u00BF","iscr":"\uD835\uDCBE","Iscr":"\u2110","isin":"\u2208","isindot":"\u22F5","isinE":"\u22F9","isins":"\u22F4","isinsv":"\u22F3","isinv":"\u2208","it":"\u2062","Itilde":"\u0128","itilde":"\u0129","Iukcy":"\u0406","iukcy":"\u0456","Iuml":"\u00CF","iuml":"\u00EF","Jcirc":"\u0134","jcirc":"\u0135","Jcy":"\u0419","jcy":"\u0439","Jfr":"\uD835\uDD0D","jfr":"\uD835\uDD27","jmath":"\u0237","Jopf":"\uD835\uDD41","jopf":"\uD835\uDD5B","Jscr":"\uD835\uDCA5","jscr":"\uD835\uDCBF","Jsercy":"\u0408","jsercy":"\u0458","Jukcy":"\u0404","jukcy":"\u0454","Kappa":"\u039A","kappa":"\u03BA","kappav":"\u03F0","Kcedil":"\u0136","kcedil":"\u0137","Kcy":"\u041A","kcy":"\u043A","Kfr":"\uD835\uDD0E","kfr":"\uD835\uDD28","kgreen":"\u0138","KHcy":"\u0425","khcy":"\u0445","KJcy":"\u040C","kjcy":"\u045C","Kopf":"\uD835\uDD42","kopf":"\uD835\uDD5C","Kscr":"\uD835\uDCA6","kscr":"\uD835\uDCC0","lAarr":"\u21DA","Lacute":"\u0139","lacute":"\u013A","laemptyv":"\u29B4","lagran":"\u2112","Lambda":"\u039B","lambda":"\u03BB","lang":"\u27E8","Lang":"\u27EA","langd":"\u2991","langle":"\u27E8","lap":"\u2A85","Laplacetrf":"\u2112","laquo":"\u00AB","larrb":"\u21E4","larrbfs":"\u291F","larr":"\u2190","Larr":"\u219E","lArr":"\u21D0","larrfs":"\u291D","larrhk":"\u21A9","larrlp":"\u21AB","larrpl":"\u2939","larrsim":"\u2973","larrtl":"\u21A2","latail":"\u2919","lAtail":"\u291B","lat":"\u2AAB","late":"\u2AAD","lates":"\u2AAD\uFE00","lbarr":"\u290C","lBarr":"\u290E","lbbrk":"\u2772","lbrace":"{","lbrack":"[","lbrke":"\u298B","lbrksld":"\u298F","lbrkslu":"\u298D","Lcaron":"\u013D","lcaron":"\u013E","Lcedil":"\u013B","lcedil":"\u013C","lceil":"\u2308","lcub":"{","Lcy":"\u041B","lcy":"\u043B","ldca":"\u2936","ldquo":"\u201C","ldquor":"\u201E","ldrdhar":"\u2967","ldrushar":"\u294B","ldsh":"\u21B2","le":"\u2264","lE":"\u2266","LeftAngleBracket":"\u27E8","LeftArrowBar":"\u21E4","leftarrow":"\u2190","LeftArrow":"\u2190","Leftarrow":"\u21D0","LeftArrowRightArrow":"\u21C6","leftarrowtail":"\u21A2","LeftCeiling":"\u2308","LeftDoubleBracket":"\u27E6","LeftDownTeeVector":"\u2961","LeftDownVectorBar":"\u2959","LeftDownVector":"\u21C3","LeftFloor":"\u230A","leftharpoondown":"\u21BD","leftharpoonup":"\u21BC","leftleftarrows":"\u21C7","leftrightarrow":"\u2194","LeftRightArrow":"\u2194","Leftrightarrow":"\u21D4","leftrightarrows":"\u21C6","leftrightharpoons":"\u21CB","leftrightsquigarrow":"\u21AD","LeftRightVector":"\u294E","LeftTeeArrow":"\u21A4","LeftTee":"\u22A3","LeftTeeVector":"\u295A","leftthreetimes":"\u22CB","LeftTriangleBar":"\u29CF","LeftTriangle":"\u22B2","LeftTriangleEqual":"\u22B4","LeftUpDownVector":"\u2951","LeftUpTeeVector":"\u2960","LeftUpVectorBar":"\u2958","LeftUpVector":"\u21BF","LeftVectorBar":"\u2952","LeftVector":"\u21BC","lEg":"\u2A8B","leg":"\u22DA","leq":"\u2264","leqq":"\u2266","leqslant":"\u2A7D","lescc":"\u2AA8","les":"\u2A7D","lesdot":"\u2A7F","lesdoto":"\u2A81","lesdotor":"\u2A83","lesg":"\u22DA\uFE00","lesges":"\u2A93","lessapprox":"\u2A85","lessdot":"\u22D6","lesseqgtr":"\u22DA","lesseqqgtr":"\u2A8B","LessEqualGreater":"\u22DA","LessFullEqual":"\u2266","LessGreater":"\u2276","lessgtr":"\u2276","LessLess":"\u2AA1","lesssim":"\u2272","LessSlantEqual":"\u2A7D","LessTilde":"\u2272","lfisht":"\u297C","lfloor":"\u230A","Lfr":"\uD835\uDD0F","lfr":"\uD835\uDD29","lg":"\u2276","lgE":"\u2A91","lHar":"\u2962","lhard":"\u21BD","lharu":"\u21BC","lharul":"\u296A","lhblk":"\u2584","LJcy":"\u0409","ljcy":"\u0459","llarr":"\u21C7","ll":"\u226A","Ll":"\u22D8","llcorner":"\u231E","Lleftarrow":"\u21DA","llhard":"\u296B","lltri":"\u25FA","Lmidot":"\u013F","lmidot":"\u0140","lmoustache":"\u23B0","lmoust":"\u23B0","lnap":"\u2A89","lnapprox":"\u2A89","lne":"\u2A87","lnE":"\u2268","lneq":"\u2A87","lneqq":"\u2268","lnsim":"\u22E6","loang":"\u27EC","loarr":"\u21FD","lobrk":"\u27E6","longleftarrow":"\u27F5","LongLeftArrow":"\u27F5","Longleftarrow":"\u27F8","longleftrightarrow":"\u27F7","LongLeftRightArrow":"\u27F7","Longleftrightarrow":"\u27FA","longmapsto":"\u27FC","longrightarrow":"\u27F6","LongRightArrow":"\u27F6","Longrightarrow":"\u27F9","looparrowleft":"\u21AB","looparrowright":"\u21AC","lopar":"\u2985","Lopf":"\uD835\uDD43","lopf":"\uD835\uDD5D","loplus":"\u2A2D","lotimes":"\u2A34","lowast":"\u2217","lowbar":"_","LowerLeftArrow":"\u2199","LowerRightArrow":"\u2198","loz":"\u25CA","lozenge":"\u25CA","lozf":"\u29EB","lpar":"(","lparlt":"\u2993","lrarr":"\u21C6","lrcorner":"\u231F","lrhar":"\u21CB","lrhard":"\u296D","lrm":"\u200E","lrtri":"\u22BF","lsaquo":"\u2039","lscr":"\uD835\uDCC1","Lscr":"\u2112","lsh":"\u21B0","Lsh":"\u21B0","lsim":"\u2272","lsime":"\u2A8D","lsimg":"\u2A8F","lsqb":"[","lsquo":"\u2018","lsquor":"\u201A","Lstrok":"\u0141","lstrok":"\u0142","ltcc":"\u2AA6","ltcir":"\u2A79","lt":"<","LT":"<","Lt":"\u226A","ltdot":"\u22D6","lthree":"\u22CB","ltimes":"\u22C9","ltlarr":"\u2976","ltquest":"\u2A7B","ltri":"\u25C3","ltrie":"\u22B4","ltrif":"\u25C2","ltrPar":"\u2996","lurdshar":"\u294A","luruhar":"\u2966","lvertneqq":"\u2268\uFE00","lvnE":"\u2268\uFE00","macr":"\u00AF","male":"\u2642","malt":"\u2720","maltese":"\u2720","Map":"\u2905","map":"\u21A6","mapsto":"\u21A6","mapstodown":"\u21A7","mapstoleft":"\u21A4","mapstoup":"\u21A5","marker":"\u25AE","mcomma":"\u2A29","Mcy":"\u041C","mcy":"\u043C","mdash":"\u2014","mDDot":"\u223A","measuredangle":"\u2221","MediumSpace":"\u205F","Mellintrf":"\u2133","Mfr":"\uD835\uDD10","mfr":"\uD835\uDD2A","mho":"\u2127","micro":"\u00B5","midast":"*","midcir":"\u2AF0","mid":"\u2223","middot":"\u00B7","minusb":"\u229F","minus":"\u2212","minusd":"\u2238","minusdu":"\u2A2A","MinusPlus":"\u2213","mlcp":"\u2ADB","mldr":"\u2026","mnplus":"\u2213","models":"\u22A7","Mopf":"\uD835\uDD44","mopf":"\uD835\uDD5E","mp":"\u2213","mscr":"\uD835\uDCC2","Mscr":"\u2133","mstpos":"\u223E","Mu":"\u039C","mu":"\u03BC","multimap":"\u22B8","mumap":"\u22B8","nabla":"\u2207","Nacute":"\u0143","nacute":"\u0144","nang":"\u2220\u20D2","nap":"\u2249","napE":"\u2A70\u0338","napid":"\u224B\u0338","napos":"\u0149","napprox":"\u2249","natural":"\u266E","naturals":"\u2115","natur":"\u266E","nbsp":"\u00A0","nbump":"\u224E\u0338","nbumpe":"\u224F\u0338","ncap":"\u2A43","Ncaron":"\u0147","ncaron":"\u0148","Ncedil":"\u0145","ncedil":"\u0146","ncong":"\u2247","ncongdot":"\u2A6D\u0338","ncup":"\u2A42","Ncy":"\u041D","ncy":"\u043D","ndash":"\u2013","nearhk":"\u2924","nearr":"\u2197","neArr":"\u21D7","nearrow":"\u2197","ne":"\u2260","nedot":"\u2250\u0338","NegativeMediumSpace":"\u200B","NegativeThickSpace":"\u200B","NegativeThinSpace":"\u200B","NegativeVeryThinSpace":"\u200B","nequiv":"\u2262","nesear":"\u2928","nesim":"\u2242\u0338","NestedGreaterGreater":"\u226B","NestedLessLess":"\u226A","NewLine":"\n","nexist":"\u2204","nexists":"\u2204","Nfr":"\uD835\uDD11","nfr":"\uD835\uDD2B","ngE":"\u2267\u0338","nge":"\u2271","ngeq":"\u2271","ngeqq":"\u2267\u0338","ngeqslant":"\u2A7E\u0338","nges":"\u2A7E\u0338","nGg":"\u22D9\u0338","ngsim":"\u2275","nGt":"\u226B\u20D2","ngt":"\u226F","ngtr":"\u226F","nGtv":"\u226B\u0338","nharr":"\u21AE","nhArr":"\u21CE","nhpar":"\u2AF2","ni":"\u220B","nis":"\u22FC","nisd":"\u22FA","niv":"\u220B","NJcy":"\u040A","njcy":"\u045A","nlarr":"\u219A","nlArr":"\u21CD","nldr":"\u2025","nlE":"\u2266\u0338","nle":"\u2270","nleftarrow":"\u219A","nLeftarrow":"\u21CD","nleftrightarrow":"\u21AE","nLeftrightarrow":"\u21CE","nleq":"\u2270","nleqq":"\u2266\u0338","nleqslant":"\u2A7D\u0338","nles":"\u2A7D\u0338","nless":"\u226E","nLl":"\u22D8\u0338","nlsim":"\u2274","nLt":"\u226A\u20D2","nlt":"\u226E","nltri":"\u22EA","nltrie":"\u22EC","nLtv":"\u226A\u0338","nmid":"\u2224","NoBreak":"\u2060","NonBreakingSpace":"\u00A0","nopf":"\uD835\uDD5F","Nopf":"\u2115","Not":"\u2AEC","not":"\u00AC","NotCongruent":"\u2262","NotCupCap":"\u226D","NotDoubleVerticalBar":"\u2226","NotElement":"\u2209","NotEqual":"\u2260","NotEqualTilde":"\u2242\u0338","NotExists":"\u2204","NotGreater":"\u226F","NotGreaterEqual":"\u2271","NotGreaterFullEqual":"\u2267\u0338","NotGreaterGreater":"\u226B\u0338","NotGreaterLess":"\u2279","NotGreaterSlantEqual":"\u2A7E\u0338","NotGreaterTilde":"\u2275","NotHumpDownHump":"\u224E\u0338","NotHumpEqual":"\u224F\u0338","notin":"\u2209","notindot":"\u22F5\u0338","notinE":"\u22F9\u0338","notinva":"\u2209","notinvb":"\u22F7","notinvc":"\u22F6","NotLeftTriangleBar":"\u29CF\u0338","NotLeftTriangle":"\u22EA","NotLeftTriangleEqual":"\u22EC","NotLess":"\u226E","NotLessEqual":"\u2270","NotLessGreater":"\u2278","NotLessLess":"\u226A\u0338","NotLessSlantEqual":"\u2A7D\u0338","NotLessTilde":"\u2274","NotNestedGreaterGreater":"\u2AA2\u0338","NotNestedLessLess":"\u2AA1\u0338","notni":"\u220C","notniva":"\u220C","notnivb":"\u22FE","notnivc":"\u22FD","NotPrecedes":"\u2280","NotPrecedesEqual":"\u2AAF\u0338","NotPrecedesSlantEqual":"\u22E0","NotReverseElement":"\u220C","NotRightTriangleBar":"\u29D0\u0338","NotRightTriangle":"\u22EB","NotRightTriangleEqual":"\u22ED","NotSquareSubset":"\u228F\u0338","NotSquareSubsetEqual":"\u22E2","NotSquareSuperset":"\u2290\u0338","NotSquareSupersetEqual":"\u22E3","NotSubset":"\u2282\u20D2","NotSubsetEqual":"\u2288","NotSucceeds":"\u2281","NotSucceedsEqual":"\u2AB0\u0338","NotSucceedsSlantEqual":"\u22E1","NotSucceedsTilde":"\u227F\u0338","NotSuperset":"\u2283\u20D2","NotSupersetEqual":"\u2289","NotTilde":"\u2241","NotTildeEqual":"\u2244","NotTildeFullEqual":"\u2247","NotTildeTilde":"\u2249","NotVerticalBar":"\u2224","nparallel":"\u2226","npar":"\u2226","nparsl":"\u2AFD\u20E5","npart":"\u2202\u0338","npolint":"\u2A14","npr":"\u2280","nprcue":"\u22E0","nprec":"\u2280","npreceq":"\u2AAF\u0338","npre":"\u2AAF\u0338","nrarrc":"\u2933\u0338","nrarr":"\u219B","nrArr":"\u21CF","nrarrw":"\u219D\u0338","nrightarrow":"\u219B","nRightarrow":"\u21CF","nrtri":"\u22EB","nrtrie":"\u22ED","nsc":"\u2281","nsccue":"\u22E1","nsce":"\u2AB0\u0338","Nscr":"\uD835\uDCA9","nscr":"\uD835\uDCC3","nshortmid":"\u2224","nshortparallel":"\u2226","nsim":"\u2241","nsime":"\u2244","nsimeq":"\u2244","nsmid":"\u2224","nspar":"\u2226","nsqsube":"\u22E2","nsqsupe":"\u22E3","nsub":"\u2284","nsubE":"\u2AC5\u0338","nsube":"\u2288","nsubset":"\u2282\u20D2","nsubseteq":"\u2288","nsubseteqq":"\u2AC5\u0338","nsucc":"\u2281","nsucceq":"\u2AB0\u0338","nsup":"\u2285","nsupE":"\u2AC6\u0338","nsupe":"\u2289","nsupset":"\u2283\u20D2","nsupseteq":"\u2289","nsupseteqq":"\u2AC6\u0338","ntgl":"\u2279","Ntilde":"\u00D1","ntilde":"\u00F1","ntlg":"\u2278","ntriangleleft":"\u22EA","ntrianglelefteq":"\u22EC","ntriangleright":"\u22EB","ntrianglerighteq":"\u22ED","Nu":"\u039D","nu":"\u03BD","num":"#","numero":"\u2116","numsp":"\u2007","nvap":"\u224D\u20D2","nvdash":"\u22AC","nvDash":"\u22AD","nVdash":"\u22AE","nVDash":"\u22AF","nvge":"\u2265\u20D2","nvgt":">\u20D2","nvHarr":"\u2904","nvinfin":"\u29DE","nvlArr":"\u2902","nvle":"\u2264\u20D2","nvlt":"<\u20D2","nvltrie":"\u22B4\u20D2","nvrArr":"\u2903","nvrtrie":"\u22B5\u20D2","nvsim":"\u223C\u20D2","nwarhk":"\u2923","nwarr":"\u2196","nwArr":"\u21D6","nwarrow":"\u2196","nwnear":"\u2927","Oacute":"\u00D3","oacute":"\u00F3","oast":"\u229B","Ocirc":"\u00D4","ocirc":"\u00F4","ocir":"\u229A","Ocy":"\u041E","ocy":"\u043E","odash":"\u229D","Odblac":"\u0150","odblac":"\u0151","odiv":"\u2A38","odot":"\u2299","odsold":"\u29BC","OElig":"\u0152","oelig":"\u0153","ofcir":"\u29BF","Ofr":"\uD835\uDD12","ofr":"\uD835\uDD2C","ogon":"\u02DB","Ograve":"\u00D2","ograve":"\u00F2","ogt":"\u29C1","ohbar":"\u29B5","ohm":"\u03A9","oint":"\u222E","olarr":"\u21BA","olcir":"\u29BE","olcross":"\u29BB","oline":"\u203E","olt":"\u29C0","Omacr":"\u014C","omacr":"\u014D","Omega":"\u03A9","omega":"\u03C9","Omicron":"\u039F","omicron":"\u03BF","omid":"\u29B6","ominus":"\u2296","Oopf":"\uD835\uDD46","oopf":"\uD835\uDD60","opar":"\u29B7","OpenCurlyDoubleQuote":"\u201C","OpenCurlyQuote":"\u2018","operp":"\u29B9","oplus":"\u2295","orarr":"\u21BB","Or":"\u2A54","or":"\u2228","ord":"\u2A5D","order":"\u2134","orderof":"\u2134","ordf":"\u00AA","ordm":"\u00BA","origof":"\u22B6","oror":"\u2A56","orslope":"\u2A57","orv":"\u2A5B","oS":"\u24C8","Oscr":"\uD835\uDCAA","oscr":"\u2134","Oslash":"\u00D8","oslash":"\u00F8","osol":"\u2298","Otilde":"\u00D5","otilde":"\u00F5","otimesas":"\u2A36","Otimes":"\u2A37","otimes":"\u2297","Ouml":"\u00D6","ouml":"\u00F6","ovbar":"\u233D","OverBar":"\u203E","OverBrace":"\u23DE","OverBracket":"\u23B4","OverParenthesis":"\u23DC","para":"\u00B6","parallel":"\u2225","par":"\u2225","parsim":"\u2AF3","parsl":"\u2AFD","part":"\u2202","PartialD":"\u2202","Pcy":"\u041F","pcy":"\u043F","percnt":"%","period":".","permil":"\u2030","perp":"\u22A5","pertenk":"\u2031","Pfr":"\uD835\uDD13","pfr":"\uD835\uDD2D","Phi":"\u03A6","phi":"\u03C6","phiv":"\u03D5","phmmat":"\u2133","phone":"\u260E","Pi":"\u03A0","pi":"\u03C0","pitchfork":"\u22D4","piv":"\u03D6","planck":"\u210F","planckh":"\u210E","plankv":"\u210F","plusacir":"\u2A23","plusb":"\u229E","pluscir":"\u2A22","plus":"+","plusdo":"\u2214","plusdu":"\u2A25","pluse":"\u2A72","PlusMinus":"\u00B1","plusmn":"\u00B1","plussim":"\u2A26","plustwo":"\u2A27","pm":"\u00B1","Poincareplane":"\u210C","pointint":"\u2A15","popf":"\uD835\uDD61","Popf":"\u2119","pound":"\u00A3","prap":"\u2AB7","Pr":"\u2ABB","pr":"\u227A","prcue":"\u227C","precapprox":"\u2AB7","prec":"\u227A","preccurlyeq":"\u227C","Precedes":"\u227A","PrecedesEqual":"\u2AAF","PrecedesSlantEqual":"\u227C","PrecedesTilde":"\u227E","preceq":"\u2AAF","precnapprox":"\u2AB9","precneqq":"\u2AB5","precnsim":"\u22E8","pre":"\u2AAF","prE":"\u2AB3","precsim":"\u227E","prime":"\u2032","Prime":"\u2033","primes":"\u2119","prnap":"\u2AB9","prnE":"\u2AB5","prnsim":"\u22E8","prod":"\u220F","Product":"\u220F","profalar":"\u232E","profline":"\u2312","profsurf":"\u2313","prop":"\u221D","Proportional":"\u221D","Proportion":"\u2237","propto":"\u221D","prsim":"\u227E","prurel":"\u22B0","Pscr":"\uD835\uDCAB","pscr":"\uD835\uDCC5","Psi":"\u03A8","psi":"\u03C8","puncsp":"\u2008","Qfr":"\uD835\uDD14","qfr":"\uD835\uDD2E","qint":"\u2A0C","qopf":"\uD835\uDD62","Qopf":"\u211A","qprime":"\u2057","Qscr":"\uD835\uDCAC","qscr":"\uD835\uDCC6","quaternions":"\u210D","quatint":"\u2A16","quest":"?","questeq":"\u225F","quot":"\"","QUOT":"\"","rAarr":"\u21DB","race":"\u223D\u0331","Racute":"\u0154","racute":"\u0155","radic":"\u221A","raemptyv":"\u29B3","rang":"\u27E9","Rang":"\u27EB","rangd":"\u2992","range":"\u29A5","rangle":"\u27E9","raquo":"\u00BB","rarrap":"\u2975","rarrb":"\u21E5","rarrbfs":"\u2920","rarrc":"\u2933","rarr":"\u2192","Rarr":"\u21A0","rArr":"\u21D2","rarrfs":"\u291E","rarrhk":"\u21AA","rarrlp":"\u21AC","rarrpl":"\u2945","rarrsim":"\u2974","Rarrtl":"\u2916","rarrtl":"\u21A3","rarrw":"\u219D","ratail":"\u291A","rAtail":"\u291C","ratio":"\u2236","rationals":"\u211A","rbarr":"\u290D","rBarr":"\u290F","RBarr":"\u2910","rbbrk":"\u2773","rbrace":"}","rbrack":"]","rbrke":"\u298C","rbrksld":"\u298E","rbrkslu":"\u2990","Rcaron":"\u0158","rcaron":"\u0159","Rcedil":"\u0156","rcedil":"\u0157","rceil":"\u2309","rcub":"}","Rcy":"\u0420","rcy":"\u0440","rdca":"\u2937","rdldhar":"\u2969","rdquo":"\u201D","rdquor":"\u201D","rdsh":"\u21B3","real":"\u211C","realine":"\u211B","realpart":"\u211C","reals":"\u211D","Re":"\u211C","rect":"\u25AD","reg":"\u00AE","REG":"\u00AE","ReverseElement":"\u220B","ReverseEquilibrium":"\u21CB","ReverseUpEquilibrium":"\u296F","rfisht":"\u297D","rfloor":"\u230B","rfr":"\uD835\uDD2F","Rfr":"\u211C","rHar":"\u2964","rhard":"\u21C1","rharu":"\u21C0","rharul":"\u296C","Rho":"\u03A1","rho":"\u03C1","rhov":"\u03F1","RightAngleBracket":"\u27E9","RightArrowBar":"\u21E5","rightarrow":"\u2192","RightArrow":"\u2192","Rightarrow":"\u21D2","RightArrowLeftArrow":"\u21C4","rightarrowtail":"\u21A3","RightCeiling":"\u2309","RightDoubleBracket":"\u27E7","RightDownTeeVector":"\u295D","RightDownVectorBar":"\u2955","RightDownVector":"\u21C2","RightFloor":"\u230B","rightharpoondown":"\u21C1","rightharpoonup":"\u21C0","rightleftarrows":"\u21C4","rightleftharpoons":"\u21CC","rightrightarrows":"\u21C9","rightsquigarrow":"\u219D","RightTeeArrow":"\u21A6","RightTee":"\u22A2","RightTeeVector":"\u295B","rightthreetimes":"\u22CC","RightTriangleBar":"\u29D0","RightTriangle":"\u22B3","RightTriangleEqual":"\u22B5","RightUpDownVector":"\u294F","RightUpTeeVector":"\u295C","RightUpVectorBar":"\u2954","RightUpVector":"\u21BE","RightVectorBar":"\u2953","RightVector":"\u21C0","ring":"\u02DA","risingdotseq":"\u2253","rlarr":"\u21C4","rlhar":"\u21CC","rlm":"\u200F","rmoustache":"\u23B1","rmoust":"\u23B1","rnmid":"\u2AEE","roang":"\u27ED","roarr":"\u21FE","robrk":"\u27E7","ropar":"\u2986","ropf":"\uD835\uDD63","Ropf":"\u211D","roplus":"\u2A2E","rotimes":"\u2A35","RoundImplies":"\u2970","rpar":")","rpargt":"\u2994","rppolint":"\u2A12","rrarr":"\u21C9","Rrightarrow":"\u21DB","rsaquo":"\u203A","rscr":"\uD835\uDCC7","Rscr":"\u211B","rsh":"\u21B1","Rsh":"\u21B1","rsqb":"]","rsquo":"\u2019","rsquor":"\u2019","rthree":"\u22CC","rtimes":"\u22CA","rtri":"\u25B9","rtrie":"\u22B5","rtrif":"\u25B8","rtriltri":"\u29CE","RuleDelayed":"\u29F4","ruluhar":"\u2968","rx":"\u211E","Sacute":"\u015A","sacute":"\u015B","sbquo":"\u201A","scap":"\u2AB8","Scaron":"\u0160","scaron":"\u0161","Sc":"\u2ABC","sc":"\u227B","sccue":"\u227D","sce":"\u2AB0","scE":"\u2AB4","Scedil":"\u015E","scedil":"\u015F","Scirc":"\u015C","scirc":"\u015D","scnap":"\u2ABA","scnE":"\u2AB6","scnsim":"\u22E9","scpolint":"\u2A13","scsim":"\u227F","Scy":"\u0421","scy":"\u0441","sdotb":"\u22A1","sdot":"\u22C5","sdote":"\u2A66","searhk":"\u2925","searr":"\u2198","seArr":"\u21D8","searrow":"\u2198","sect":"\u00A7","semi":";","seswar":"\u2929","setminus":"\u2216","setmn":"\u2216","sext":"\u2736","Sfr":"\uD835\uDD16","sfr":"\uD835\uDD30","sfrown":"\u2322","sharp":"\u266F","SHCHcy":"\u0429","shchcy":"\u0449","SHcy":"\u0428","shcy":"\u0448","ShortDownArrow":"\u2193","ShortLeftArrow":"\u2190","shortmid":"\u2223","shortparallel":"\u2225","ShortRightArrow":"\u2192","ShortUpArrow":"\u2191","shy":"\u00AD","Sigma":"\u03A3","sigma":"\u03C3","sigmaf":"\u03C2","sigmav":"\u03C2","sim":"\u223C","simdot":"\u2A6A","sime":"\u2243","simeq":"\u2243","simg":"\u2A9E","simgE":"\u2AA0","siml":"\u2A9D","simlE":"\u2A9F","simne":"\u2246","simplus":"\u2A24","simrarr":"\u2972","slarr":"\u2190","SmallCircle":"\u2218","smallsetminus":"\u2216","smashp":"\u2A33","smeparsl":"\u29E4","smid":"\u2223","smile":"\u2323","smt":"\u2AAA","smte":"\u2AAC","smtes":"\u2AAC\uFE00","SOFTcy":"\u042C","softcy":"\u044C","solbar":"\u233F","solb":"\u29C4","sol":"/","Sopf":"\uD835\uDD4A","sopf":"\uD835\uDD64","spades":"\u2660","spadesuit":"\u2660","spar":"\u2225","sqcap":"\u2293","sqcaps":"\u2293\uFE00","sqcup":"\u2294","sqcups":"\u2294\uFE00","Sqrt":"\u221A","sqsub":"\u228F","sqsube":"\u2291","sqsubset":"\u228F","sqsubseteq":"\u2291","sqsup":"\u2290","sqsupe":"\u2292","sqsupset":"\u2290","sqsupseteq":"\u2292","square":"\u25A1","Square":"\u25A1","SquareIntersection":"\u2293","SquareSubset":"\u228F","SquareSubsetEqual":"\u2291","SquareSuperset":"\u2290","SquareSupersetEqual":"\u2292","SquareUnion":"\u2294","squarf":"\u25AA","squ":"\u25A1","squf":"\u25AA","srarr":"\u2192","Sscr":"\uD835\uDCAE","sscr":"\uD835\uDCC8","ssetmn":"\u2216","ssmile":"\u2323","sstarf":"\u22C6","Star":"\u22C6","star":"\u2606","starf":"\u2605","straightepsilon":"\u03F5","straightphi":"\u03D5","strns":"\u00AF","sub":"\u2282","Sub":"\u22D0","subdot":"\u2ABD","subE":"\u2AC5","sube":"\u2286","subedot":"\u2AC3","submult":"\u2AC1","subnE":"\u2ACB","subne":"\u228A","subplus":"\u2ABF","subrarr":"\u2979","subset":"\u2282","Subset":"\u22D0","subseteq":"\u2286","subseteqq":"\u2AC5","SubsetEqual":"\u2286","subsetneq":"\u228A","subsetneqq":"\u2ACB","subsim":"\u2AC7","subsub":"\u2AD5","subsup":"\u2AD3","succapprox":"\u2AB8","succ":"\u227B","succcurlyeq":"\u227D","Succeeds":"\u227B","SucceedsEqual":"\u2AB0","SucceedsSlantEqual":"\u227D","SucceedsTilde":"\u227F","succeq":"\u2AB0","succnapprox":"\u2ABA","succneqq":"\u2AB6","succnsim":"\u22E9","succsim":"\u227F","SuchThat":"\u220B","sum":"\u2211","Sum":"\u2211","sung":"\u266A","sup1":"\u00B9","sup2":"\u00B2","sup3":"\u00B3","sup":"\u2283","Sup":"\u22D1","supdot":"\u2ABE","supdsub":"\u2AD8","supE":"\u2AC6","supe":"\u2287","supedot":"\u2AC4","Superset":"\u2283","SupersetEqual":"\u2287","suphsol":"\u27C9","suphsub":"\u2AD7","suplarr":"\u297B","supmult":"\u2AC2","supnE":"\u2ACC","supne":"\u228B","supplus":"\u2AC0","supset":"\u2283","Supset":"\u22D1","supseteq":"\u2287","supseteqq":"\u2AC6","supsetneq":"\u228B","supsetneqq":"\u2ACC","supsim":"\u2AC8","supsub":"\u2AD4","supsup":"\u2AD6","swarhk":"\u2926","swarr":"\u2199","swArr":"\u21D9","swarrow":"\u2199","swnwar":"\u292A","szlig":"\u00DF","Tab":"\t","target":"\u2316","Tau":"\u03A4","tau":"\u03C4","tbrk":"\u23B4","Tcaron":"\u0164","tcaron":"\u0165","Tcedil":"\u0162","tcedil":"\u0163","Tcy":"\u0422","tcy":"\u0442","tdot":"\u20DB","telrec":"\u2315","Tfr":"\uD835\uDD17","tfr":"\uD835\uDD31","there4":"\u2234","therefore":"\u2234","Therefore":"\u2234","Theta":"\u0398","theta":"\u03B8","thetasym":"\u03D1","thetav":"\u03D1","thickapprox":"\u2248","thicksim":"\u223C","ThickSpace":"\u205F\u200A","ThinSpace":"\u2009","thinsp":"\u2009","thkap":"\u2248","thksim":"\u223C","THORN":"\u00DE","thorn":"\u00FE","tilde":"\u02DC","Tilde":"\u223C","TildeEqual":"\u2243","TildeFullEqual":"\u2245","TildeTilde":"\u2248","timesbar":"\u2A31","timesb":"\u22A0","times":"\u00D7","timesd":"\u2A30","tint":"\u222D","toea":"\u2928","topbot":"\u2336","topcir":"\u2AF1","top":"\u22A4","Topf":"\uD835\uDD4B","topf":"\uD835\uDD65","topfork":"\u2ADA","tosa":"\u2929","tprime":"\u2034","trade":"\u2122","TRADE":"\u2122","triangle":"\u25B5","triangledown":"\u25BF","triangleleft":"\u25C3","trianglelefteq":"\u22B4","triangleq":"\u225C","triangleright":"\u25B9","trianglerighteq":"\u22B5","tridot":"\u25EC","trie":"\u225C","triminus":"\u2A3A","TripleDot":"\u20DB","triplus":"\u2A39","trisb":"\u29CD","tritime":"\u2A3B","trpezium":"\u23E2","Tscr":"\uD835\uDCAF","tscr":"\uD835\uDCC9","TScy":"\u0426","tscy":"\u0446","TSHcy":"\u040B","tshcy":"\u045B","Tstrok":"\u0166","tstrok":"\u0167","twixt":"\u226C","twoheadleftarrow":"\u219E","twoheadrightarrow":"\u21A0","Uacute":"\u00DA","uacute":"\u00FA","uarr":"\u2191","Uarr":"\u219F","uArr":"\u21D1","Uarrocir":"\u2949","Ubrcy":"\u040E","ubrcy":"\u045E","Ubreve":"\u016C","ubreve":"\u016D","Ucirc":"\u00DB","ucirc":"\u00FB","Ucy":"\u0423","ucy":"\u0443","udarr":"\u21C5","Udblac":"\u0170","udblac":"\u0171","udhar":"\u296E","ufisht":"\u297E","Ufr":"\uD835\uDD18","ufr":"\uD835\uDD32","Ugrave":"\u00D9","ugrave":"\u00F9","uHar":"\u2963","uharl":"\u21BF","uharr":"\u21BE","uhblk":"\u2580","ulcorn":"\u231C","ulcorner":"\u231C","ulcrop":"\u230F","ultri":"\u25F8","Umacr":"\u016A","umacr":"\u016B","uml":"\u00A8","UnderBar":"_","UnderBrace":"\u23DF","UnderBracket":"\u23B5","UnderParenthesis":"\u23DD","Union":"\u22C3","UnionPlus":"\u228E","Uogon":"\u0172","uogon":"\u0173","Uopf":"\uD835\uDD4C","uopf":"\uD835\uDD66","UpArrowBar":"\u2912","uparrow":"\u2191","UpArrow":"\u2191","Uparrow":"\u21D1","UpArrowDownArrow":"\u21C5","updownarrow":"\u2195","UpDownArrow":"\u2195","Updownarrow":"\u21D5","UpEquilibrium":"\u296E","upharpoonleft":"\u21BF","upharpoonright":"\u21BE","uplus":"\u228E","UpperLeftArrow":"\u2196","UpperRightArrow":"\u2197","upsi":"\u03C5","Upsi":"\u03D2","upsih":"\u03D2","Upsilon":"\u03A5","upsilon":"\u03C5","UpTeeArrow":"\u21A5","UpTee":"\u22A5","upuparrows":"\u21C8","urcorn":"\u231D","urcorner":"\u231D","urcrop":"\u230E","Uring":"\u016E","uring":"\u016F","urtri":"\u25F9","Uscr":"\uD835\uDCB0","uscr":"\uD835\uDCCA","utdot":"\u22F0","Utilde":"\u0168","utilde":"\u0169","utri":"\u25B5","utrif":"\u25B4","uuarr":"\u21C8","Uuml":"\u00DC","uuml":"\u00FC","uwangle":"\u29A7","vangrt":"\u299C","varepsilon":"\u03F5","varkappa":"\u03F0","varnothing":"\u2205","varphi":"\u03D5","varpi":"\u03D6","varpropto":"\u221D","varr":"\u2195","vArr":"\u21D5","varrho":"\u03F1","varsigma":"\u03C2","varsubsetneq":"\u228A\uFE00","varsubsetneqq":"\u2ACB\uFE00","varsupsetneq":"\u228B\uFE00","varsupsetneqq":"\u2ACC\uFE00","vartheta":"\u03D1","vartriangleleft":"\u22B2","vartriangleright":"\u22B3","vBar":"\u2AE8","Vbar":"\u2AEB","vBarv":"\u2AE9","Vcy":"\u0412","vcy":"\u0432","vdash":"\u22A2","vDash":"\u22A8","Vdash":"\u22A9","VDash":"\u22AB","Vdashl":"\u2AE6","veebar":"\u22BB","vee":"\u2228","Vee":"\u22C1","veeeq":"\u225A","vellip":"\u22EE","verbar":"|","Verbar":"\u2016","vert":"|","Vert":"\u2016","VerticalBar":"\u2223","VerticalLine":"|","VerticalSeparator":"\u2758","VerticalTilde":"\u2240","VeryThinSpace":"\u200A","Vfr":"\uD835\uDD19","vfr":"\uD835\uDD33","vltri":"\u22B2","vnsub":"\u2282\u20D2","vnsup":"\u2283\u20D2","Vopf":"\uD835\uDD4D","vopf":"\uD835\uDD67","vprop":"\u221D","vrtri":"\u22B3","Vscr":"\uD835\uDCB1","vscr":"\uD835\uDCCB","vsubnE":"\u2ACB\uFE00","vsubne":"\u228A\uFE00","vsupnE":"\u2ACC\uFE00","vsupne":"\u228B\uFE00","Vvdash":"\u22AA","vzigzag":"\u299A","Wcirc":"\u0174","wcirc":"\u0175","wedbar":"\u2A5F","wedge":"\u2227","Wedge":"\u22C0","wedgeq":"\u2259","weierp":"\u2118","Wfr":"\uD835\uDD1A","wfr":"\uD835\uDD34","Wopf":"\uD835\uDD4E","wopf":"\uD835\uDD68","wp":"\u2118","wr":"\u2240","wreath":"\u2240","Wscr":"\uD835\uDCB2","wscr":"\uD835\uDCCC","xcap":"\u22C2","xcirc":"\u25EF","xcup":"\u22C3","xdtri":"\u25BD","Xfr":"\uD835\uDD1B","xfr":"\uD835\uDD35","xharr":"\u27F7","xhArr":"\u27FA","Xi":"\u039E","xi":"\u03BE","xlarr":"\u27F5","xlArr":"\u27F8","xmap":"\u27FC","xnis":"\u22FB","xodot":"\u2A00","Xopf":"\uD835\uDD4F","xopf":"\uD835\uDD69","xoplus":"\u2A01","xotime":"\u2A02","xrarr":"\u27F6","xrArr":"\u27F9","Xscr":"\uD835\uDCB3","xscr":"\uD835\uDCCD","xsqcup":"\u2A06","xuplus":"\u2A04","xutri":"\u25B3","xvee":"\u22C1","xwedge":"\u22C0","Yacute":"\u00DD","yacute":"\u00FD","YAcy":"\u042F","yacy":"\u044F","Ycirc":"\u0176","ycirc":"\u0177","Ycy":"\u042B","ycy":"\u044B","yen":"\u00A5","Yfr":"\uD835\uDD1C","yfr":"\uD835\uDD36","YIcy":"\u0407","yicy":"\u0457","Yopf":"\uD835\uDD50","yopf":"\uD835\uDD6A","Yscr":"\uD835\uDCB4","yscr":"\uD835\uDCCE","YUcy":"\u042E","yucy":"\u044E","yuml":"\u00FF","Yuml":"\u0178","Zacute":"\u0179","zacute":"\u017A","Zcaron":"\u017D","zcaron":"\u017E","Zcy":"\u0417","zcy":"\u0437","Zdot":"\u017B","zdot":"\u017C","zeetrf":"\u2128","ZeroWidthSpace":"\u200B","Zeta":"\u0396","zeta":"\u03B6","zfr":"\uD835\uDD37","Zfr":"\u2128","ZHcy":"\u0416","zhcy":"\u0436","zigrarr":"\u21DD","zopf":"\uD835\uDD6B","Zopf":"\u2124","Zscr":"\uD835\uDCB5","zscr":"\uD835\uDCCF","zwj":"\u200D","zwnj":"\u200C"}
|
347 | },{}],4:[function(require,module,exports){
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 | var ParseError = require("./src/ParseError");
|
357 | var Settings = require("./src/Settings");
|
358 |
|
359 | var buildTree = require("./src/buildTree");
|
360 | var parseTree = require("./src/parseTree");
|
361 | var utils = require("./src/utils");
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 | var render = function(expression, baseNode, options) {
|
368 | utils.clearNode(baseNode);
|
369 |
|
370 | var settings = new Settings(options);
|
371 |
|
372 | var tree = parseTree(expression, settings);
|
373 | var node = buildTree(tree, expression, settings).toNode();
|
374 |
|
375 | baseNode.appendChild(node);
|
376 | };
|
377 |
|
378 |
|
379 |
|
380 | if (typeof document !== "undefined") {
|
381 | if (document.compatMode !== "CSS1Compat") {
|
382 | typeof console !== "undefined" && console.warn(
|
383 | "Warning: KaTeX doesn't work in quirks mode. Make sure your " +
|
384 | "website has a suitable doctype.");
|
385 |
|
386 | render = function() {
|
387 | throw new ParseError("KaTeX doesn't work in quirks mode.");
|
388 | };
|
389 | }
|
390 | }
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | var renderToString = function(expression, options) {
|
396 | var settings = new Settings(options);
|
397 |
|
398 | var tree = parseTree(expression, settings);
|
399 | return buildTree(tree, expression, settings).toMarkup();
|
400 | };
|
401 |
|
402 |
|
403 |
|
404 |
|
405 | var generateParseTree = function(expression, options) {
|
406 | var settings = new Settings(options);
|
407 | return parseTree(expression, settings);
|
408 | };
|
409 |
|
410 | module.exports = {
|
411 | render: render,
|
412 | renderToString: renderToString,
|
413 | |
414 |
|
415 |
|
416 |
|
417 |
|
418 | __parse: generateParseTree,
|
419 | ParseError: ParseError
|
420 | };
|
421 |
|
422 | },{"./src/ParseError":7,"./src/Settings":9,"./src/buildTree":14,"./src/parseTree":23,"./src/utils":25}],5:[function(require,module,exports){
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 | var matchAt = require("match-at");
|
437 |
|
438 | var ParseError = require("./ParseError");
|
439 |
|
440 |
|
441 | function Lexer(input) {
|
442 | this._input = input;
|
443 | }
|
444 |
|
445 |
|
446 | function Token(text, data, position) {
|
447 | this.text = text;
|
448 | this.data = data;
|
449 | this.position = position;
|
450 | }
|
451 |
|
452 |
|
453 |
|
454 | var mathNormals = [
|
455 | /[/|@.""`0-9a-zA-Z]/,
|
456 | /[*+-]/,
|
457 | /[=<>:]/, // rels
|
458 | /[,;]/, // punctuation
|
459 | /['\^_{}]/, // misc
|
460 | /[(\[]/, // opens
|
461 | /[)\]?!]/, // closes
|
462 | /~/, // spacing
|
463 | /&/, // horizontal alignment
|
464 | /\\\\/ // line break
|
465 | ];
|
466 |
|
467 | // These are "normal" tokens like above, but should instead be parsed in text
|
468 | // mode.
|
469 | var textNormals = [
|
470 | /[a-zA-Z0-9`!@*()-=+\[\]'";:?\/.,]/, // ords
|
471 | /[{}]/, // grouping
|
472 | /~/, // spacing
|
473 | /&/, // horizontal alignment
|
474 | /\\\\/ // line break
|
475 | ];
|
476 |
|
477 | // Regexes for matching whitespace
|
478 | var whitespaceRegex = /\s*/;
|
479 | var whitespaceConcatRegex = / +|\\ +/;
|
480 |
|
481 | // This regex matches any other TeX function, which is a backslash followed by a
|
482 | // word or a single symbol
|
483 | var anyFunc = /\\(?:[a-zA-Z]+|.)/;
|
484 |
|
485 | /**
|
486 | * This function lexes a single normal token. It takes a position, a list of
|
487 | * "normal" tokens to try, and whether it should completely ignore whitespace or
|
488 | * not.
|
489 | */
|
490 | Lexer.prototype._innerLex = function(pos, normals, ignoreWhitespace) {
|
491 | var input = this._input;
|
492 | var whitespace;
|
493 |
|
494 | if (ignoreWhitespace) {
|
495 | // Get rid of whitespace.
|
496 | whitespace = matchAt(whitespaceRegex, input, pos)[0];
|
497 | pos += whitespace.length;
|
498 | } else {
|
499 | // Do the funky concatenation of whitespace that happens in text mode.
|
500 | whitespace = matchAt(whitespaceConcatRegex, input, pos);
|
501 | if (whitespace !== null) {
|
502 | return new Token(" ", null, pos + whitespace[0].length);
|
503 | }
|
504 | }
|
505 |
|
506 | // If there's no more input to parse, return an EOF token
|
507 | if (pos === input.length) {
|
508 | return new Token("EOF", null, pos);
|
509 | }
|
510 |
|
511 | var match;
|
512 | if ((match = matchAt(anyFunc, input, pos))) {
|
513 | // If we match a function token, return it
|
514 | return new Token(match[0], null, pos + match[0].length);
|
515 | } else {
|
516 | // Otherwise, we look through the normal token regexes and see if it's
|
517 | // one of them.
|
518 | for (var i = 0; i < normals.length; i++) {
|
519 | var normal = normals[i];
|
520 |
|
521 | if ((match = matchAt(normal, input, pos))) {
|
522 | // If it is, return it
|
523 | return new Token(
|
524 | match[0], null, pos + match[0].length);
|
525 | }
|
526 | }
|
527 | }
|
528 |
|
529 | throw new ParseError(
|
530 | "Unexpected character: '" + input[pos] + "'",
|
531 | this, pos);
|
532 | };
|
533 |
|
534 | // A regex to match a CSS color (like #ffffff or BlueViolet)
|
535 | var cssColor = /#[a-z0-9]+|[a-z]+/i;
|
536 |
|
537 | /**
|
538 | * This function lexes a CSS color.
|
539 | */
|
540 | Lexer.prototype._innerLexColor = function(pos) {
|
541 | var input = this._input;
|
542 |
|
543 | // Ignore whitespace
|
544 | var whitespace = matchAt(whitespaceRegex, input, pos)[0];
|
545 | pos += whitespace.length;
|
546 |
|
547 | var match;
|
548 | if ((match = matchAt(cssColor, input, pos))) {
|
549 | // If we look like a color, return a color
|
550 | return new Token(match[0], null, pos + match[0].length);
|
551 | } else {
|
552 | throw new ParseError("Invalid color", this, pos);
|
553 | }
|
554 | };
|
555 |
|
556 | // A regex to match a dimension. Dimensions look like
|
557 | // "1.2em" or ".4pt" or "1 ex"
|
558 | var sizeRegex = /(-?)\s*(\d+(?:\.\d*)?|\.\d+)\s*([a-z]{2})/;
|
559 |
|
560 | /**
|
561 | * This function lexes a dimension.
|
562 | */
|
563 | Lexer.prototype._innerLexSize = function(pos) {
|
564 | var input = this._input;
|
565 |
|
566 | // Ignore whitespace
|
567 | var whitespace = matchAt(whitespaceRegex, input, pos)[0];
|
568 | pos += whitespace.length;
|
569 |
|
570 | var match;
|
571 | if ((match = matchAt(sizeRegex, input, pos))) {
|
572 | var unit = match[3];
|
573 | // We only currently handle "em" and "ex" units
|
574 | if (unit !== "em" && unit !== "ex") {
|
575 | throw new ParseError("Invalid unit: '" + unit + "'", this, pos);
|
576 | }
|
577 | return new Token(match[0], {
|
578 | number: +(match[1] + match[2]),
|
579 | unit: unit
|
580 | }, pos + match[0].length);
|
581 | }
|
582 |
|
583 | throw new ParseError("Invalid size", this, pos);
|
584 | };
|
585 |
|
586 | /**
|
587 | * This function lexes a string of whitespace.
|
588 | */
|
589 | Lexer.prototype._innerLexWhitespace = function(pos) {
|
590 | var input = this._input;
|
591 |
|
592 | var whitespace = matchAt(whitespaceRegex, input, pos)[0];
|
593 | pos += whitespace.length;
|
594 |
|
595 | return new Token(whitespace[0], null, pos);
|
596 | };
|
597 |
|
598 | /**
|
599 | * This function lexes a single token starting at `pos` and of the given mode.
|
600 | * Based on the mode, we defer to one of the `_innerLex` functions.
|
601 | */
|
602 | Lexer.prototype.lex = function(pos, mode) {
|
603 | if (mode === "math") {
|
604 | return this._innerLex(pos, mathNormals, true);
|
605 | } else if (mode === "text") {
|
606 | return this._innerLex(pos, textNormals, false);
|
607 | } else if (mode === "color") {
|
608 | return this._innerLexColor(pos);
|
609 | } else if (mode === "size") {
|
610 | return this._innerLexSize(pos);
|
611 | } else if (mode === "whitespace") {
|
612 | return this._innerLexWhitespace(pos);
|
613 | }
|
614 | };
|
615 |
|
616 | module.exports = Lexer;
|
617 |
|
618 | },{"./ParseError":7,"match-at":80}],6:[function(require,module,exports){
|
619 | /**
|
620 | * This file contains information about the options that the Parser carries
|
621 | * around with it while parsing. Data is held in an `Options` object, and when
|
622 | * recursing, a new `Options` object can be created with the `.with*` and
|
623 | * `.reset` functions.
|
624 | */
|
625 |
|
626 | /**
|
627 | * This is the main options class. It contains the style, size, color, and font
|
628 | * of the current parse level. It also contains the style and size of the parent
|
629 | * parse level, so size changes can be handled efficiently.
|
630 | *
|
631 | * Each of the `.with*` and `.reset` functions passes its current style and size
|
632 | * as the parentStyle and parentSize of the new options class, so parent
|
633 | * handling is taken care of automatically.
|
634 | */
|
635 | function Options(data) {
|
636 | this.style = data.style;
|
637 | this.color = data.color;
|
638 | this.size = data.size;
|
639 | this.phantom = data.phantom;
|
640 | this.font = data.font;
|
641 |
|
642 | if (data.parentStyle === undefined) {
|
643 | this.parentStyle = data.style;
|
644 | } else {
|
645 | this.parentStyle = data.parentStyle;
|
646 | }
|
647 |
|
648 | if (data.parentSize === undefined) {
|
649 | this.parentSize = data.size;
|
650 | } else {
|
651 | this.parentSize = data.parentSize;
|
652 | }
|
653 | }
|
654 |
|
655 | /**
|
656 | * Returns a new options object with the same properties as "this". Properties
|
657 | * from "extension" will be copied to the new options object.
|
658 | */
|
659 | Options.prototype.extend = function(extension) {
|
660 | var data = {
|
661 | style: this.style,
|
662 | size: this.size,
|
663 | color: this.color,
|
664 | parentStyle: this.style,
|
665 | parentSize: this.size,
|
666 | phantom: this.phantom,
|
667 | font: this.font
|
668 | };
|
669 |
|
670 | for (var key in extension) {
|
671 | if (extension.hasOwnProperty(key)) {
|
672 | data[key] = extension[key];
|
673 | }
|
674 | }
|
675 |
|
676 | return new Options(data);
|
677 | };
|
678 |
|
679 | /**
|
680 | * Create a new options object with the given style.
|
681 | */
|
682 | Options.prototype.withStyle = function(style) {
|
683 | return this.extend({
|
684 | style: style
|
685 | });
|
686 | };
|
687 |
|
688 | /**
|
689 | * Create a new options object with the given size.
|
690 | */
|
691 | Options.prototype.withSize = function(size) {
|
692 | return this.extend({
|
693 | size: size
|
694 | });
|
695 | };
|
696 |
|
697 | /**
|
698 | * Create a new options object with the given color.
|
699 | */
|
700 | Options.prototype.withColor = function(color) {
|
701 | return this.extend({
|
702 | color: color
|
703 | });
|
704 | };
|
705 |
|
706 | /**
|
707 | * Create a new options object with "phantom" set to true.
|
708 | */
|
709 | Options.prototype.withPhantom = function() {
|
710 | return this.extend({
|
711 | phantom: true
|
712 | });
|
713 | };
|
714 |
|
715 | /**
|
716 | * Create a new options objects with the give font.
|
717 | */
|
718 | Options.prototype.withFont = function(font) {
|
719 | return this.extend({
|
720 | font: font
|
721 | });
|
722 | };
|
723 |
|
724 | /**
|
725 | * Create a new options object with the same style, size, and color. This is
|
726 | * used so that parent style and size changes are handled correctly.
|
727 | */
|
728 | Options.prototype.reset = function() {
|
729 | return this.extend({});
|
730 | };
|
731 |
|
732 | /**
|
733 | * A map of color names to CSS colors.
|
734 | * TODO(emily): Remove this when we have real macros
|
735 | */
|
736 | var colorMap = {
|
737 | "katex-blue": "#6495ed",
|
738 | "katex-orange": "#ffa500",
|
739 | "katex-pink": "#ff00af",
|
740 | "katex-red": "#df0030",
|
741 | "katex-green": "#28ae7b",
|
742 | "katex-gray": "gray",
|
743 | "katex-purple": "#9d38bd",
|
744 | "katex-blueA": "#c7e9f1",
|
745 | "katex-blueB": "#9cdceb",
|
746 | "katex-blueC": "#58c4dd",
|
747 | "katex-blueD": "#29abca",
|
748 | "katex-blueE": "#1c758a",
|
749 | "katex-tealA": "#acead7",
|
750 | "katex-tealB": "#76ddc0",
|
751 | "katex-tealC": "#5cd0b3",
|
752 | "katex-tealD": "#55c1a7",
|
753 | "katex-tealE": "#49a88f",
|
754 | "katex-greenA": "#c9e2ae",
|
755 | "katex-greenB": "#a6cf8c",
|
756 | "katex-greenC": "#83c167",
|
757 | "katex-greenD": "#77b05d",
|
758 | "katex-greenE": "#699c52",
|
759 | "katex-goldA": "#f7c797",
|
760 | "katex-goldB": "#f9b775",
|
761 | "katex-goldC": "#f0ac5f",
|
762 | "katex-goldD": "#e1a158",
|
763 | "katex-goldE": "#c78d46",
|
764 | "katex-redA": "#f7a1a3",
|
765 | "katex-redB": "#ff8080",
|
766 | "katex-redC": "#fc6255",
|
767 | "katex-redD": "#e65a4c",
|
768 | "katex-redE": "#cf5044",
|
769 | "katex-maroonA": "#ecabc1",
|
770 | "katex-maroonB": "#ec92ab",
|
771 | "katex-maroonC": "#c55f73",
|
772 | "katex-maroonD": "#a24d61",
|
773 | "katex-maroonE": "#94424f",
|
774 | "katex-purpleA": "#caa3e8",
|
775 | "katex-purpleB": "#b189c6",
|
776 | "katex-purpleC": "#9a72ac",
|
777 | "katex-purpleD": "#715582",
|
778 | "katex-purpleE": "#644172",
|
779 | "katex-mintA": "#f5f9e8",
|
780 | "katex-mintB": "#edf2df",
|
781 | "katex-mintC": "#e0e5cc",
|
782 | "katex-grayA": "#fdfdfd",
|
783 | "katex-grayB": "#f7f7f7",
|
784 | "katex-grayC": "#eeeeee",
|
785 | "katex-grayD": "#dddddd",
|
786 | "katex-grayE": "#cccccc",
|
787 | "katex-grayF": "#aaaaaa",
|
788 | "katex-grayG": "#999999",
|
789 | "katex-grayH": "#555555",
|
790 | "katex-grayI": "#333333",
|
791 | "katex-kaBlue": "#314453",
|
792 | "katex-kaGreen": "#639b24"
|
793 | };
|
794 |
|
795 | /**
|
796 | * Gets the CSS color of the current options object, accounting for the
|
797 | * `colorMap`.
|
798 | */
|
799 | Options.prototype.getColor = function() {
|
800 | if (this.phantom) {
|
801 | return "transparent";
|
802 | } else {
|
803 | return colorMap[this.color] || this.color;
|
804 | }
|
805 | };
|
806 |
|
807 | module.exports = Options;
|
808 |
|
809 | },{}],7:[function(require,module,exports){
|
810 | /**
|
811 | * This is the ParseError class, which is the main error thrown by KaTeX
|
812 | * functions when something has gone wrong. This is used to distinguish internal
|
813 | * errors from errors in the expression that the user provided.
|
814 | */
|
815 | function ParseError(message, lexer, position) {
|
816 | var error = "KaTeX parse error: " + message;
|
817 |
|
818 | if (lexer !== undefined && position !== undefined) {
|
819 | // If we have the input and a position, make the error a bit fancier
|
820 |
|
821 | // Prepend some information
|
822 | error += " at position " + position + ": ";
|
823 |
|
824 | // Get the input
|
825 | var input = lexer._input;
|
826 | // Insert a combining underscore at the correct position
|
827 | input = input.slice(0, position) + "\u0332" +
|
828 | input.slice(position);
|
829 |
|
830 | // Extract some context from the input and add it to the error
|
831 | var begin = Math.max(0, position - 15);
|
832 | var end = position + 15;
|
833 | error += input.slice(begin, end);
|
834 | }
|
835 |
|
836 | // Some hackery to make ParseError a prototype of Error
|
837 | // See http://stackoverflow.com/a/8460753
|
838 | var self = new Error(error);
|
839 | self.name = "ParseError";
|
840 | self.__proto__ = ParseError.prototype;
|
841 |
|
842 | self.position = position;
|
843 | return self;
|
844 | }
|
845 |
|
846 | // More hackery
|
847 | ParseError.prototype.__proto__ = Error.prototype;
|
848 |
|
849 | module.exports = ParseError;
|
850 |
|
851 | },{}],8:[function(require,module,exports){
|
852 | var functions = require("./functions");
|
853 | var environments = require("./environments");
|
854 | var Lexer = require("./Lexer");
|
855 | var symbols = require("./symbols");
|
856 | var utils = require("./utils");
|
857 |
|
858 | var parseData = require("./parseData");
|
859 | var ParseError = require("./ParseError");
|
860 |
|
861 | /**
|
862 | * This file contains the parser used to parse out a TeX expression from the
|
863 | * input. Since TeX isn't context-free, standard parsers don't work particularly
|
864 | * well.
|
865 | *
|
866 | * The strategy of this parser is as such:
|
867 | *
|
868 | * The main functions (the `.parse...` ones) take a position in the current
|
869 | * parse string to parse tokens from. The lexer (found in Lexer.js, stored at
|
870 | * this.lexer) also supports pulling out tokens at arbitrary places. When
|
871 | * individual tokens are needed at a position, the lexer is called to pull out a
|
872 | * token, which is then used.
|
873 | *
|
874 | * The main functions also take a mode that the parser is currently in
|
875 | * (currently "math" or "text"), which denotes whether the current environment
|
876 | * is a math-y one or a text-y one (e.g. inside \text). Currently, this serves
|
877 | * to limit the functions which can be used in text mode.
|
878 | *
|
879 | * The main functions then return an object which contains the useful data that
|
880 | * was parsed at its given point, and a new position at the end of the parsed
|
881 | * data. The main functions can call each other and continue the parsing by
|
882 | * using the returned position as a new starting point.
|
883 | *
|
884 | * There are also extra `.handle...` functions, which pull out some reused
|
885 | * functionality into self-contained functions.
|
886 | *
|
887 | * The earlier functions return `ParseResult`s, which contain a ParseNode and a
|
888 | * new position.
|
889 | *
|
890 | * The later functions (which are called deeper in the parse) sometimes return
|
891 | * ParseFuncOrArgument, which contain a ParseResult as well as some data about
|
892 | * whether the parsed object is a function which is missing some arguments, or a
|
893 | * standalone object which can be used as an argument to another function.
|
894 | */
|
895 |
|
896 | /**
|
897 | * Main Parser class
|
898 | */
|
899 | function Parser(input, settings) {
|
900 | // Make a new lexer
|
901 | this.lexer = new Lexer(input);
|
902 | // Store the settings for use in parsing
|
903 | this.settings = settings;
|
904 | }
|
905 |
|
906 | var ParseNode = parseData.ParseNode;
|
907 | var ParseResult = parseData.ParseResult;
|
908 |
|
909 | /**
|
910 | * An initial function (without its arguments), or an argument to a function.
|
911 | * The `result` argument should be a ParseResult.
|
912 | */
|
913 | function ParseFuncOrArgument(result, isFunction) {
|
914 | this.result = result;
|
915 | // Is this a function (i.e. is it something defined in functions.js)?
|
916 | this.isFunction = isFunction;
|
917 | }
|
918 |
|
919 | /**
|
920 | * Checks a result to make sure it has the right type, and throws an
|
921 | * appropriate error otherwise.
|
922 | */
|
923 | Parser.prototype.expect = function(result, text) {
|
924 | if (result.text !== text) {
|
925 | throw new ParseError(
|
926 | "Expected '" + text + "', got '" + result.text + "'",
|
927 | this.lexer, result.position
|
928 | );
|
929 | }
|
930 | };
|
931 |
|
932 | /**
|
933 | * Main parsing function, which parses an entire input.
|
934 | *
|
935 | * @return {?Array.<ParseNode>}
|
936 | */
|
937 | Parser.prototype.parse = function(input) {
|
938 | // Try to parse the input
|
939 | var parse = this.parseInput(0, "math");
|
940 | return parse.result;
|
941 | };
|
942 |
|
943 | /**
|
944 | * Parses an entire input tree.
|
945 | */
|
946 | Parser.prototype.parseInput = function(pos, mode) {
|
947 | // Parse an expression
|
948 | var expression = this.parseExpression(pos, mode, false);
|
949 | // If we succeeded, make sure there's an EOF at the end
|
950 | this.expect(expression.peek, "EOF");
|
951 | return expression;
|
952 | };
|
953 |
|
954 | var endOfExpression = ["}", "\\end", "\\right", "&", "\\\\", "\\cr"];
|
955 |
|
956 | /**
|
957 | * Parses an "expression", which is a list of atoms.
|
958 | *
|
959 | * @param {boolean} breakOnInfix Should the parsing stop when we hit infix
|
960 | * nodes? This happens when functions have higher precendence
|
961 | * than infix nodes in implicit parses.
|
962 | *
|
963 | * @param {?string} breakOnToken The token that the expression should end with,
|
964 | * or `null` if something else should end the expression.
|
965 | *
|
966 | * @return {ParseResult}
|
967 | */
|
968 | Parser.prototype.parseExpression = function(pos, mode, breakOnInfix, breakOnToken) {
|
969 | var body = [];
|
970 | var lex = null;
|
971 | // Keep adding atoms to the body until we can't parse any more atoms (either
|
972 | // we reached the end, a }, or a \right)
|
973 | while (true) {
|
974 | lex = this.lexer.lex(pos, mode);
|
975 | if (endOfExpression.indexOf(lex.text) !== -1) {
|
976 | break;
|
977 | }
|
978 | if (breakOnToken && lex.text === breakOnToken) {
|
979 | break;
|
980 | }
|
981 | var atom = this.parseAtom(pos, mode);
|
982 | if (!atom) {
|
983 | if (!this.settings.throwOnError && lex.text[0] === "\\") {
|
984 | var errorNode = this.handleUnsupportedCmd(lex.text, mode);
|
985 | body.push(errorNode);
|
986 |
|
987 | pos = lex.position;
|
988 | continue;
|
989 | }
|
990 |
|
991 | break;
|
992 | }
|
993 | if (breakOnInfix && atom.result.type === "infix") {
|
994 | break;
|
995 | }
|
996 | body.push(atom.result);
|
997 | pos = atom.position;
|
998 | }
|
999 | var res = new ParseResult(this.handleInfixNodes(body, mode), pos);
|
1000 | res.peek = lex;
|
1001 | return res;
|
1002 | };
|
1003 |
|
1004 | /**
|
1005 | * Rewrites infix operators such as \over with corresponding commands such
|
1006 | * as \frac.
|
1007 | *
|
1008 | * There can only be one infix operator per group. If there's more than one
|
1009 | * then the expression is ambiguous. This can be resolved by adding {}.
|
1010 | *
|
1011 | * @returns {Array}
|
1012 | */
|
1013 | Parser.prototype.handleInfixNodes = function (body, mode) {
|
1014 | var overIndex = -1;
|
1015 | var func;
|
1016 | var funcName;
|
1017 |
|
1018 | for (var i = 0; i < body.length; i++) {
|
1019 | var node = body[i];
|
1020 | if (node.type === "infix") {
|
1021 | if (overIndex !== -1) {
|
1022 | throw new ParseError("only one infix operator per group",
|
1023 | this.lexer, -1);
|
1024 | }
|
1025 | overIndex = i;
|
1026 | funcName = node.value.replaceWith;
|
1027 | func = functions.funcs[funcName];
|
1028 | }
|
1029 | }
|
1030 |
|
1031 | if (overIndex !== -1) {
|
1032 | var numerNode, denomNode;
|
1033 |
|
1034 | var numerBody = body.slice(0, overIndex);
|
1035 | var denomBody = body.slice(overIndex + 1);
|
1036 |
|
1037 | if (numerBody.length === 1 && numerBody[0].type === "ordgroup") {
|
1038 | numerNode = numerBody[0];
|
1039 | } else {
|
1040 | numerNode = new ParseNode("ordgroup", numerBody, mode);
|
1041 | }
|
1042 |
|
1043 | if (denomBody.length === 1 && denomBody[0].type === "ordgroup") {
|
1044 | denomNode = denomBody[0];
|
1045 | } else {
|
1046 | denomNode = new ParseNode("ordgroup", denomBody, mode);
|
1047 | }
|
1048 |
|
1049 | var value = func.handler(funcName, numerNode, denomNode);
|
1050 | return [new ParseNode(value.type, value, mode)];
|
1051 | } else {
|
1052 | return body;
|
1053 | }
|
1054 | };
|
1055 |
|
1056 | // The greediness of a superscript or subscript
|
1057 | var SUPSUB_GREEDINESS = 1;
|
1058 |
|
1059 | /**
|
1060 | * Handle a subscript or superscript with nice errors.
|
1061 | */
|
1062 | Parser.prototype.handleSupSubscript = function(pos, mode, symbol, name) {
|
1063 | var group = this.parseGroup(pos, mode);
|
1064 |
|
1065 | if (!group) {
|
1066 | var lex = this.lexer.lex(pos, mode);
|
1067 |
|
1068 | if (!this.settings.throwOnError && lex.text[0] === "\\") {
|
1069 | return new ParseResult(
|
1070 | this.handleUnsupportedCmd(lex.text, mode),
|
1071 | lex.position);
|
1072 | } else {
|
1073 | throw new ParseError(
|
1074 | "Expected group after '" + symbol + "'", this.lexer, pos);
|
1075 | }
|
1076 | } else if (group.isFunction) {
|
1077 | // ^ and _ have a greediness, so handle interactions with functions'
|
1078 | // greediness
|
1079 | var funcGreediness = functions.funcs[group.result.result].greediness;
|
1080 | if (funcGreediness > SUPSUB_GREEDINESS) {
|
1081 | return this.parseFunction(pos, mode);
|
1082 | } else {
|
1083 | throw new ParseError(
|
1084 | "Got function '" + group.result.result + "' with no arguments " +
|
1085 | "as " + name,
|
1086 | this.lexer, pos);
|
1087 | }
|
1088 | } else {
|
1089 | return group.result;
|
1090 | }
|
1091 | };
|
1092 |
|
1093 | /**
|
1094 | * Converts the textual input of an unsupported command into a text node
|
1095 | * contained within a color node whose color is determined by errorColor
|
1096 | */
|
1097 | Parser.prototype.handleUnsupportedCmd = function(text, mode) {
|
1098 | var textordArray = [];
|
1099 |
|
1100 | for (var i = 0; i < text.length; i++) {
|
1101 | textordArray.push(new ParseNode("textord", text[i], "text"));
|
1102 | }
|
1103 |
|
1104 | var textNode = new ParseNode(
|
1105 | "text",
|
1106 | {
|
1107 | body: textordArray,
|
1108 | type: "text"
|
1109 | },
|
1110 | mode);
|
1111 |
|
1112 | var colorNode = new ParseNode(
|
1113 | "color",
|
1114 | {
|
1115 | color: this.settings.errorColor,
|
1116 | value: [textNode],
|
1117 | type: "color"
|
1118 | },
|
1119 | mode);
|
1120 |
|
1121 | return colorNode;
|
1122 | };
|
1123 |
|
1124 | /**
|
1125 | * Parses a group with optional super/subscripts.
|
1126 | *
|
1127 | * @return {?ParseResult}
|
1128 | */
|
1129 | Parser.prototype.parseAtom = function(pos, mode) {
|
1130 | // The body of an atom is an implicit group, so that things like
|
1131 | // \left(x\right)^2 work correctly.
|
1132 | var base = this.parseImplicitGroup(pos, mode);
|
1133 |
|
1134 | // In text mode, we don't have superscripts or subscripts
|
1135 | if (mode === "text") {
|
1136 | return base;
|
1137 | }
|
1138 |
|
1139 | // Handle an empty base
|
1140 | var currPos;
|
1141 | if (!base) {
|
1142 | currPos = pos;
|
1143 | base = undefined;
|
1144 | } else {
|
1145 | currPos = base.position;
|
1146 | }
|
1147 |
|
1148 | var superscript;
|
1149 | var subscript;
|
1150 | var result;
|
1151 | while (true) {
|
1152 | // Lex the first token
|
1153 | var lex = this.lexer.lex(currPos, mode);
|
1154 |
|
1155 | if (lex.text === "\\limits" || lex.text === "\\nolimits") {
|
1156 | // We got a limit control
|
1157 | if (!base || base.result.type !== "op") {
|
1158 | throw new ParseError("Limit controls must follow a math operator",
|
1159 | this.lexer, currPos);
|
1160 | }
|
1161 | else {
|
1162 | var limits = lex.text === "\\limits";
|
1163 | base.result.value.limits = limits;
|
1164 | base.result.value.alwaysHandleSupSub = true;
|
1165 | currPos = lex.position;
|
1166 | }
|
1167 | } else if (lex.text === "^") {
|
1168 | // We got a superscript start
|
1169 | if (superscript) {
|
1170 | throw new ParseError(
|
1171 | "Double superscript", this.lexer, currPos);
|
1172 | }
|
1173 | result = this.handleSupSubscript(
|
1174 | lex.position, mode, lex.text, "superscript");
|
1175 | currPos = result.position;
|
1176 | superscript = result.result;
|
1177 | } else if (lex.text === "_") {
|
1178 | // We got a subscript start
|
1179 | if (subscript) {
|
1180 | throw new ParseError(
|
1181 | "Double subscript", this.lexer, currPos);
|
1182 | }
|
1183 | result = this.handleSupSubscript(
|
1184 | lex.position, mode, lex.text, "subscript");
|
1185 | currPos = result.position;
|
1186 | subscript = result.result;
|
1187 | } else if (lex.text === "'") {
|
1188 | // We got a prime
|
1189 | var prime = new ParseNode("textord", "\\prime", mode);
|
1190 |
|
1191 | // Many primes can be grouped together, so we handle this here
|
1192 | var primes = [prime];
|
1193 | currPos = lex.position;
|
1194 | // Keep lexing tokens until we get something that's not a prime
|
1195 | while ((lex = this.lexer.lex(currPos, mode)).text === "'") {
|
1196 | // For each one, add another prime to the list
|
1197 | primes.push(prime);
|
1198 | currPos = lex.position;
|
1199 | }
|
1200 | // Put them into an ordgroup as the superscript
|
1201 | superscript = new ParseNode("ordgroup", primes, mode);
|
1202 | } else {
|
1203 | // If it wasn't ^, _, or ', stop parsing super/subscripts
|
1204 | break;
|
1205 | }
|
1206 | }
|
1207 |
|
1208 | if (superscript || subscript) {
|
1209 | // If we got either a superscript or subscript, create a supsub
|
1210 | return new ParseResult(
|
1211 | new ParseNode("supsub", {
|
1212 | base: base && base.result,
|
1213 | sup: superscript,
|
1214 | sub: subscript
|
1215 | }, mode),
|
1216 | currPos);
|
1217 | } else {
|
1218 | // Otherwise return the original body
|
1219 | return base;
|
1220 | }
|
1221 | };
|
1222 |
|
1223 | // A list of the size-changing functions, for use in parseImplicitGroup
|
1224 | var sizeFuncs = [
|
1225 | "\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize",
|
1226 | "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"
|
1227 | ];
|
1228 |
|
1229 | // A list of the style-changing functions, for use in parseImplicitGroup
|
1230 | var styleFuncs = [
|
1231 | "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"
|
1232 | ];
|
1233 |
|
1234 | /**
|
1235 | * Parses an implicit group, which is a group that starts at the end of a
|
1236 | * specified, and ends right before a higher explicit group ends, or at EOL. It
|
1237 | * is used for functions that appear to affect the current style, like \Large or
|
1238 | * \textrm, where instead of keeping a style we just pretend that there is an
|
1239 | * implicit grouping after it until the end of the group. E.g.
|
1240 | * small text {\Large large text} small text again
|
1241 | * It is also used for \left and \right to get the correct grouping.
|
1242 | *
|
1243 | * @return {?ParseResult}
|
1244 | */
|
1245 | Parser.prototype.parseImplicitGroup = function(pos, mode) {
|
1246 | var start = this.parseSymbol(pos, mode);
|
1247 |
|
1248 | if (!start || !start.result) {
|
1249 | // If we didn't get anything we handle, fall back to parseFunction
|
1250 | return this.parseFunction(pos, mode);
|
1251 | }
|
1252 |
|
1253 | var func = start.result.result;
|
1254 | var body;
|
1255 |
|
1256 | if (func === "\\left") {
|
1257 | // If we see a left:
|
1258 | // Parse the entire left function (including the delimiter)
|
1259 | var left = this.parseFunction(pos, mode);
|
1260 | // Parse out the implicit body
|
1261 | body = this.parseExpression(left.position, mode, false);
|
1262 | // Check the next token
|
1263 | this.expect(body.peek, "\\right");
|
1264 | var right = this.parseFunction(body.position, mode);
|
1265 | return new ParseResult(
|
1266 | new ParseNode("leftright", {
|
1267 | body: body.result,
|
1268 | left: left.result.value.value,
|
1269 | right: right.result.value.value
|
1270 | }, mode),
|
1271 | right.position);
|
1272 | } else if (func === "\\begin") {
|
1273 | // begin...end is similar to left...right
|
1274 | var begin = this.parseFunction(pos, mode);
|
1275 | var envName = begin.result.value.name;
|
1276 | if (!environments.hasOwnProperty(envName)) {
|
1277 | throw new ParseError(
|
1278 | "No such environment: " + envName,
|
1279 | this.lexer, begin.result.value.namepos);
|
1280 | }
|
1281 | // Build the environment object. Arguments and other information will
|
1282 | // be made available to the begin and end methods using properties.
|
1283 | var env = environments[envName];
|
1284 | var args = [null, mode, envName];
|
1285 | var newPos = this.parseArguments(
|
1286 | begin.position, mode, "\\begin{" + envName + "}", env, args);
|
1287 | args[0] = newPos;
|
1288 | var result = env.handler.apply(this, args);
|
1289 | var endLex = this.lexer.lex(result.position, mode);
|
1290 | this.expect(endLex, "\\end");
|
1291 | var end = this.parseFunction(result.position, mode);
|
1292 | if (end.result.value.name !== envName) {
|
1293 | throw new ParseError(
|
1294 | "Mismatch: \\begin{" + envName + "} matched " +
|
1295 | "by \\end{" + end.result.value.name + "}",
|
1296 | this.lexer, end.namepos);
|
1297 | }
|
1298 | result.position = end.position;
|
1299 | return result;
|
1300 | } else if (utils.contains(sizeFuncs, func)) {
|
1301 | // If we see a sizing function, parse out the implict body
|
1302 | body = this.parseExpression(start.result.position, mode, false);
|
1303 | return new ParseResult(
|
1304 | new ParseNode("sizing", {
|
1305 | // Figure out what size to use based on the list of functions above
|
1306 | size: "size" + (utils.indexOf(sizeFuncs, func) + 1),
|
1307 | value: body.result
|
1308 | }, mode),
|
1309 | body.position);
|
1310 | } else if (utils.contains(styleFuncs, func)) {
|
1311 | // If we see a styling function, parse out the implict body
|
1312 | body = this.parseExpression(start.result.position, mode, true);
|
1313 | return new ParseResult(
|
1314 | new ParseNode("styling", {
|
1315 | // Figure out what style to use by pulling out the style from
|
1316 | // the function name
|
1317 | style: func.slice(1, func.length - 5),
|
1318 | value: body.result
|
1319 | }, mode),
|
1320 | body.position);
|
1321 | } else {
|
1322 | // Defer to parseFunction if it's not a function we handle
|
1323 | return this.parseFunction(pos, mode);
|
1324 | }
|
1325 | };
|
1326 |
|
1327 | /**
|
1328 | * Parses an entire function, including its base and all of its arguments
|
1329 | *
|
1330 | * @return {?ParseResult}
|
1331 | */
|
1332 | Parser.prototype.parseFunction = function(pos, mode) {
|
1333 | var baseGroup = this.parseGroup(pos, mode);
|
1334 |
|
1335 | if (baseGroup) {
|
1336 | if (baseGroup.isFunction) {
|
1337 | var func = baseGroup.result.result;
|
1338 | var funcData = functions.funcs[func];
|
1339 | if (mode === "text" && !funcData.allowedInText) {
|
1340 | throw new ParseError(
|
1341 | "Can't use function '" + func + "' in text mode",
|
1342 | this.lexer, baseGroup.position);
|
1343 | }
|
1344 |
|
1345 | var args = [func];
|
1346 | var newPos = this.parseArguments(
|
1347 | baseGroup.result.position, mode, func, funcData, args);
|
1348 | var result = functions.funcs[func].handler.apply(this, args);
|
1349 | return new ParseResult(
|
1350 | new ParseNode(result.type, result, mode),
|
1351 | newPos);
|
1352 | } else {
|
1353 | return baseGroup.result;
|
1354 | }
|
1355 | } else {
|
1356 | return null;
|
1357 | }
|
1358 | };
|
1359 |
|
1360 |
|
1361 | /**
|
1362 | * Parses the arguments of a function or environment
|
1363 | *
|
1364 | * @param {string} func "\name" or "\begin{name}"
|
1365 | * @param {{numArgs:number,numOptionalArgs:number|undefined}} funcData
|
1366 | * @param {Array} args list of arguments to which new ones will be pushed
|
1367 | * @return the position after all arguments have been parsed
|
1368 | */
|
1369 | Parser.prototype.parseArguments = function(pos, mode, func, funcData, args) {
|
1370 | var totalArgs = funcData.numArgs + funcData.numOptionalArgs;
|
1371 | if (totalArgs === 0) {
|
1372 | return pos;
|
1373 | }
|
1374 |
|
1375 | var newPos = pos;
|
1376 | var baseGreediness = funcData.greediness;
|
1377 | var positions = [newPos];
|
1378 |
|
1379 | for (var i = 0; i < totalArgs; i++) {
|
1380 | var argType = funcData.argTypes && funcData.argTypes[i];
|
1381 | var arg;
|
1382 | if (i < funcData.numOptionalArgs) {
|
1383 | if (argType) {
|
1384 | arg = this.parseSpecialGroup(newPos, argType, mode, true);
|
1385 | } else {
|
1386 | arg = this.parseOptionalGroup(newPos, mode);
|
1387 | }
|
1388 | if (!arg) {
|
1389 | args.push(null);
|
1390 | positions.push(newPos);
|
1391 | continue;
|
1392 | }
|
1393 | } else {
|
1394 | if (argType) {
|
1395 | arg = this.parseSpecialGroup(newPos, argType, mode);
|
1396 | } else {
|
1397 | arg = this.parseGroup(newPos, mode);
|
1398 | }
|
1399 | if (!arg) {
|
1400 | var lex = this.lexer.lex(newPos, mode);
|
1401 |
|
1402 | if (!this.settings.throwOnError && lex.text[0] === "\\") {
|
1403 | arg = new ParseFuncOrArgument(
|
1404 | new ParseResult(
|
1405 | this.handleUnsupportedCmd(lex.text, mode),
|
1406 | lex.position),
|
1407 | false);
|
1408 | } else {
|
1409 | throw new ParseError(
|
1410 | "Expected group after '" + func + "'", this.lexer, pos);
|
1411 | }
|
1412 | }
|
1413 | }
|
1414 | var argNode;
|
1415 | if (arg.isFunction) {
|
1416 | var argGreediness =
|
1417 | functions.funcs[arg.result.result].greediness;
|
1418 | if (argGreediness > baseGreediness) {
|
1419 | argNode = this.parseFunction(newPos, mode);
|
1420 | } else {
|
1421 | throw new ParseError(
|
1422 | "Got function '" + arg.result.result + "' as " +
|
1423 | "argument to '" + func + "'",
|
1424 | this.lexer, arg.result.position - 1);
|
1425 | }
|
1426 | } else {
|
1427 | argNode = arg.result;
|
1428 | }
|
1429 | args.push(argNode.result);
|
1430 | positions.push(argNode.position);
|
1431 | newPos = argNode.position;
|
1432 | }
|
1433 |
|
1434 | args.push(positions);
|
1435 |
|
1436 | return newPos;
|
1437 | };
|
1438 |
|
1439 |
|
1440 | /**
|
1441 | * Parses a group when the mode is changing. Takes a position, a new mode, and
|
1442 | * an outer mode that is used to parse the outside.
|
1443 | *
|
1444 | * @return {?ParseFuncOrArgument}
|
1445 | */
|
1446 | Parser.prototype.parseSpecialGroup = function(pos, mode, outerMode, optional) {
|
1447 | // Handle `original` argTypes
|
1448 | if (mode === "original") {
|
1449 | mode = outerMode;
|
1450 | }
|
1451 |
|
1452 | if (mode === "color" || mode === "size") {
|
1453 | // color and size modes are special because they should have braces and
|
1454 | // should only lex a single symbol inside
|
1455 | var openBrace = this.lexer.lex(pos, outerMode);
|
1456 | if (optional && openBrace.text !== "[") {
|
1457 | // optional arguments should return null if they don't exist
|
1458 | return null;
|
1459 | }
|
1460 | this.expect(openBrace, optional ? "[" : "{");
|
1461 | var inner = this.lexer.lex(openBrace.position, mode);
|
1462 | var data;
|
1463 | if (mode === "color") {
|
1464 | data = inner.text;
|
1465 | } else {
|
1466 | data = inner.data;
|
1467 | }
|
1468 | var closeBrace = this.lexer.lex(inner.position, outerMode);
|
1469 | this.expect(closeBrace, optional ? "]" : "}");
|
1470 | return new ParseFuncOrArgument(
|
1471 | new ParseResult(
|
1472 | new ParseNode(mode, data, outerMode),
|
1473 | closeBrace.position),
|
1474 | false);
|
1475 | } else if (mode === "text") {
|
1476 | // text mode is special because it should ignore the whitespace before
|
1477 | // it
|
1478 | var whitespace = this.lexer.lex(pos, "whitespace");
|
1479 | pos = whitespace.position;
|
1480 | }
|
1481 |
|
1482 | if (optional) {
|
1483 | return this.parseOptionalGroup(pos, mode);
|
1484 | } else {
|
1485 | return this.parseGroup(pos, mode);
|
1486 | }
|
1487 | };
|
1488 |
|
1489 | /**
|
1490 | * Parses a group, which is either a single nucleus (like "x") or an expression
|
1491 | * in braces (like "{x+y}")
|
1492 | *
|
1493 | * @return {?ParseFuncOrArgument}
|
1494 | */
|
1495 | Parser.prototype.parseGroup = function(pos, mode) {
|
1496 | var start = this.lexer.lex(pos, mode);
|
1497 | // Try to parse an open brace
|
1498 | if (start.text === "{") {
|
1499 | // If we get a brace, parse an expression
|
1500 | var expression = this.parseExpression(start.position, mode, false);
|
1501 | // Make sure we get a close brace
|
1502 | var closeBrace = this.lexer.lex(expression.position, mode);
|
1503 | this.expect(closeBrace, "}");
|
1504 | return new ParseFuncOrArgument(
|
1505 | new ParseResult(
|
1506 | new ParseNode("ordgroup", expression.result, mode),
|
1507 | closeBrace.position),
|
1508 | false);
|
1509 | } else {
|
1510 | // Otherwise, just return a nucleus
|
1511 | return this.parseSymbol(pos, mode);
|
1512 | }
|
1513 | };
|
1514 |
|
1515 | /**
|
1516 | * Parses a group, which is an expression in brackets (like "[x+y]")
|
1517 | *
|
1518 | * @return {?ParseFuncOrArgument}
|
1519 | */
|
1520 | Parser.prototype.parseOptionalGroup = function(pos, mode) {
|
1521 | var start = this.lexer.lex(pos, mode);
|
1522 | // Try to parse an open bracket
|
1523 | if (start.text === "[") {
|
1524 | // If we get a brace, parse an expression
|
1525 | var expression = this.parseExpression(start.position, mode, false, "]");
|
1526 | // Make sure we get a close bracket
|
1527 | var closeBracket = this.lexer.lex(expression.position, mode);
|
1528 | this.expect(closeBracket, "]");
|
1529 | return new ParseFuncOrArgument(
|
1530 | new ParseResult(
|
1531 | new ParseNode("ordgroup", expression.result, mode),
|
1532 | closeBracket.position),
|
1533 | false);
|
1534 | } else {
|
1535 | // Otherwise, return null,
|
1536 | return null;
|
1537 | }
|
1538 | };
|
1539 |
|
1540 | /**
|
1541 | * Parse a single symbol out of the string. Here, we handle both the functions
|
1542 | * we have defined, as well as the single character symbols
|
1543 | *
|
1544 | * @return {?ParseFuncOrArgument}
|
1545 | */
|
1546 | Parser.prototype.parseSymbol = function(pos, mode) {
|
1547 | var nucleus = this.lexer.lex(pos, mode);
|
1548 |
|
1549 | if (functions.funcs[nucleus.text]) {
|
1550 | // If there exists a function with this name, we return the function and
|
1551 | // say that it is a function.
|
1552 | return new ParseFuncOrArgument(
|
1553 | new ParseResult(nucleus.text, nucleus.position),
|
1554 | true);
|
1555 | } else if (symbols[mode][nucleus.text]) {
|
1556 | // Otherwise if this is a no-argument function, find the type it
|
1557 | // corresponds to in the symbols map
|
1558 | return new ParseFuncOrArgument(
|
1559 | new ParseResult(
|
1560 | new ParseNode(symbols[mode][nucleus.text].group,
|
1561 | nucleus.text, mode),
|
1562 | nucleus.position),
|
1563 | false);
|
1564 | } else {
|
1565 | return null;
|
1566 | }
|
1567 | };
|
1568 |
|
1569 | Parser.prototype.ParseNode = ParseNode;
|
1570 |
|
1571 | module.exports = Parser;
|
1572 |
|
1573 | },{"./Lexer":5,"./ParseError":7,"./environments":17,"./functions":20,"./parseData":22,"./symbols":24,"./utils":25}],9:[function(require,module,exports){
|
1574 | /**
|
1575 | * This is a module for storing settings passed into KaTeX. It correctly handles
|
1576 | * default settings.
|
1577 | */
|
1578 |
|
1579 | /**
|
1580 | * Helper function for getting a default value if the value is undefined
|
1581 | */
|
1582 | function get(option, defaultValue) {
|
1583 | return option === undefined ? defaultValue : option;
|
1584 | }
|
1585 |
|
1586 | /**
|
1587 | * The main Settings object
|
1588 | *
|
1589 | * The current options stored are:
|
1590 | * - displayMode: Whether the expression should be typeset by default in
|
1591 | * textstyle or displaystyle (default false)
|
1592 | */
|
1593 | function Settings(options) {
|
1594 | // allow null options
|
1595 | options = options || {};
|
1596 | this.displayMode = get(options.displayMode, false);
|
1597 | this.throwOnError = get(options.throwOnError, true);
|
1598 | this.errorColor = get(options.errorColor, "#cc0000");
|
1599 | }
|
1600 |
|
1601 | module.exports = Settings;
|
1602 |
|
1603 | },{}],10:[function(require,module,exports){
|
1604 | /**
|
1605 | * This file contains information and classes for the various kinds of styles
|
1606 | * used in TeX. It provides a generic `Style` class, which holds information
|
1607 | * about a specific style. It then provides instances of all the different kinds
|
1608 | * of styles possible, and provides functions to move between them and get
|
1609 | * information about them.
|
1610 | */
|
1611 |
|
1612 | /**
|
1613 | * The main style class. Contains a unique id for the style, a size (which is
|
1614 | * the same for cramped and uncramped version of a style), a cramped flag, and a
|
1615 | * size multiplier, which gives the size difference between a style and
|
1616 | * textstyle.
|
1617 | */
|
1618 | function Style(id, size, multiplier, cramped) {
|
1619 | this.id = id;
|
1620 | this.size = size;
|
1621 | this.cramped = cramped;
|
1622 | this.sizeMultiplier = multiplier;
|
1623 | }
|
1624 |
|
1625 | /**
|
1626 | * Get the style of a superscript given a base in the current style.
|
1627 | */
|
1628 | Style.prototype.sup = function() {
|
1629 | return styles[sup[this.id]];
|
1630 | };
|
1631 |
|
1632 | /**
|
1633 | * Get the style of a subscript given a base in the current style.
|
1634 | */
|
1635 | Style.prototype.sub = function() {
|
1636 | return styles[sub[this.id]];
|
1637 | };
|
1638 |
|
1639 | /**
|
1640 | * Get the style of a fraction numerator given the fraction in the current
|
1641 | * style.
|
1642 | */
|
1643 | Style.prototype.fracNum = function() {
|
1644 | return styles[fracNum[this.id]];
|
1645 | };
|
1646 |
|
1647 | /**
|
1648 | * Get the style of a fraction denominator given the fraction in the current
|
1649 | * style.
|
1650 | */
|
1651 | Style.prototype.fracDen = function() {
|
1652 | return styles[fracDen[this.id]];
|
1653 | };
|
1654 |
|
1655 | /**
|
1656 | * Get the cramped version of a style (in particular, cramping a cramped style
|
1657 | * doesn't change the style).
|
1658 | */
|
1659 | Style.prototype.cramp = function() {
|
1660 | return styles[cramp[this.id]];
|
1661 | };
|
1662 |
|
1663 | /**
|
1664 | * HTML class name, like "displaystyle cramped"
|
1665 | */
|
1666 | Style.prototype.cls = function() {
|
1667 | return sizeNames[this.size] + (this.cramped ? " cramped" : " uncramped");
|
1668 | };
|
1669 |
|
1670 | /**
|
1671 | * HTML Reset class name, like "reset-textstyle"
|
1672 | */
|
1673 | Style.prototype.reset = function() {
|
1674 | return resetNames[this.size];
|
1675 | };
|
1676 |
|
1677 | // IDs of the different styles
|
1678 | var D = 0;
|
1679 | var Dc = 1;
|
1680 | var T = 2;
|
1681 | var Tc = 3;
|
1682 | var S = 4;
|
1683 | var Sc = 5;
|
1684 | var SS = 6;
|
1685 | var SSc = 7;
|
1686 |
|
1687 | // String names for the different sizes
|
1688 | var sizeNames = [
|
1689 | "displaystyle textstyle",
|
1690 | "textstyle",
|
1691 | "scriptstyle",
|
1692 | "scriptscriptstyle"
|
1693 | ];
|
1694 |
|
1695 | // Reset names for the different sizes
|
1696 | var resetNames = [
|
1697 | "reset-textstyle",
|
1698 | "reset-textstyle",
|
1699 | "reset-scriptstyle",
|
1700 | "reset-scriptscriptstyle"
|
1701 | ];
|
1702 |
|
1703 | // Instances of the different styles
|
1704 | var styles = [
|
1705 | new Style(D, 0, 1.0, false),
|
1706 | new Style(Dc, 0, 1.0, true),
|
1707 | new Style(T, 1, 1.0, false),
|
1708 | new Style(Tc, 1, 1.0, true),
|
1709 | new Style(S, 2, 0.7, false),
|
1710 | new Style(Sc, 2, 0.7, true),
|
1711 | new Style(SS, 3, 0.5, false),
|
1712 | new Style(SSc, 3, 0.5, true)
|
1713 | ];
|
1714 |
|
1715 | // Lookup tables for switching from one style to another
|
1716 | var sup = [S, Sc, S, Sc, SS, SSc, SS, SSc];
|
1717 | var sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc];
|
1718 | var fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc];
|
1719 | var fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];
|
1720 | var cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc];
|
1721 |
|
1722 | // We only export some of the styles. Also, we don't export the `Style` class so
|
1723 | // no more styles can be generated.
|
1724 | module.exports = {
|
1725 | DISPLAY: styles[D],
|
1726 | TEXT: styles[T],
|
1727 | SCRIPT: styles[S],
|
1728 | SCRIPTSCRIPT: styles[SS]
|
1729 | };
|
1730 |
|
1731 | },{}],11:[function(require,module,exports){
|
1732 | /**
|
1733 | * This module contains general functions that can be used for building
|
1734 | * different kinds of domTree nodes in a consistent manner.
|
1735 | */
|
1736 |
|
1737 | var domTree = require("./domTree");
|
1738 | var fontMetrics = require("./fontMetrics");
|
1739 | var symbols = require("./symbols");
|
1740 | var utils = require("./utils");
|
1741 |
|
1742 | var greekCapitals = [
|
1743 | "\\Gamma",
|
1744 | "\\Delta",
|
1745 | "\\Theta",
|
1746 | "\\Lambda",
|
1747 | "\\Xi",
|
1748 | "\\Pi",
|
1749 | "\\Sigma",
|
1750 | "\\Upsilon",
|
1751 | "\\Phi",
|
1752 | "\\Psi",
|
1753 | "\\Omega"
|
1754 | ];
|
1755 |
|
1756 | var dotlessLetters = [
|
1757 | "\u0131", // dotless i, \imath
|
1758 | "\u0237" // dotless j, \jmath
|
1759 | ];
|
1760 |
|
1761 | /**
|
1762 | * Makes a symbolNode after translation via the list of symbols in symbols.js.
|
1763 | * Correctly pulls out metrics for the character, and optionally takes a list of
|
1764 | * classes to be attached to the node.
|
1765 | */
|
1766 | var makeSymbol = function(value, style, mode, color, classes) {
|
1767 | // Replace the value with its replaced value from symbol.js
|
1768 | if (symbols[mode][value] && symbols[mode][value].replace) {
|
1769 | value = symbols[mode][value].replace;
|
1770 | }
|
1771 |
|
1772 | var metrics = fontMetrics.getCharacterMetrics(value, style);
|
1773 |
|
1774 | var symbolNode;
|
1775 | if (metrics) {
|
1776 | symbolNode = new domTree.symbolNode(
|
1777 | value, metrics.height, metrics.depth, metrics.italic, metrics.skew,
|
1778 | classes);
|
1779 | } else {
|
1780 | // TODO(emily): Figure out a good way to only print this in development
|
1781 | typeof console !== "undefined" && console.warn(
|
1782 | "No character metrics for '" + value + "' in style '" +
|
1783 | style + "'");
|
1784 | symbolNode = new domTree.symbolNode(value, 0, 0, 0, 0, classes);
|
1785 | }
|
1786 |
|
1787 | if (color) {
|
1788 | symbolNode.style.color = color;
|
1789 | }
|
1790 |
|
1791 | return symbolNode;
|
1792 | };
|
1793 |
|
1794 | /**
|
1795 | * Makes a symbol in Main-Regular or AMS-Regular.
|
1796 | * Used for rel, bin, open, close, inner, and punct.
|
1797 | */
|
1798 | var mathsym = function(value, mode, color, classes) {
|
1799 | // Decide what font to render the symbol in by its entry in the symbols
|
1800 | // table.
|
1801 | // Have a special case for when the value = \ because the \ is used as a
|
1802 | // textord in unsupported command errors but cannot be parsed as a regular
|
1803 | // text ordinal and is therefore not present as a symbol in the symbols
|
1804 | // table for text
|
1805 | if (value === "\\" || symbols[mode][value].font === "main") {
|
1806 | return makeSymbol(value, "Main-Regular", mode, color, classes);
|
1807 | } else {
|
1808 | return makeSymbol(
|
1809 | value, "AMS-Regular", mode, color, classes.concat(["amsrm"]));
|
1810 | }
|
1811 | };
|
1812 |
|
1813 | /**
|
1814 | * Makes a symbol in the default font for mathords and textords.
|
1815 | */
|
1816 | var mathDefault = function(value, mode, color, classes, type) {
|
1817 | if (type === "mathord") {
|
1818 | return mathit(value, mode, color, classes);
|
1819 | } else if (type === "textord") {
|
1820 | return makeSymbol(
|
1821 | value, "Main-Regular", mode, color, classes.concat(["mathrm"]));
|
1822 | } else {
|
1823 | throw new Error("unexpected type: " + type + " in mathDefault");
|
1824 | }
|
1825 | };
|
1826 |
|
1827 | /**
|
1828 | * Makes a symbol in the italic math font.
|
1829 | */
|
1830 | var mathit = function(value, mode, color, classes) {
|
1831 | if (/[0-9]/.test(value.charAt(0)) ||
|
1832 | // glyphs for \imath and \jmath do not exist in Math-Italic so we
|
1833 | // need to use Main-Italic instead
|
1834 | utils.contains(dotlessLetters, value) ||
|
1835 | utils.contains(greekCapitals, value)) {
|
1836 | return makeSymbol(
|
1837 | value, "Main-Italic", mode, color, classes.concat(["mainit"]));
|
1838 | } else {
|
1839 | return makeSymbol(
|
1840 | value, "Math-Italic", mode, color, classes.concat(["mathit"]));
|
1841 | }
|
1842 | };
|
1843 |
|
1844 | /**
|
1845 | * Makes either a mathord or textord in the correct font and color.
|
1846 | */
|
1847 | var makeOrd = function(group, options, type) {
|
1848 | var mode = group.mode;
|
1849 | var value = group.value;
|
1850 | if (symbols[mode][value] && symbols[mode][value].replace) {
|
1851 | value = symbols[mode][value].replace;
|
1852 | }
|
1853 |
|
1854 | var classes = ["mord"];
|
1855 | var color = options.getColor();
|
1856 |
|
1857 | var font = options.font;
|
1858 | if (font) {
|
1859 | if (font === "mathit" || utils.contains(dotlessLetters, value)) {
|
1860 | return mathit(value, mode, color, classes);
|
1861 | } else {
|
1862 | var fontName = fontMap[font].fontName;
|
1863 | if (fontMetrics.getCharacterMetrics(value, fontName)) {
|
1864 | return makeSymbol(value, fontName, mode, color, classes.concat([font]));
|
1865 | } else {
|
1866 | return mathDefault(value, mode, color, classes, type);
|
1867 | }
|
1868 | }
|
1869 | } else {
|
1870 | return mathDefault(value, mode, color, classes, type);
|
1871 | }
|
1872 | };
|
1873 |
|
1874 | /**
|
1875 | * Calculate the height, depth, and maxFontSize of an element based on its
|
1876 | * children.
|
1877 | */
|
1878 | var sizeElementFromChildren = function(elem) {
|
1879 | var height = 0;
|
1880 | var depth = 0;
|
1881 | var maxFontSize = 0;
|
1882 |
|
1883 | if (elem.children) {
|
1884 | for (var i = 0; i < elem.children.length; i++) {
|
1885 | if (elem.children[i].height > height) {
|
1886 | height = elem.children[i].height;
|
1887 | }
|
1888 | if (elem.children[i].depth > depth) {
|
1889 | depth = elem.children[i].depth;
|
1890 | }
|
1891 | if (elem.children[i].maxFontSize > maxFontSize) {
|
1892 | maxFontSize = elem.children[i].maxFontSize;
|
1893 | }
|
1894 | }
|
1895 | }
|
1896 |
|
1897 | elem.height = height;
|
1898 | elem.depth = depth;
|
1899 | elem.maxFontSize = maxFontSize;
|
1900 | };
|
1901 |
|
1902 | /**
|
1903 | * Makes a span with the given list of classes, list of children, and color.
|
1904 | */
|
1905 | var makeSpan = function(classes, children, color) {
|
1906 | var span = new domTree.span(classes, children);
|
1907 |
|
1908 | sizeElementFromChildren(span);
|
1909 |
|
1910 | if (color) {
|
1911 | span.style.color = color;
|
1912 | }
|
1913 |
|
1914 | return span;
|
1915 | };
|
1916 |
|
1917 | /**
|
1918 | * Makes a document fragment with the given list of children.
|
1919 | */
|
1920 | var makeFragment = function(children) {
|
1921 | var fragment = new domTree.documentFragment(children);
|
1922 |
|
1923 | sizeElementFromChildren(fragment);
|
1924 |
|
1925 | return fragment;
|
1926 | };
|
1927 |
|
1928 | /**
|
1929 | * Makes an element placed in each of the vlist elements to ensure that each
|
1930 | * element has the same max font size. To do this, we create a zero-width space
|
1931 | * with the correct font size.
|
1932 | */
|
1933 | var makeFontSizer = function(options, fontSize) {
|
1934 | var fontSizeInner = makeSpan([], [new domTree.symbolNode("\u200b")]);
|
1935 | fontSizeInner.style.fontSize = (fontSize / options.style.sizeMultiplier) + "em";
|
1936 |
|
1937 | var fontSizer = makeSpan(
|
1938 | ["fontsize-ensurer", "reset-" + options.size, "size5"],
|
1939 | [fontSizeInner]);
|
1940 |
|
1941 | return fontSizer;
|
1942 | };
|
1943 |
|
1944 | /**
|
1945 | * Makes a vertical list by stacking elements and kerns on top of each other.
|
1946 | * Allows for many different ways of specifying the positioning method.
|
1947 | *
|
1948 | * Arguments:
|
1949 | * - children: A list of child or kern nodes to be stacked on top of each other
|
1950 | * (i.e. the first element will be at the bottom, and the last at
|
1951 | * the top). Element nodes are specified as
|
1952 | * {type: "elem", elem: node}
|
1953 | * while kern nodes are specified as
|
1954 | * {type: "kern", size: size}
|
1955 | * - positionType: The method by which the vlist should be positioned. Valid
|
1956 | * values are:
|
1957 | * - "individualShift": The children list only contains elem
|
1958 | * nodes, and each node contains an extra
|
1959 | * "shift" value of how much it should be
|
1960 | * shifted (note that shifting is always
|
1961 | * moving downwards). positionData is
|
1962 | * ignored.
|
1963 | * - "top": The positionData specifies the topmost point of
|
1964 | * the vlist (note this is expected to be a height,
|
1965 | * so positive values move up)
|
1966 | * - "bottom": The positionData specifies the bottommost point
|
1967 | * of the vlist (note this is expected to be a
|
1968 | * depth, so positive values move down
|
1969 | * - "shift": The vlist will be positioned such that its
|
1970 | * baseline is positionData away from the baseline
|
1971 | * of the first child. Positive values move
|
1972 | * downwards.
|
1973 | * - "firstBaseline": The vlist will be positioned such that
|
1974 | * its baseline is aligned with the
|
1975 | * baseline of the first child.
|
1976 | * positionData is ignored. (this is
|
1977 | * equivalent to "shift" with
|
1978 | * positionData=0)
|
1979 | * - positionData: Data used in different ways depending on positionType
|
1980 | * - options: An Options object
|
1981 | *
|
1982 | */
|
1983 | var makeVList = function(children, positionType, positionData, options) {
|
1984 | var depth;
|
1985 | var currPos;
|
1986 | var i;
|
1987 | if (positionType === "individualShift") {
|
1988 | var oldChildren = children;
|
1989 | children = [oldChildren[0]];
|
1990 |
|
1991 | // Add in kerns to the list of children to get each element to be
|
1992 | // shifted to the correct specified shift
|
1993 | depth = -oldChildren[0].shift - oldChildren[0].elem.depth;
|
1994 | currPos = depth;
|
1995 | for (i = 1; i < oldChildren.length; i++) {
|
1996 | var diff = -oldChildren[i].shift - currPos -
|
1997 | oldChildren[i].elem.depth;
|
1998 | var size = diff -
|
1999 | (oldChildren[i - 1].elem.height +
|
2000 | oldChildren[i - 1].elem.depth);
|
2001 |
|
2002 | currPos = currPos + diff;
|
2003 |
|
2004 | children.push({type: "kern", size: size});
|
2005 | children.push(oldChildren[i]);
|
2006 | }
|
2007 | } else if (positionType === "top") {
|
2008 | // We always start at the bottom, so calculate the bottom by adding up
|
2009 | // all the sizes
|
2010 | var bottom = positionData;
|
2011 | for (i = 0; i < children.length; i++) {
|
2012 | if (children[i].type === "kern") {
|
2013 | bottom -= children[i].size;
|
2014 | } else {
|
2015 | bottom -= children[i].elem.height + children[i].elem.depth;
|
2016 | }
|
2017 | }
|
2018 | depth = bottom;
|
2019 | } else if (positionType === "bottom") {
|
2020 | depth = -positionData;
|
2021 | } else if (positionType === "shift") {
|
2022 | depth = -children[0].elem.depth - positionData;
|
2023 | } else if (positionType === "firstBaseline") {
|
2024 | depth = -children[0].elem.depth;
|
2025 | } else {
|
2026 | depth = 0;
|
2027 | }
|
2028 |
|
2029 | // Make the fontSizer
|
2030 | var maxFontSize = 0;
|
2031 | for (i = 0; i < children.length; i++) {
|
2032 | if (children[i].type === "elem") {
|
2033 | maxFontSize = Math.max(maxFontSize, children[i].elem.maxFontSize);
|
2034 | }
|
2035 | }
|
2036 | var fontSizer = makeFontSizer(options, maxFontSize);
|
2037 |
|
2038 | // Create a new list of actual children at the correct offsets
|
2039 | var realChildren = [];
|
2040 | currPos = depth;
|
2041 | for (i = 0; i < children.length; i++) {
|
2042 | if (children[i].type === "kern") {
|
2043 | currPos += children[i].size;
|
2044 | } else {
|
2045 | var child = children[i].elem;
|
2046 |
|
2047 | var shift = -child.depth - currPos;
|
2048 | currPos += child.height + child.depth;
|
2049 |
|
2050 | var childWrap = makeSpan([], [fontSizer, child]);
|
2051 | childWrap.height -= shift;
|
2052 | childWrap.depth += shift;
|
2053 | childWrap.style.top = shift + "em";
|
2054 |
|
2055 | realChildren.push(childWrap);
|
2056 | }
|
2057 | }
|
2058 |
|
2059 | // Add in an element at the end with no offset to fix the calculation of
|
2060 | // baselines in some browsers (namely IE, sometimes safari)
|
2061 | var baselineFix = makeSpan(
|
2062 | ["baseline-fix"], [fontSizer, new domTree.symbolNode("\u200b")]);
|
2063 | realChildren.push(baselineFix);
|
2064 |
|
2065 | var vlist = makeSpan(["vlist"], realChildren);
|
2066 | // Fix the final height and depth, in case there were kerns at the ends
|
2067 | // since the makeSpan calculation won't take that in to account.
|
2068 | vlist.height = Math.max(currPos, vlist.height);
|
2069 | vlist.depth = Math.max(-depth, vlist.depth);
|
2070 | return vlist;
|
2071 | };
|
2072 |
|
2073 | // A table of size -> font size for the different sizing functions
|
2074 | var sizingMultiplier = {
|
2075 | size1: 0.5,
|
2076 | size2: 0.7,
|
2077 | size3: 0.8,
|
2078 | size4: 0.9,
|
2079 | size5: 1.0,
|
2080 | size6: 1.2,
|
2081 | size7: 1.44,
|
2082 | size8: 1.73,
|
2083 | size9: 2.07,
|
2084 | size10: 2.49
|
2085 | };
|
2086 |
|
2087 | // A map of spacing functions to their attributes, like size and corresponding
|
2088 | // CSS class
|
2089 | var spacingFunctions = {
|
2090 | "\\qquad": {
|
2091 | size: "2em",
|
2092 | className: "qquad"
|
2093 | },
|
2094 | "\\quad": {
|
2095 | size: "1em",
|
2096 | className: "quad"
|
2097 | },
|
2098 | "\\enspace": {
|
2099 | size: "0.5em",
|
2100 | className: "enspace"
|
2101 | },
|
2102 | "\\;": {
|
2103 | size: "0.277778em",
|
2104 | className: "thickspace"
|
2105 | },
|
2106 | "\\:": {
|
2107 | size: "0.22222em",
|
2108 | className: "mediumspace"
|
2109 | },
|
2110 | "\\,": {
|
2111 | size: "0.16667em",
|
2112 | className: "thinspace"
|
2113 | },
|
2114 | "\\!": {
|
2115 | size: "-0.16667em",
|
2116 | className: "negativethinspace"
|
2117 | }
|
2118 | };
|
2119 |
|
2120 | /**
|
2121 | * Maps TeX font commands to objects containing:
|
2122 | * - variant: string used for "mathvariant" attribute in buildMathML.js
|
2123 | * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics
|
2124 | */
|
2125 | // A map between tex font commands an MathML mathvariant attribute values
|
2126 | var fontMap = {
|
2127 | // styles
|
2128 | "mathbf": {
|
2129 | variant: "bold",
|
2130 | fontName: "Main-Bold"
|
2131 | },
|
2132 | "mathrm": {
|
2133 | variant: "normal",
|
2134 | fontName: "Main-Regular"
|
2135 | },
|
2136 |
|
2137 | // "mathit" is missing because it requires the use of two fonts: Main-Italic
|
2138 | // and Math-Italic. This is handled by a special case in makeOrd which ends
|
2139 | // up calling mathit.
|
2140 |
|
2141 | // families
|
2142 | "mathbb": {
|
2143 | variant: "double-struck",
|
2144 | fontName: "AMS-Regular"
|
2145 | },
|
2146 | "mathcal": {
|
2147 | variant: "script",
|
2148 | fontName: "Caligraphic-Regular"
|
2149 | },
|
2150 | "mathfrak": {
|
2151 | variant: "fraktur",
|
2152 | fontName: "Fraktur-Regular"
|
2153 | },
|
2154 | "mathscr": {
|
2155 | variant: "script",
|
2156 | fontName: "Script-Regular"
|
2157 | },
|
2158 | "mathsf": {
|
2159 | variant: "sans-serif",
|
2160 | fontName: "SansSerif-Regular"
|
2161 | },
|
2162 | "mathtt": {
|
2163 | variant: "monospace",
|
2164 | fontName: "Typewriter-Regular"
|
2165 | }
|
2166 | };
|
2167 |
|
2168 | module.exports = {
|
2169 | fontMap: fontMap,
|
2170 | makeSymbol: makeSymbol,
|
2171 | mathsym: mathsym,
|
2172 | makeSpan: makeSpan,
|
2173 | makeFragment: makeFragment,
|
2174 | makeVList: makeVList,
|
2175 | makeOrd: makeOrd,
|
2176 | sizingMultiplier: sizingMultiplier,
|
2177 | spacingFunctions: spacingFunctions
|
2178 | };
|
2179 |
|
2180 | },{"./domTree":16,"./fontMetrics":18,"./symbols":24,"./utils":25}],12:[function(require,module,exports){
|
2181 | /**
|
2182 | * This file does the main work of building a domTree structure from a parse
|
2183 | * tree. The entry point is the `buildHTML` function, which takes a parse tree.
|
2184 | * Then, the buildExpression, buildGroup, and various groupTypes functions are
|
2185 | * called, to produce a final HTML tree.
|
2186 | */
|
2187 |
|
2188 | var ParseError = require("./ParseError");
|
2189 | var Style = require("./Style");
|
2190 |
|
2191 | var buildCommon = require("./buildCommon");
|
2192 | var delimiter = require("./delimiter");
|
2193 | var domTree = require("./domTree");
|
2194 | var fontMetrics = require("./fontMetrics");
|
2195 | var utils = require("./utils");
|
2196 |
|
2197 | var makeSpan = buildCommon.makeSpan;
|
2198 |
|
2199 | /**
|
2200 | * Take a list of nodes, build them in order, and return a list of the built
|
2201 | * nodes. This function handles the `prev` node correctly, and passes the
|
2202 | * previous element from the list as the prev of the next element.
|
2203 | */
|
2204 | var buildExpression = function(expression, options, prev) {
|
2205 | var groups = [];
|
2206 | for (var i = 0; i < expression.length; i++) {
|
2207 | var group = expression[i];
|
2208 | groups.push(buildGroup(group, options, prev));
|
2209 | prev = group;
|
2210 | }
|
2211 | return groups;
|
2212 | };
|
2213 |
|
2214 | // List of types used by getTypeOfGroup,
|
2215 | // see https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
|
2216 | var groupToType = {
|
2217 | mathord: "mord",
|
2218 | textord: "mord",
|
2219 | bin: "mbin",
|
2220 | rel: "mrel",
|
2221 | text: "mord",
|
2222 | open: "mopen",
|
2223 | close: "mclose",
|
2224 | inner: "minner",
|
2225 | genfrac: "mord",
|
2226 | array: "mord",
|
2227 | spacing: "mord",
|
2228 | punct: "mpunct",
|
2229 | ordgroup: "mord",
|
2230 | op: "mop",
|
2231 | katex: "mord",
|
2232 | overline: "mord",
|
2233 | rule: "mord",
|
2234 | leftright: "minner",
|
2235 | sqrt: "mord",
|
2236 | accent: "mord"
|
2237 | };
|
2238 |
|
2239 | /**
|
2240 | * Gets the final math type of an expression, given its group type. This type is
|
2241 | * used to determine spacing between elements, and affects bin elements by
|
2242 | * causing them to change depending on what types are around them. This type
|
2243 | * must be attached to the outermost node of an element as a CSS class so that
|
2244 | * spacing with its surrounding elements works correctly.
|
2245 | *
|
2246 | * Some elements can be mapped one-to-one from group type to math type, and
|
2247 | * those are listed in the `groupToType` table.
|
2248 | *
|
2249 | * Others (usually elements that wrap around other elements) often have
|
2250 | * recursive definitions, and thus call `getTypeOfGroup` on their inner
|
2251 | * elements.
|
2252 | */
|
2253 | var getTypeOfGroup = function(group) {
|
2254 | if (group == null) {
|
2255 | // Like when typesetting $^3$
|
2256 | return groupToType.mathord;
|
2257 | } else if (group.type === "supsub") {
|
2258 | return getTypeOfGroup(group.value.base);
|
2259 | } else if (group.type === "llap" || group.type === "rlap") {
|
2260 | return getTypeOfGroup(group.value);
|
2261 | } else if (group.type === "color") {
|
2262 | return getTypeOfGroup(group.value.value);
|
2263 | } else if (group.type === "sizing") {
|
2264 | return getTypeOfGroup(group.value.value);
|
2265 | } else if (group.type === "styling") {
|
2266 | return getTypeOfGroup(group.value.value);
|
2267 | } else if (group.type === "delimsizing") {
|
2268 | return groupToType[group.value.delimType];
|
2269 | } else {
|
2270 | return groupToType[group.type];
|
2271 | }
|
2272 | };
|
2273 |
|
2274 | /**
|
2275 | * Sometimes, groups perform special rules when they have superscripts or
|
2276 | * subscripts attached to them. This function lets the `supsub` group know that
|
2277 | * its inner element should handle the superscripts and subscripts instead of
|
2278 | * handling them itself.
|
2279 | */
|
2280 | var shouldHandleSupSub = function(group, options) {
|
2281 | if (!group) {
|
2282 | return false;
|
2283 | } else if (group.type === "op") {
|
2284 | // Operators handle supsubs differently when they have limits
|
2285 | // (e.g. `\displaystyle\sum_2^3`)
|
2286 | return group.value.limits &&
|
2287 | (options.style.size === Style.DISPLAY.size || group.value.alwaysHandleSupSub);
|
2288 | } else if (group.type === "accent") {
|
2289 | return isCharacterBox(group.value.base);
|
2290 | } else {
|
2291 | return null;
|
2292 | }
|
2293 | };
|
2294 |
|
2295 | /**
|
2296 | * Sometimes we want to pull out the innermost element of a group. In most
|
2297 | * cases, this will just be the group itself, but when ordgroups and colors have
|
2298 | * a single element, we want to pull that out.
|
2299 | */
|
2300 | var getBaseElem = function(group) {
|
2301 | if (!group) {
|
2302 | return false;
|
2303 | } else if (group.type === "ordgroup") {
|
2304 | if (group.value.length === 1) {
|
2305 | return getBaseElem(group.value[0]);
|
2306 | } else {
|
2307 | return group;
|
2308 | }
|
2309 | } else if (group.type === "color") {
|
2310 | if (group.value.value.length === 1) {
|
2311 | return getBaseElem(group.value.value[0]);
|
2312 | } else {
|
2313 | return group;
|
2314 | }
|
2315 | } else {
|
2316 | return group;
|
2317 | }
|
2318 | };
|
2319 |
|
2320 | /**
|
2321 | * TeXbook algorithms often reference "character boxes", which are simply groups
|
2322 | * with a single character in them. To decide if something is a character box,
|
2323 | * we find its innermost group, and see if it is a single character.
|
2324 | */
|
2325 | var isCharacterBox = function(group) {
|
2326 | var baseElem = getBaseElem(group);
|
2327 |
|
2328 | // These are all they types of groups which hold single characters
|
2329 | return baseElem.type === "mathord" ||
|
2330 | baseElem.type === "textord" ||
|
2331 | baseElem.type === "bin" ||
|
2332 | baseElem.type === "rel" ||
|
2333 | baseElem.type === "inner" ||
|
2334 | baseElem.type === "open" ||
|
2335 | baseElem.type === "close" ||
|
2336 | baseElem.type === "punct";
|
2337 | };
|
2338 |
|
2339 | var makeNullDelimiter = function(options) {
|
2340 | return makeSpan([
|
2341 | "sizing", "reset-" + options.size, "size5",
|
2342 | options.style.reset(), Style.TEXT.cls(),
|
2343 | "nulldelimiter"
|
2344 | ]);
|
2345 | };
|
2346 |
|
2347 | /**
|
2348 | * This is a map of group types to the function used to handle that type.
|
2349 | * Simpler types come at the beginning, while complicated types come afterwards.
|
2350 | */
|
2351 | var groupTypes = {
|
2352 | mathord: function(group, options, prev) {
|
2353 | return buildCommon.makeOrd(group, options, "mathord");
|
2354 | },
|
2355 |
|
2356 | textord: function(group, options, prev) {
|
2357 | return buildCommon.makeOrd(group, options, "textord");
|
2358 | },
|
2359 |
|
2360 | bin: function(group, options, prev) {
|
2361 | var className = "mbin";
|
2362 | // Pull out the most recent element. Do some special handling to find
|
2363 | // things at the end of a \color group. Note that we don't use the same
|
2364 | // logic for ordgroups (which count as ords).
|
2365 | var prevAtom = prev;
|
2366 | while (prevAtom && prevAtom.type === "color") {
|
2367 | var atoms = prevAtom.value.value;
|
2368 | prevAtom = atoms[atoms.length - 1];
|
2369 | }
|
2370 | // See TeXbook pg. 442-446, Rules 5 and 6, and the text before Rule 19.
|
2371 | // Here, we determine whether the bin should turn into an ord. We
|
2372 | // currently only apply Rule 5.
|
2373 | if (!prev || utils.contains(["mbin", "mopen", "mrel", "mop", "mpunct"],
|
2374 | getTypeOfGroup(prevAtom))) {
|
2375 | group.type = "textord";
|
2376 | className = "mord";
|
2377 | }
|
2378 |
|
2379 | return buildCommon.mathsym(
|
2380 | group.value, group.mode, options.getColor(), [className]);
|
2381 | },
|
2382 |
|
2383 | rel: function(group, options, prev) {
|
2384 | return buildCommon.mathsym(
|
2385 | group.value, group.mode, options.getColor(), ["mrel"]);
|
2386 | },
|
2387 |
|
2388 | open: function(group, options, prev) {
|
2389 | return buildCommon.mathsym(
|
2390 | group.value, group.mode, options.getColor(), ["mopen"]);
|
2391 | },
|
2392 |
|
2393 | close: function(group, options, prev) {
|
2394 | return buildCommon.mathsym(
|
2395 | group.value, group.mode, options.getColor(), ["mclose"]);
|
2396 | },
|
2397 |
|
2398 | inner: function(group, options, prev) {
|
2399 | return buildCommon.mathsym(
|
2400 | group.value, group.mode, options.getColor(), ["minner"]);
|
2401 | },
|
2402 |
|
2403 | punct: function(group, options, prev) {
|
2404 | return buildCommon.mathsym(
|
2405 | group.value, group.mode, options.getColor(), ["mpunct"]);
|
2406 | },
|
2407 |
|
2408 | ordgroup: function(group, options, prev) {
|
2409 | return makeSpan(
|
2410 | ["mord", options.style.cls()],
|
2411 | buildExpression(group.value, options.reset())
|
2412 | );
|
2413 | },
|
2414 |
|
2415 | text: function(group, options, prev) {
|
2416 | return makeSpan(["text", "mord", options.style.cls()],
|
2417 | buildExpression(group.value.body, options.reset()));
|
2418 | },
|
2419 |
|
2420 | color: function(group, options, prev) {
|
2421 | var elements = buildExpression(
|
2422 | group.value.value,
|
2423 | options.withColor(group.value.color),
|
2424 | prev
|
2425 | );
|
2426 |
|
2427 | // \color isn't supposed to affect the type of the elements it contains.
|
2428 | // To accomplish this, we wrap the results in a fragment, so the inner
|
2429 | // elements will be able to directly interact with their neighbors. For
|
2430 | // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3`
|
2431 | return new buildCommon.makeFragment(elements);
|
2432 | },
|
2433 |
|
2434 | supsub: function(group, options, prev) {
|
2435 | // Superscript and subscripts are handled in the TeXbook on page
|
2436 | // 445-446, rules 18(a-f).
|
2437 |
|
2438 | // Here is where we defer to the inner group if it should handle
|
2439 | // superscripts and subscripts itself.
|
2440 | if (shouldHandleSupSub(group.value.base, options)) {
|
2441 | return groupTypes[group.value.base.type](group, options, prev);
|
2442 | }
|
2443 |
|
2444 | var base = buildGroup(group.value.base, options.reset());
|
2445 | var supmid, submid, sup, sub;
|
2446 |
|
2447 | if (group.value.sup) {
|
2448 | sup = buildGroup(group.value.sup,
|
2449 | options.withStyle(options.style.sup()));
|
2450 | supmid = makeSpan(
|
2451 | [options.style.reset(), options.style.sup().cls()], [sup]);
|
2452 | }
|
2453 |
|
2454 | if (group.value.sub) {
|
2455 | sub = buildGroup(group.value.sub,
|
2456 | options.withStyle(options.style.sub()));
|
2457 | submid = makeSpan(
|
2458 | [options.style.reset(), options.style.sub().cls()], [sub]);
|
2459 | }
|
2460 |
|
2461 | // Rule 18a
|
2462 | var supShift, subShift;
|
2463 | if (isCharacterBox(group.value.base)) {
|
2464 | supShift = 0;
|
2465 | subShift = 0;
|
2466 | } else {
|
2467 | supShift = base.height - fontMetrics.metrics.supDrop;
|
2468 | subShift = base.depth + fontMetrics.metrics.subDrop;
|
2469 | }
|
2470 |
|
2471 | // Rule 18c
|
2472 | var minSupShift;
|
2473 | if (options.style === Style.DISPLAY) {
|
2474 | minSupShift = fontMetrics.metrics.sup1;
|
2475 | } else if (options.style.cramped) {
|
2476 | minSupShift = fontMetrics.metrics.sup3;
|
2477 | } else {
|
2478 | minSupShift = fontMetrics.metrics.sup2;
|
2479 | }
|
2480 |
|
2481 | // scriptspace is a font-size-independent size, so scale it
|
2482 | // appropriately
|
2483 | var multiplier = Style.TEXT.sizeMultiplier *
|
2484 | options.style.sizeMultiplier;
|
2485 | var scriptspace =
|
2486 | (0.5 / fontMetrics.metrics.ptPerEm) / multiplier + "em";
|
2487 |
|
2488 | var supsub;
|
2489 | if (!group.value.sup) {
|
2490 | // Rule 18b
|
2491 | subShift = Math.max(
|
2492 | subShift, fontMetrics.metrics.sub1,
|
2493 | sub.height - 0.8 * fontMetrics.metrics.xHeight);
|
2494 |
|
2495 | supsub = buildCommon.makeVList([
|
2496 | {type: "elem", elem: submid}
|
2497 | ], "shift", subShift, options);
|
2498 |
|
2499 | supsub.children[0].style.marginRight = scriptspace;
|
2500 |
|
2501 | // Subscripts shouldn't be shifted by the base's italic correction.
|
2502 | // Account for that by shifting the subscript back the appropriate
|
2503 | // amount. Note we only do this when the base is a single symbol.
|
2504 | if (base instanceof domTree.symbolNode) {
|
2505 | supsub.children[0].style.marginLeft = -base.italic + "em";
|
2506 | }
|
2507 | } else if (!group.value.sub) {
|
2508 | // Rule 18c, d
|
2509 | supShift = Math.max(supShift, minSupShift,
|
2510 | sup.depth + 0.25 * fontMetrics.metrics.xHeight);
|
2511 |
|
2512 | supsub = buildCommon.makeVList([
|
2513 | {type: "elem", elem: supmid}
|
2514 | ], "shift", -supShift, options);
|
2515 |
|
2516 | supsub.children[0].style.marginRight = scriptspace;
|
2517 | } else {
|
2518 | supShift = Math.max(
|
2519 | supShift, minSupShift,
|
2520 | sup.depth + 0.25 * fontMetrics.metrics.xHeight);
|
2521 | subShift = Math.max(subShift, fontMetrics.metrics.sub2);
|
2522 |
|
2523 | var ruleWidth = fontMetrics.metrics.defaultRuleThickness;
|
2524 |
|
2525 | // Rule 18e
|
2526 | if ((supShift - sup.depth) - (sub.height - subShift) <
|
2527 | 4 * ruleWidth) {
|
2528 | subShift = 4 * ruleWidth - (supShift - sup.depth) + sub.height;
|
2529 | var psi = 0.8 * fontMetrics.metrics.xHeight -
|
2530 | (supShift - sup.depth);
|
2531 | if (psi > 0) {
|
2532 | supShift += psi;
|
2533 | subShift -= psi;
|
2534 | }
|
2535 | }
|
2536 |
|
2537 | supsub = buildCommon.makeVList([
|
2538 | {type: "elem", elem: submid, shift: subShift},
|
2539 | {type: "elem", elem: supmid, shift: -supShift}
|
2540 | ], "individualShift", null, options);
|
2541 |
|
2542 | // See comment above about subscripts not being shifted
|
2543 | if (base instanceof domTree.symbolNode) {
|
2544 | supsub.children[0].style.marginLeft = -base.italic + "em";
|
2545 | }
|
2546 |
|
2547 | supsub.children[0].style.marginRight = scriptspace;
|
2548 | supsub.children[1].style.marginRight = scriptspace;
|
2549 | }
|
2550 |
|
2551 | return makeSpan([getTypeOfGroup(group.value.base)],
|
2552 | [base, supsub]);
|
2553 | },
|
2554 |
|
2555 | genfrac: function(group, options, prev) {
|
2556 | // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e).
|
2557 | // Figure out what style this fraction should be in based on the
|
2558 | // function used
|
2559 | var fstyle = options.style;
|
2560 | if (group.value.size === "display") {
|
2561 | fstyle = Style.DISPLAY;
|
2562 | } else if (group.value.size === "text") {
|
2563 | fstyle = Style.TEXT;
|
2564 | }
|
2565 |
|
2566 | var nstyle = fstyle.fracNum();
|
2567 | var dstyle = fstyle.fracDen();
|
2568 |
|
2569 | var numer = buildGroup(group.value.numer, options.withStyle(nstyle));
|
2570 | var numerreset = makeSpan([fstyle.reset(), nstyle.cls()], [numer]);
|
2571 |
|
2572 | var denom = buildGroup(group.value.denom, options.withStyle(dstyle));
|
2573 | var denomreset = makeSpan([fstyle.reset(), dstyle.cls()], [denom]);
|
2574 |
|
2575 | var ruleWidth;
|
2576 | if (group.value.hasBarLine) {
|
2577 | ruleWidth = fontMetrics.metrics.defaultRuleThickness /
|
2578 | options.style.sizeMultiplier;
|
2579 | } else {
|
2580 | ruleWidth = 0;
|
2581 | }
|
2582 |
|
2583 | // Rule 15b
|
2584 | var numShift;
|
2585 | var clearance;
|
2586 | var denomShift;
|
2587 | if (fstyle.size === Style.DISPLAY.size) {
|
2588 | numShift = fontMetrics.metrics.num1;
|
2589 | if (ruleWidth > 0) {
|
2590 | clearance = 3 * ruleWidth;
|
2591 | } else {
|
2592 | clearance = 7 * fontMetrics.metrics.defaultRuleThickness;
|
2593 | }
|
2594 | denomShift = fontMetrics.metrics.denom1;
|
2595 | } else {
|
2596 | if (ruleWidth > 0) {
|
2597 | numShift = fontMetrics.metrics.num2;
|
2598 | clearance = ruleWidth;
|
2599 | } else {
|
2600 | numShift = fontMetrics.metrics.num3;
|
2601 | clearance = 3 * fontMetrics.metrics.defaultRuleThickness;
|
2602 | }
|
2603 | denomShift = fontMetrics.metrics.denom2;
|
2604 | }
|
2605 |
|
2606 | var frac;
|
2607 | if (ruleWidth === 0) {
|
2608 | // Rule 15c
|
2609 | var candiateClearance =
|
2610 | (numShift - numer.depth) - (denom.height - denomShift);
|
2611 | if (candiateClearance < clearance) {
|
2612 | numShift += 0.5 * (clearance - candiateClearance);
|
2613 | denomShift += 0.5 * (clearance - candiateClearance);
|
2614 | }
|
2615 |
|
2616 | frac = buildCommon.makeVList([
|
2617 | {type: "elem", elem: denomreset, shift: denomShift},
|
2618 | {type: "elem", elem: numerreset, shift: -numShift}
|
2619 | ], "individualShift", null, options);
|
2620 | } else {
|
2621 | // Rule 15d
|
2622 | var axisHeight = fontMetrics.metrics.axisHeight;
|
2623 |
|
2624 | if ((numShift - numer.depth) - (axisHeight + 0.5 * ruleWidth) <
|
2625 | clearance) {
|
2626 | numShift +=
|
2627 | clearance - ((numShift - numer.depth) -
|
2628 | (axisHeight + 0.5 * ruleWidth));
|
2629 | }
|
2630 |
|
2631 | if ((axisHeight - 0.5 * ruleWidth) - (denom.height - denomShift) <
|
2632 | clearance) {
|
2633 | denomShift +=
|
2634 | clearance - ((axisHeight - 0.5 * ruleWidth) -
|
2635 | (denom.height - denomShift));
|
2636 | }
|
2637 |
|
2638 | var mid = makeSpan(
|
2639 | [options.style.reset(), Style.TEXT.cls(), "frac-line"]);
|
2640 | // Manually set the height of the line because its height is
|
2641 | // created in CSS
|
2642 | mid.height = ruleWidth;
|
2643 |
|
2644 | var midShift = -(axisHeight - 0.5 * ruleWidth);
|
2645 |
|
2646 | frac = buildCommon.makeVList([
|
2647 | {type: "elem", elem: denomreset, shift: denomShift},
|
2648 | {type: "elem", elem: mid, shift: midShift},
|
2649 | {type: "elem", elem: numerreset, shift: -numShift}
|
2650 | ], "individualShift", null, options);
|
2651 | }
|
2652 |
|
2653 | // Since we manually change the style sometimes (with \dfrac or \tfrac),
|
2654 | // account for the possible size change here.
|
2655 | frac.height *= fstyle.sizeMultiplier / options.style.sizeMultiplier;
|
2656 | frac.depth *= fstyle.sizeMultiplier / options.style.sizeMultiplier;
|
2657 |
|
2658 | // Rule 15e
|
2659 | var delimSize;
|
2660 | if (fstyle.size === Style.DISPLAY.size) {
|
2661 | delimSize = fontMetrics.metrics.delim1;
|
2662 | } else {
|
2663 | delimSize = fontMetrics.metrics.getDelim2(fstyle);
|
2664 | }
|
2665 |
|
2666 | var leftDelim, rightDelim;
|
2667 | if (group.value.leftDelim == null) {
|
2668 | leftDelim = makeNullDelimiter(options);
|
2669 | } else {
|
2670 | leftDelim = delimiter.customSizedDelim(
|
2671 | group.value.leftDelim, delimSize, true,
|
2672 | options.withStyle(fstyle), group.mode);
|
2673 | }
|
2674 | if (group.value.rightDelim == null) {
|
2675 | rightDelim = makeNullDelimiter(options);
|
2676 | } else {
|
2677 | rightDelim = delimiter.customSizedDelim(
|
2678 | group.value.rightDelim, delimSize, true,
|
2679 | options.withStyle(fstyle), group.mode);
|
2680 | }
|
2681 |
|
2682 | return makeSpan(
|
2683 | ["mord", options.style.reset(), fstyle.cls()],
|
2684 | [leftDelim, makeSpan(["mfrac"], [frac]), rightDelim],
|
2685 | options.getColor());
|
2686 | },
|
2687 |
|
2688 | array: function(group, options, prev) {
|
2689 | var r, c;
|
2690 | var nr = group.value.body.length;
|
2691 | var nc = 0;
|
2692 | var body = new Array(nr);
|
2693 |
|
2694 | // Horizontal spacing
|
2695 | var pt = 1 / fontMetrics.metrics.ptPerEm;
|
2696 | var arraycolsep = 5 * pt; // \arraycolsep in article.cls
|
2697 |
|
2698 | // Vertical spacing
|
2699 | var baselineskip = 12 * pt; // see size10.clo
|
2700 | // Default \arraystretch from lttab.dtx
|
2701 | // TODO(gagern): may get redefined once we have user-defined macros
|
2702 | var arraystretch = utils.deflt(group.value.arraystretch, 1);
|
2703 | var arrayskip = arraystretch * baselineskip;
|
2704 | var arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and
|
2705 | var arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx
|
2706 |
|
2707 | var totalHeight = 0;
|
2708 | for (r = 0; r < group.value.body.length; ++r) {
|
2709 | var inrow = group.value.body[r];
|
2710 | var height = arstrutHeight; // \@array adds an \@arstrut
|
2711 | var depth = arstrutDepth; // to each tow (via the template)
|
2712 |
|
2713 | if (nc < inrow.length) {
|
2714 | nc = inrow.length;
|
2715 | }
|
2716 |
|
2717 | var outrow = new Array(inrow.length);
|
2718 | for (c = 0; c < inrow.length; ++c) {
|
2719 | var elt = buildGroup(inrow[c], options);
|
2720 | if (depth < elt.depth) {
|
2721 | depth = elt.depth;
|
2722 | }
|
2723 | if (height < elt.height) {
|
2724 | height = elt.height;
|
2725 | }
|
2726 | outrow[c] = elt;
|
2727 | }
|
2728 |
|
2729 | var gap = 0;
|
2730 | if (group.value.rowGaps[r]) {
|
2731 | gap = group.value.rowGaps[r].value;
|
2732 | switch (gap.unit) {
|
2733 | case "em":
|
2734 | gap = gap.number;
|
2735 | break;
|
2736 | case "ex":
|
2737 | gap = gap.number * fontMetrics.metrics.emPerEx;
|
2738 | break;
|
2739 | default:
|
2740 | console.error("Can't handle unit " + gap.unit);
|
2741 | gap = 0;
|
2742 | }
|
2743 | if (gap > 0) { // \@argarraycr
|
2744 | gap += arstrutDepth;
|
2745 | if (depth < gap) {
|
2746 | depth = gap; // \@xargarraycr
|
2747 | }
|
2748 | gap = 0;
|
2749 | }
|
2750 | }
|
2751 |
|
2752 | outrow.height = height;
|
2753 | outrow.depth = depth;
|
2754 | totalHeight += height;
|
2755 | outrow.pos = totalHeight;
|
2756 | totalHeight += depth + gap; // \@yargarraycr
|
2757 | body[r] = outrow;
|
2758 | }
|
2759 |
|
2760 | var offset = totalHeight / 2 + fontMetrics.metrics.axisHeight;
|
2761 | var colDescriptions = group.value.cols || [];
|
2762 | var cols = [];
|
2763 | var colSep;
|
2764 | var colDescrNum;
|
2765 | for (c = 0, colDescrNum = 0;
|
2766 | // Continue while either there are more columns or more column
|
2767 | // descriptions, so trailing separators don't get lost.
|
2768 | c < nc || colDescrNum < colDescriptions.length;
|
2769 | ++c, ++colDescrNum) {
|
2770 |
|
2771 | var colDescr = colDescriptions[colDescrNum] || {};
|
2772 |
|
2773 | var firstSeparator = true;
|
2774 | while (colDescr.type === "separator") {
|
2775 | // If there is more than one separator in a row, add a space
|
2776 | // between them.
|
2777 | if (!firstSeparator) {
|
2778 | colSep = makeSpan(["arraycolsep"], []);
|
2779 | colSep.style.width =
|
2780 | fontMetrics.metrics.doubleRuleSep + "em";
|
2781 | cols.push(colSep);
|
2782 | }
|
2783 |
|
2784 | if (colDescr.separator === "|") {
|
2785 | var separator = makeSpan(
|
2786 | ["vertical-separator"],
|
2787 | []);
|
2788 | separator.style.height = totalHeight + "em";
|
2789 | separator.style.verticalAlign =
|
2790 | -(totalHeight - offset) + "em";
|
2791 |
|
2792 | cols.push(separator);
|
2793 | } else {
|
2794 | throw new ParseError(
|
2795 | "Invalid separator type: " + colDescr.separator);
|
2796 | }
|
2797 |
|
2798 | colDescrNum++;
|
2799 | colDescr = colDescriptions[colDescrNum] || {};
|
2800 | firstSeparator = false;
|
2801 | }
|
2802 |
|
2803 | if (c >= nc) {
|
2804 | continue;
|
2805 | }
|
2806 |
|
2807 | var sepwidth;
|
2808 | if (c > 0 || group.value.hskipBeforeAndAfter) {
|
2809 | sepwidth = utils.deflt(colDescr.pregap, arraycolsep);
|
2810 | if (sepwidth !== 0) {
|
2811 | colSep = makeSpan(["arraycolsep"], []);
|
2812 | colSep.style.width = sepwidth + "em";
|
2813 | cols.push(colSep);
|
2814 | }
|
2815 | }
|
2816 |
|
2817 | var col = [];
|
2818 | for (r = 0; r < nr; ++r) {
|
2819 | var row = body[r];
|
2820 | var elem = row[c];
|
2821 | if (!elem) {
|
2822 | continue;
|
2823 | }
|
2824 | var shift = row.pos - offset;
|
2825 | elem.depth = row.depth;
|
2826 | elem.height = row.height;
|
2827 | col.push({type: "elem", elem: elem, shift: shift});
|
2828 | }
|
2829 |
|
2830 | col = buildCommon.makeVList(col, "individualShift", null, options);
|
2831 | col = makeSpan(
|
2832 | ["col-align-" + (colDescr.align || "c")],
|
2833 | [col]);
|
2834 | cols.push(col);
|
2835 |
|
2836 | if (c < nc - 1 || group.value.hskipBeforeAndAfter) {
|
2837 | sepwidth = utils.deflt(colDescr.postgap, arraycolsep);
|
2838 | if (sepwidth !== 0) {
|
2839 | colSep = makeSpan(["arraycolsep"], []);
|
2840 | colSep.style.width = sepwidth + "em";
|
2841 | cols.push(colSep);
|
2842 | }
|
2843 | }
|
2844 | }
|
2845 | body = makeSpan(["mtable"], cols);
|
2846 | return makeSpan(["mord"], [body], options.getColor());
|
2847 | },
|
2848 |
|
2849 | spacing: function(group, options, prev) {
|
2850 | if (group.value === "\\ " || group.value === "\\space" ||
|
2851 | group.value === " " || group.value === "~") {
|
2852 | // Spaces are generated by adding an actual space. Each of these
|
2853 | // things has an entry in the symbols table, so these will be turned
|
2854 | // into appropriate outputs.
|
2855 | return makeSpan(
|
2856 | ["mord", "mspace"],
|
2857 | [buildCommon.mathsym(group.value, group.mode)]
|
2858 | );
|
2859 | } else {
|
2860 | // Other kinds of spaces are of arbitrary width. We use CSS to
|
2861 | // generate these.
|
2862 | return makeSpan(
|
2863 | ["mord", "mspace",
|
2864 | buildCommon.spacingFunctions[group.value].className]);
|
2865 | }
|
2866 | },
|
2867 |
|
2868 | llap: function(group, options, prev) {
|
2869 | var inner = makeSpan(
|
2870 | ["inner"], [buildGroup(group.value.body, options.reset())]);
|
2871 | var fix = makeSpan(["fix"], []);
|
2872 | return makeSpan(
|
2873 | ["llap", options.style.cls()], [inner, fix]);
|
2874 | },
|
2875 |
|
2876 | rlap: function(group, options, prev) {
|
2877 | var inner = makeSpan(
|
2878 | ["inner"], [buildGroup(group.value.body, options.reset())]);
|
2879 | var fix = makeSpan(["fix"], []);
|
2880 | return makeSpan(
|
2881 | ["rlap", options.style.cls()], [inner, fix]);
|
2882 | },
|
2883 |
|
2884 | op: function(group, options, prev) {
|
2885 | // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
|
2886 | var supGroup;
|
2887 | var subGroup;
|
2888 | var hasLimits = false;
|
2889 | if (group.type === "supsub" ) {
|
2890 | // If we have limits, supsub will pass us its group to handle. Pull
|
2891 | // out the superscript and subscript and set the group to the op in
|
2892 | // its base.
|
2893 | supGroup = group.value.sup;
|
2894 | subGroup = group.value.sub;
|
2895 | group = group.value.base;
|
2896 | hasLimits = true;
|
2897 | }
|
2898 |
|
2899 | // Most operators have a large successor symbol, but these don't.
|
2900 | var noSuccessor = [
|
2901 | "\\smallint"
|
2902 | ];
|
2903 |
|
2904 | var large = false;
|
2905 | if (options.style.size === Style.DISPLAY.size &&
|
2906 | group.value.symbol &&
|
2907 | !utils.contains(noSuccessor, group.value.body)) {
|
2908 |
|
2909 | // Most symbol operators get larger in displaystyle (rule 13)
|
2910 | large = true;
|
2911 | }
|
2912 |
|
2913 | var base;
|
2914 | var baseShift = 0;
|
2915 | var slant = 0;
|
2916 | if (group.value.symbol) {
|
2917 | // If this is a symbol, create the symbol.
|
2918 | var style = large ? "Size2-Regular" : "Size1-Regular";
|
2919 | base = buildCommon.makeSymbol(
|
2920 | group.value.body, style, "math", options.getColor(),
|
2921 | ["op-symbol", large ? "large-op" : "small-op", "mop"]);
|
2922 |
|
2923 | // Shift the symbol so its center lies on the axis (rule 13). It
|
2924 | // appears that our fonts have the centers of the symbols already
|
2925 | // almost on the axis, so these numbers are very small. Note we
|
2926 | // don't actually apply this here, but instead it is used either in
|
2927 | // the vlist creation or separately when there are no limits.
|
2928 | baseShift = (base.height - base.depth) / 2 -
|
2929 | fontMetrics.metrics.axisHeight *
|
2930 | options.style.sizeMultiplier;
|
2931 |
|
2932 | // The slant of the symbol is just its italic correction.
|
2933 | slant = base.italic;
|
2934 | } else {
|
2935 | // Otherwise, this is a text operator. Build the text from the
|
2936 | // operator's name.
|
2937 | // TODO(emily): Add a space in the middle of some of these
|
2938 | // operators, like \limsup
|
2939 | var output = [];
|
2940 | for (var i = 1; i < group.value.body.length; i++) {
|
2941 | output.push(buildCommon.mathsym(group.value.body[i], group.mode));
|
2942 | }
|
2943 | base = makeSpan(["mop"], output, options.getColor());
|
2944 | }
|
2945 |
|
2946 | if (hasLimits) {
|
2947 | // IE 8 clips \int if it is in a display: inline-block. We wrap it
|
2948 | // in a new span so it is an inline, and works.
|
2949 | base = makeSpan([], [base]);
|
2950 |
|
2951 | var supmid, supKern, submid, subKern;
|
2952 | // We manually have to handle the superscripts and subscripts. This,
|
2953 | // aside from the kern calculations, is copied from supsub.
|
2954 | if (supGroup) {
|
2955 | var sup = buildGroup(
|
2956 | supGroup, options.withStyle(options.style.sup()));
|
2957 | supmid = makeSpan(
|
2958 | [options.style.reset(), options.style.sup().cls()], [sup]);
|
2959 |
|
2960 | supKern = Math.max(
|
2961 | fontMetrics.metrics.bigOpSpacing1,
|
2962 | fontMetrics.metrics.bigOpSpacing3 - sup.depth);
|
2963 | }
|
2964 |
|
2965 | if (subGroup) {
|
2966 | var sub = buildGroup(
|
2967 | subGroup, options.withStyle(options.style.sub()));
|
2968 | submid = makeSpan(
|
2969 | [options.style.reset(), options.style.sub().cls()],
|
2970 | [sub]);
|
2971 |
|
2972 | subKern = Math.max(
|
2973 | fontMetrics.metrics.bigOpSpacing2,
|
2974 | fontMetrics.metrics.bigOpSpacing4 - sub.height);
|
2975 | }
|
2976 |
|
2977 | // Build the final group as a vlist of the possible subscript, base,
|
2978 | // and possible superscript.
|
2979 | var finalGroup, top, bottom;
|
2980 | if (!supGroup) {
|
2981 | top = base.height - baseShift;
|
2982 |
|
2983 | finalGroup = buildCommon.makeVList([
|
2984 | {type: "kern", size: fontMetrics.metrics.bigOpSpacing5},
|
2985 | {type: "elem", elem: submid},
|
2986 | {type: "kern", size: subKern},
|
2987 | {type: "elem", elem: base}
|
2988 | ], "top", top, options);
|
2989 |
|
2990 | // Here, we shift the limits by the slant of the symbol. Note
|
2991 | // that we are supposed to shift the limits by 1/2 of the slant,
|
2992 | // but since we are centering the limits adding a full slant of
|
2993 | // margin will shift by 1/2 that.
|
2994 | finalGroup.children[0].style.marginLeft = -slant + "em";
|
2995 | } else if (!subGroup) {
|
2996 | bottom = base.depth + baseShift;
|
2997 |
|
2998 | finalGroup = buildCommon.makeVList([
|
2999 | {type: "elem", elem: base},
|
3000 | {type: "kern", size: supKern},
|
3001 | {type: "elem", elem: supmid},
|
3002 | {type: "kern", size: fontMetrics.metrics.bigOpSpacing5}
|
3003 | ], "bottom", bottom, options);
|
3004 |
|
3005 | // See comment above about slants
|
3006 | finalGroup.children[1].style.marginLeft = slant + "em";
|
3007 | } else if (!supGroup && !subGroup) {
|
3008 | // This case probably shouldn't occur (this would mean the
|
3009 | // supsub was sending us a group with no superscript or
|
3010 | // subscript) but be safe.
|
3011 | return base;
|
3012 | } else {
|
3013 | bottom = fontMetrics.metrics.bigOpSpacing5 +
|
3014 | submid.height + submid.depth +
|
3015 | subKern +
|
3016 | base.depth + baseShift;
|
3017 |
|
3018 | finalGroup = buildCommon.makeVList([
|
3019 | {type: "kern", size: fontMetrics.metrics.bigOpSpacing5},
|
3020 | {type: "elem", elem: submid},
|
3021 | {type: "kern", size: subKern},
|
3022 | {type: "elem", elem: base},
|
3023 | {type: "kern", size: supKern},
|
3024 | {type: "elem", elem: supmid},
|
3025 | {type: "kern", size: fontMetrics.metrics.bigOpSpacing5}
|
3026 | ], "bottom", bottom, options);
|
3027 |
|
3028 | // See comment above about slants
|
3029 | finalGroup.children[0].style.marginLeft = -slant + "em";
|
3030 | finalGroup.children[2].style.marginLeft = slant + "em";
|
3031 | }
|
3032 |
|
3033 | return makeSpan(["mop", "op-limits"], [finalGroup]);
|
3034 | } else {
|
3035 | if (group.value.symbol) {
|
3036 | base.style.top = baseShift + "em";
|
3037 | }
|
3038 |
|
3039 | return base;
|
3040 | }
|
3041 | },
|
3042 |
|
3043 | katex: function(group, options, prev) {
|
3044 | // The KaTeX logo. The offsets for the K and a were chosen to look
|
3045 | // good, but the offsets for the T, E, and X were taken from the
|
3046 | // definition of \TeX in TeX (see TeXbook pg. 356)
|
3047 | var k = makeSpan(
|
3048 | ["k"], [buildCommon.mathsym("K", group.mode)]);
|
3049 | var a = makeSpan(
|
3050 | ["a"], [buildCommon.mathsym("A", group.mode)]);
|
3051 |
|
3052 | a.height = (a.height + 0.2) * 0.75;
|
3053 | a.depth = (a.height - 0.2) * 0.75;
|
3054 |
|
3055 | var t = makeSpan(
|
3056 | ["t"], [buildCommon.mathsym("T", group.mode)]);
|
3057 | var e = makeSpan(
|
3058 | ["e"], [buildCommon.mathsym("E", group.mode)]);
|
3059 |
|
3060 | e.height = (e.height - 0.2155);
|
3061 | e.depth = (e.depth + 0.2155);
|
3062 |
|
3063 | var x = makeSpan(
|
3064 | ["x"], [buildCommon.mathsym("X", group.mode)]);
|
3065 |
|
3066 | return makeSpan(
|
3067 | ["katex-logo", "mord"], [k, a, t, e, x], options.getColor());
|
3068 | },
|
3069 |
|
3070 | overline: function(group, options, prev) {
|
3071 | // Overlines are handled in the TeXbook pg 443, Rule 9.
|
3072 |
|
3073 | // Build the inner group in the cramped style.
|
3074 | var innerGroup = buildGroup(group.value.body,
|
3075 | options.withStyle(options.style.cramp()));
|
3076 |
|
3077 | var ruleWidth = fontMetrics.metrics.defaultRuleThickness /
|
3078 | options.style.sizeMultiplier;
|
3079 |
|
3080 | // Create the line above the body
|
3081 | var line = makeSpan(
|
3082 | [options.style.reset(), Style.TEXT.cls(), "overline-line"]);
|
3083 | line.height = ruleWidth;
|
3084 | line.maxFontSize = 1.0;
|
3085 |
|
3086 | // Generate the vlist, with the appropriate kerns
|
3087 | var vlist = buildCommon.makeVList([
|
3088 | {type: "elem", elem: innerGroup},
|
3089 | {type: "kern", size: 3 * ruleWidth},
|
3090 | {type: "elem", elem: line},
|
3091 | {type: "kern", size: ruleWidth}
|
3092 | ], "firstBaseline", null, options);
|
3093 |
|
3094 | return makeSpan(["overline", "mord"], [vlist], options.getColor());
|
3095 | },
|
3096 |
|
3097 | sqrt: function(group, options, prev) {
|
3098 | // Square roots are handled in the TeXbook pg. 443, Rule 11.
|
3099 |
|
3100 | // First, we do the same steps as in overline to build the inner group
|
3101 | // and line
|
3102 | var inner = buildGroup(group.value.body,
|
3103 | options.withStyle(options.style.cramp()));
|
3104 |
|
3105 | var ruleWidth = fontMetrics.metrics.defaultRuleThickness /
|
3106 | options.style.sizeMultiplier;
|
3107 |
|
3108 | var line = makeSpan(
|
3109 | [options.style.reset(), Style.TEXT.cls(), "sqrt-line"], [],
|
3110 | options.getColor());
|
3111 | line.height = ruleWidth;
|
3112 | line.maxFontSize = 1.0;
|
3113 |
|
3114 | var phi = ruleWidth;
|
3115 | if (options.style.id < Style.TEXT.id) {
|
3116 | phi = fontMetrics.metrics.xHeight;
|
3117 | }
|
3118 |
|
3119 | // Calculate the clearance between the body and line
|
3120 | var lineClearance = ruleWidth + phi / 4;
|
3121 |
|
3122 | var innerHeight =
|
3123 | (inner.height + inner.depth) * options.style.sizeMultiplier;
|
3124 | var minDelimiterHeight = innerHeight + lineClearance + ruleWidth;
|
3125 |
|
3126 | // Create a \surd delimiter of the required minimum size
|
3127 | var delim = makeSpan(["sqrt-sign"], [
|
3128 | delimiter.customSizedDelim("\\surd", minDelimiterHeight,
|
3129 | false, options, group.mode)],
|
3130 | options.getColor());
|
3131 |
|
3132 | var delimDepth = (delim.height + delim.depth) - ruleWidth;
|
3133 |
|
3134 | // Adjust the clearance based on the delimiter size
|
3135 | if (delimDepth > inner.height + inner.depth + lineClearance) {
|
3136 | lineClearance =
|
3137 | (lineClearance + delimDepth - inner.height - inner.depth) / 2;
|
3138 | }
|
3139 |
|
3140 | // Shift the delimiter so that its top lines up with the top of the line
|
3141 | var delimShift = -(inner.height + lineClearance + ruleWidth) + delim.height;
|
3142 | delim.style.top = delimShift + "em";
|
3143 | delim.height -= delimShift;
|
3144 | delim.depth += delimShift;
|
3145 |
|
3146 | // We add a special case here, because even when `inner` is empty, we
|
3147 | // still get a line. So, we use a simple heuristic to decide if we
|
3148 | // should omit the body entirely. (note this doesn't work for something
|
3149 | // like `\sqrt{\rlap{x}}`, but if someone is doing that they deserve for
|
3150 | // it not to work.
|
3151 | var body;
|
3152 | if (inner.height === 0 && inner.depth === 0) {
|
3153 | body = makeSpan();
|
3154 | } else {
|
3155 | body = buildCommon.makeVList([
|
3156 | {type: "elem", elem: inner},
|
3157 | {type: "kern", size: lineClearance},
|
3158 | {type: "elem", elem: line},
|
3159 | {type: "kern", size: ruleWidth}
|
3160 | ], "firstBaseline", null, options);
|
3161 | }
|
3162 |
|
3163 | if (!group.value.index) {
|
3164 | return makeSpan(["sqrt", "mord"], [delim, body]);
|
3165 | } else {
|
3166 | // Handle the optional root index
|
3167 |
|
3168 | // The index is always in scriptscript style
|
3169 | var root = buildGroup(
|
3170 | group.value.index,
|
3171 | options.withStyle(Style.SCRIPTSCRIPT));
|
3172 | var rootWrap = makeSpan(
|
3173 | [options.style.reset(), Style.SCRIPTSCRIPT.cls()],
|
3174 | [root]);
|
3175 |
|
3176 | // Figure out the height and depth of the inner part
|
3177 | var innerRootHeight = Math.max(delim.height, body.height);
|
3178 | var innerRootDepth = Math.max(delim.depth, body.depth);
|
3179 |
|
3180 | // The amount the index is shifted by. This is taken from the TeX
|
3181 | // source, in the definition of `\r@@t`.
|
3182 | var toShift = 0.6 * (innerRootHeight - innerRootDepth);
|
3183 |
|
3184 | // Build a VList with the superscript shifted up correctly
|
3185 | var rootVList = buildCommon.makeVList(
|
3186 | [{type: "elem", elem: rootWrap}],
|
3187 | "shift", -toShift, options);
|
3188 | // Add a class surrounding it so we can add on the appropriate
|
3189 | // kerning
|
3190 | var rootVListWrap = makeSpan(["root"], [rootVList]);
|
3191 |
|
3192 | return makeSpan(["sqrt", "mord"], [rootVListWrap, delim, body]);
|
3193 | }
|
3194 | },
|
3195 |
|
3196 | sizing: function(group, options, prev) {
|
3197 | // Handle sizing operators like \Huge. Real TeX doesn't actually allow
|
3198 | // these functions inside of math expressions, so we do some special
|
3199 | // handling.
|
3200 | var inner = buildExpression(group.value.value,
|
3201 | options.withSize(group.value.size), prev);
|
3202 |
|
3203 | var span = makeSpan(["mord"],
|
3204 | [makeSpan(["sizing", "reset-" + options.size, group.value.size,
|
3205 | options.style.cls()],
|
3206 | inner)]);
|
3207 |
|
3208 | // Calculate the correct maxFontSize manually
|
3209 | var fontSize = buildCommon.sizingMultiplier[group.value.size];
|
3210 | span.maxFontSize = fontSize * options.style.sizeMultiplier;
|
3211 |
|
3212 | return span;
|
3213 | },
|
3214 |
|
3215 | styling: function(group, options, prev) {
|
3216 | // Style changes are handled in the TeXbook on pg. 442, Rule 3.
|
3217 |
|
3218 | // Figure out what style we're changing to.
|
3219 | var style = {
|
3220 | "display": Style.DISPLAY,
|
3221 | "text": Style.TEXT,
|
3222 | "script": Style.SCRIPT,
|
3223 | "scriptscript": Style.SCRIPTSCRIPT
|
3224 | };
|
3225 |
|
3226 | var newStyle = style[group.value.style];
|
3227 |
|
3228 | // Build the inner expression in the new style.
|
3229 | var inner = buildExpression(
|
3230 | group.value.value, options.withStyle(newStyle), prev);
|
3231 |
|
3232 | return makeSpan([options.style.reset(), newStyle.cls()], inner);
|
3233 | },
|
3234 |
|
3235 | font: function(group, options, prev) {
|
3236 | var font = group.value.font;
|
3237 | return buildGroup(group.value.body, options.withFont(font), prev);
|
3238 | },
|
3239 |
|
3240 | delimsizing: function(group, options, prev) {
|
3241 | var delim = group.value.value;
|
3242 |
|
3243 | if (delim === ".") {
|
3244 | // Empty delimiters still count as elements, even though they don't
|
3245 | // show anything.
|
3246 | return makeSpan([groupToType[group.value.delimType]]);
|
3247 | }
|
3248 |
|
3249 | // Use delimiter.sizedDelim to generate the delimiter.
|
3250 | return makeSpan(
|
3251 | [groupToType[group.value.delimType]],
|
3252 | [delimiter.sizedDelim(
|
3253 | delim, group.value.size, options, group.mode)]);
|
3254 | },
|
3255 |
|
3256 | leftright: function(group, options, prev) {
|
3257 | // Build the inner expression
|
3258 | var inner = buildExpression(group.value.body, options.reset());
|
3259 |
|
3260 | var innerHeight = 0;
|
3261 | var innerDepth = 0;
|
3262 |
|
3263 | // Calculate its height and depth
|
3264 | for (var i = 0; i < inner.length; i++) {
|
3265 | innerHeight = Math.max(inner[i].height, innerHeight);
|
3266 | innerDepth = Math.max(inner[i].depth, innerDepth);
|
3267 | }
|
3268 |
|
3269 | // The size of delimiters is the same, regardless of what style we are
|
3270 | // in. Thus, to correctly calculate the size of delimiter we need around
|
3271 | // a group, we scale down the inner size based on the size.
|
3272 | innerHeight *= options.style.sizeMultiplier;
|
3273 | innerDepth *= options.style.sizeMultiplier;
|
3274 |
|
3275 | var leftDelim;
|
3276 | if (group.value.left === ".") {
|
3277 | // Empty delimiters in \left and \right make null delimiter spaces.
|
3278 | leftDelim = makeNullDelimiter(options);
|
3279 | } else {
|
3280 | // Otherwise, use leftRightDelim to generate the correct sized
|
3281 | // delimiter.
|
3282 | leftDelim = delimiter.leftRightDelim(
|
3283 | group.value.left, innerHeight, innerDepth, options,
|
3284 | group.mode);
|
3285 | }
|
3286 | // Add it to the beginning of the expression
|
3287 | inner.unshift(leftDelim);
|
3288 |
|
3289 | var rightDelim;
|
3290 | // Same for the right delimiter
|
3291 | if (group.value.right === ".") {
|
3292 | rightDelim = makeNullDelimiter(options);
|
3293 | } else {
|
3294 | rightDelim = delimiter.leftRightDelim(
|
3295 | group.value.right, innerHeight, innerDepth, options,
|
3296 | group.mode);
|
3297 | }
|
3298 | // Add it to the end of the expression.
|
3299 | inner.push(rightDelim);
|
3300 |
|
3301 | return makeSpan(
|
3302 | ["minner", options.style.cls()], inner, options.getColor());
|
3303 | },
|
3304 |
|
3305 | rule: function(group, options, prev) {
|
3306 | // Make an empty span for the rule
|
3307 | var rule = makeSpan(["mord", "rule"], [], options.getColor());
|
3308 |
|
3309 | // Calculate the shift, width, and height of the rule, and account for units
|
3310 | var shift = 0;
|
3311 | if (group.value.shift) {
|
3312 | shift = group.value.shift.number;
|
3313 | if (group.value.shift.unit === "ex") {
|
3314 | shift *= fontMetrics.metrics.xHeight;
|
3315 | }
|
3316 | }
|
3317 |
|
3318 | var width = group.value.width.number;
|
3319 | if (group.value.width.unit === "ex") {
|
3320 | width *= fontMetrics.metrics.xHeight;
|
3321 | }
|
3322 |
|
3323 | var height = group.value.height.number;
|
3324 | if (group.value.height.unit === "ex") {
|
3325 | height *= fontMetrics.metrics.xHeight;
|
3326 | }
|
3327 |
|
3328 | // The sizes of rules are absolute, so make it larger if we are in a
|
3329 | // smaller style.
|
3330 | shift /= options.style.sizeMultiplier;
|
3331 | width /= options.style.sizeMultiplier;
|
3332 | height /= options.style.sizeMultiplier;
|
3333 |
|
3334 | // Style the rule to the right size
|
3335 | rule.style.borderRightWidth = width + "em";
|
3336 | rule.style.borderTopWidth = height + "em";
|
3337 | rule.style.bottom = shift + "em";
|
3338 |
|
3339 | // Record the height and width
|
3340 | rule.width = width;
|
3341 | rule.height = height + shift;
|
3342 | rule.depth = -shift;
|
3343 |
|
3344 | return rule;
|
3345 | },
|
3346 |
|
3347 | accent: function(group, options, prev) {
|
3348 | // Accents are handled in the TeXbook pg. 443, rule 12.
|
3349 | var base = group.value.base;
|
3350 |
|
3351 | var supsubGroup;
|
3352 | if (group.type === "supsub") {
|
3353 | // If our base is a character box, and we have superscripts and
|
3354 | // subscripts, the supsub will defer to us. In particular, we want
|
3355 | // to attach the superscripts and subscripts to the inner body (so
|
3356 | // that the position of the superscripts and subscripts won't be
|
3357 | // affected by the height of the accent). We accomplish this by
|
3358 | // sticking the base of the accent into the base of the supsub, and
|
3359 | // rendering that, while keeping track of where the accent is.
|
3360 |
|
3361 | // The supsub group is the group that was passed in
|
3362 | var supsub = group;
|
3363 | // The real accent group is the base of the supsub group
|
3364 | group = supsub.value.base;
|
3365 | // The character box is the base of the accent group
|
3366 | base = group.value.base;
|
3367 | // Stick the character box into the base of the supsub group
|
3368 | supsub.value.base = base;
|
3369 |
|
3370 | // Rerender the supsub group with its new base, and store that
|
3371 | // result.
|
3372 | supsubGroup = buildGroup(
|
3373 | supsub, options.reset(), prev);
|
3374 | }
|
3375 |
|
3376 | // Build the base group
|
3377 | var body = buildGroup(
|
3378 | base, options.withStyle(options.style.cramp()));
|
3379 |
|
3380 | // Calculate the skew of the accent. This is based on the line "If the
|
3381 | // nucleus is not a single character, let s = 0; otherwise set s to the
|
3382 | // kern amount for the nucleus followed by the \skewchar of its font."
|
3383 | // Note that our skew metrics are just the kern between each character
|
3384 | // and the skewchar.
|
3385 | var skew;
|
3386 | if (isCharacterBox(base)) {
|
3387 | // If the base is a character box, then we want the skew of the
|
3388 | // innermost character. To do that, we find the innermost character:
|
3389 | var baseChar = getBaseElem(base);
|
3390 | // Then, we render its group to get the symbol inside it
|
3391 | var baseGroup = buildGroup(
|
3392 | baseChar, options.withStyle(options.style.cramp()));
|
3393 | // Finally, we pull the skew off of the symbol.
|
3394 | skew = baseGroup.skew;
|
3395 | // Note that we now throw away baseGroup, because the layers we
|
3396 | // removed with getBaseElem might contain things like \color which
|
3397 | // we can't get rid of.
|
3398 | // TODO(emily): Find a better way to get the skew
|
3399 | } else {
|
3400 | skew = 0;
|
3401 | }
|
3402 |
|
3403 | // calculate the amount of space between the body and the accent
|
3404 | var clearance = Math.min(body.height, fontMetrics.metrics.xHeight);
|
3405 |
|
3406 | // Build the accent
|
3407 | var accent = buildCommon.makeSymbol(
|
3408 | group.value.accent, "Main-Regular", "math", options.getColor());
|
3409 | // Remove the italic correction of the accent, because it only serves to
|
3410 | // shift the accent over to a place we don't want.
|
3411 | accent.italic = 0;
|
3412 |
|
3413 | // The \vec character that the fonts use is a combining character, and
|
3414 | // thus shows up much too far to the left. To account for this, we add a
|
3415 | // specific class which shifts the accent over to where we want it.
|
3416 | // TODO(emily): Fix this in a better way, like by changing the font
|
3417 | var vecClass = group.value.accent === "\\vec" ? "accent-vec" : null;
|
3418 |
|
3419 | var accentBody = makeSpan(["accent-body", vecClass], [
|
3420 | makeSpan([], [accent])]);
|
3421 |
|
3422 | accentBody = buildCommon.makeVList([
|
3423 | {type: "elem", elem: body},
|
3424 | {type: "kern", size: -clearance},
|
3425 | {type: "elem", elem: accentBody}
|
3426 | ], "firstBaseline", null, options);
|
3427 |
|
3428 | // Shift the accent over by the skew. Note we shift by twice the skew
|
3429 | // because we are centering the accent, so by adding 2*skew to the left,
|
3430 | // we shift it to the right by 1*skew.
|
3431 | accentBody.children[1].style.marginLeft = 2 * skew + "em";
|
3432 |
|
3433 | var accentWrap = makeSpan(["mord", "accent"], [accentBody]);
|
3434 |
|
3435 | if (supsubGroup) {
|
3436 | // Here, we replace the "base" child of the supsub with our newly
|
3437 | // generated accent.
|
3438 | supsubGroup.children[0] = accentWrap;
|
3439 |
|
3440 | // Since we don't rerun the height calculation after replacing the
|
3441 | // accent, we manually recalculate height.
|
3442 | supsubGroup.height = Math.max(accentWrap.height, supsubGroup.height);
|
3443 |
|
3444 | // Accents should always be ords, even when their innards are not.
|
3445 | supsubGroup.classes[0] = "mord";
|
3446 |
|
3447 | return supsubGroup;
|
3448 | } else {
|
3449 | return accentWrap;
|
3450 | }
|
3451 | },
|
3452 |
|
3453 | phantom: function(group, options, prev) {
|
3454 | var elements = buildExpression(
|
3455 | group.value.value,
|
3456 | options.withPhantom(),
|
3457 | prev
|
3458 | );
|
3459 |
|
3460 | // \phantom isn't supposed to affect the elements it contains.
|
3461 | // See "color" for more details.
|
3462 | return new buildCommon.makeFragment(elements);
|
3463 | }
|
3464 | };
|
3465 |
|
3466 | /**
|
3467 | * buildGroup is the function that takes a group and calls the correct groupType
|
3468 | * function for it. It also handles the interaction of size and style changes
|
3469 | * between parents and children.
|
3470 | */
|
3471 | var buildGroup = function(group, options, prev) {
|
3472 | if (!group) {
|
3473 | return makeSpan();
|
3474 | }
|
3475 |
|
3476 | if (groupTypes[group.type]) {
|
3477 | // Call the groupTypes function
|
3478 | var groupNode = groupTypes[group.type](group, options, prev);
|
3479 | var multiplier;
|
3480 |
|
3481 | // If the style changed between the parent and the current group,
|
3482 | // account for the size difference
|
3483 | if (options.style !== options.parentStyle) {
|
3484 | multiplier = options.style.sizeMultiplier /
|
3485 | options.parentStyle.sizeMultiplier;
|
3486 |
|
3487 | groupNode.height *= multiplier;
|
3488 | groupNode.depth *= multiplier;
|
3489 | }
|
3490 |
|
3491 | // If the size changed between the parent and the current group, account
|
3492 | // for that size difference.
|
3493 | if (options.size !== options.parentSize) {
|
3494 | multiplier = buildCommon.sizingMultiplier[options.size] /
|
3495 | buildCommon.sizingMultiplier[options.parentSize];
|
3496 |
|
3497 | groupNode.height *= multiplier;
|
3498 | groupNode.depth *= multiplier;
|
3499 | }
|
3500 |
|
3501 | return groupNode;
|
3502 | } else {
|
3503 | throw new ParseError(
|
3504 | "Got group of unknown type: '" + group.type + "'");
|
3505 | }
|
3506 | };
|
3507 |
|
3508 | /**
|
3509 | * Take an entire parse tree, and build it into an appropriate set of HTML
|
3510 | * nodes.
|
3511 | */
|
3512 | var buildHTML = function(tree, options) {
|
3513 | // buildExpression is destructive, so we need to make a clone
|
3514 | // of the incoming tree so that it isn't accidentally changed
|
3515 | tree = JSON.parse(JSON.stringify(tree));
|
3516 |
|
3517 | // Build the expression contained in the tree
|
3518 | var expression = buildExpression(tree, options);
|
3519 | var body = makeSpan(["base", options.style.cls()], expression);
|
3520 |
|
3521 | // Add struts, which ensure that the top of the HTML element falls at the
|
3522 | // height of the expression, and the bottom of the HTML element falls at the
|
3523 | // depth of the expression.
|
3524 | var topStrut = makeSpan(["strut"]);
|
3525 | var bottomStrut = makeSpan(["strut", "bottom"]);
|
3526 |
|
3527 | topStrut.style.height = body.height + "em";
|
3528 | bottomStrut.style.height = (body.height + body.depth) + "em";
|
3529 | // We'd like to use `vertical-align: top` but in IE 9 this lowers the
|
3530 | // baseline of the box to the bottom of this strut (instead staying in the
|
3531 | // normal place) so we use an absolute value for vertical-align instead
|
3532 | bottomStrut.style.verticalAlign = -body.depth + "em";
|
3533 |
|
3534 | // Wrap the struts and body together
|
3535 | var htmlNode = makeSpan(["katex-html"], [topStrut, bottomStrut, body]);
|
3536 |
|
3537 | htmlNode.setAttribute("aria-hidden", "true");
|
3538 |
|
3539 | return htmlNode;
|
3540 | };
|
3541 |
|
3542 | module.exports = buildHTML;
|
3543 |
|
3544 | },{"./ParseError":7,"./Style":10,"./buildCommon":11,"./delimiter":15,"./domTree":16,"./fontMetrics":18,"./utils":25}],13:[function(require,module,exports){
|
3545 | /**
|
3546 | * This file converts a parse tree into a cooresponding MathML tree. The main
|
3547 | * entry point is the `buildMathML` function, which takes a parse tree from the
|
3548 | * parser.
|
3549 | */
|
3550 |
|
3551 | var buildCommon = require("./buildCommon");
|
3552 | var fontMetrics = require("./fontMetrics");
|
3553 | var mathMLTree = require("./mathMLTree");
|
3554 | var ParseError = require("./ParseError");
|
3555 | var symbols = require("./symbols");
|
3556 | var utils = require("./utils");
|
3557 |
|
3558 | var makeSpan = buildCommon.makeSpan;
|
3559 | var fontMap = buildCommon.fontMap;
|
3560 |
|
3561 | /**
|
3562 | * Takes a symbol and converts it into a MathML text node after performing
|
3563 | * optional replacement from symbols.js.
|
3564 | */
|
3565 | var makeText = function(text, mode) {
|
3566 | if (symbols[mode][text] && symbols[mode][text].replace) {
|
3567 | text = symbols[mode][text].replace;
|
3568 | }
|
3569 |
|
3570 | return new mathMLTree.TextNode(text);
|
3571 | };
|
3572 |
|
3573 | /**
|
3574 | * Returns the math variant as a string or null if none is required.
|
3575 | */
|
3576 | var getVariant = function(group, options) {
|
3577 | var font = options.font;
|
3578 | if (!font) {
|
3579 | return null;
|
3580 | }
|
3581 |
|
3582 | var mode = group.mode;
|
3583 | if (font === "mathit") {
|
3584 | return "italic";
|
3585 | }
|
3586 |
|
3587 | var value = group.value;
|
3588 | if (utils.contains(["\\imath", "\\jmath"], value)) {
|
3589 | return null;
|
3590 | }
|
3591 |
|
3592 | if (symbols[mode][value] && symbols[mode][value].replace) {
|
3593 | value = symbols[mode][value].replace;
|
3594 | }
|
3595 |
|
3596 | var fontName = fontMap[font].fontName;
|
3597 | if (fontMetrics.getCharacterMetrics(value, fontName)) {
|
3598 | return fontMap[options.font].variant;
|
3599 | }
|
3600 |
|
3601 | return null;
|
3602 | };
|
3603 |
|
3604 | /**
|
3605 | * Functions for handling the different types of groups found in the parse
|
3606 | * tree. Each function should take a parse group and return a MathML node.
|
3607 | */
|
3608 | var groupTypes = {
|
3609 | mathord: function(group, options) {
|
3610 | var node = new mathMLTree.MathNode(
|
3611 | "mi",
|
3612 | [makeText(group.value, group.mode)]);
|
3613 |
|
3614 | var variant = getVariant(group, options);
|
3615 | if (variant) {
|
3616 | node.setAttribute("mathvariant", variant);
|
3617 | }
|
3618 | return node;
|
3619 | },
|
3620 |
|
3621 | textord: function(group, options) {
|
3622 | var text = makeText(group.value, group.mode);
|
3623 |
|
3624 | var variant = getVariant(group, options) || "normal";
|
3625 |
|
3626 | var node;
|
3627 | if (/[0-9]/.test(group.value)) {
|
3628 | // TODO(kevinb) merge adjacent <mn> nodes
|
3629 | // do it as a post processing step
|
3630 | node = new mathMLTree.MathNode("mn", [text]);
|
3631 | if (options.font) {
|
3632 | node.setAttribute("mathvariant", variant);
|
3633 | }
|
3634 | } else {
|
3635 | node = new mathMLTree.MathNode("mi", [text]);
|
3636 | node.setAttribute("mathvariant", variant);
|
3637 | }
|
3638 |
|
3639 | return node;
|
3640 | },
|
3641 |
|
3642 | bin: function(group) {
|
3643 | var node = new mathMLTree.MathNode(
|
3644 | "mo", [makeText(group.value, group.mode)]);
|
3645 |
|
3646 | return node;
|
3647 | },
|
3648 |
|
3649 | rel: function(group) {
|
3650 | var node = new mathMLTree.MathNode(
|
3651 | "mo", [makeText(group.value, group.mode)]);
|
3652 |
|
3653 | return node;
|
3654 | },
|
3655 |
|
3656 | open: function(group) {
|
3657 | var node = new mathMLTree.MathNode(
|
3658 | "mo", [makeText(group.value, group.mode)]);
|
3659 |
|
3660 | return node;
|
3661 | },
|
3662 |
|
3663 | close: function(group) {
|
3664 | var node = new mathMLTree.MathNode(
|
3665 | "mo", [makeText(group.value, group.mode)]);
|
3666 |
|
3667 | return node;
|
3668 | },
|
3669 |
|
3670 | inner: function(group) {
|
3671 | var node = new mathMLTree.MathNode(
|
3672 | "mo", [makeText(group.value, group.mode)]);
|
3673 |
|
3674 | return node;
|
3675 | },
|
3676 |
|
3677 | punct: function(group) {
|
3678 | var node = new mathMLTree.MathNode(
|
3679 | "mo", [makeText(group.value, group.mode)]);
|
3680 |
|
3681 | node.setAttribute("separator", "true");
|
3682 |
|
3683 | return node;
|
3684 | },
|
3685 |
|
3686 | ordgroup: function(group, options) {
|
3687 | var inner = buildExpression(group.value, options);
|
3688 |
|
3689 | var node = new mathMLTree.MathNode("mrow", inner);
|
3690 |
|
3691 | return node;
|
3692 | },
|
3693 |
|
3694 | text: function(group, options) {
|
3695 | var inner = buildExpression(group.value.body, options);
|
3696 |
|
3697 | var node = new mathMLTree.MathNode("mtext", inner);
|
3698 |
|
3699 | return node;
|
3700 | },
|
3701 |
|
3702 | color: function(group, options) {
|
3703 | var inner = buildExpression(group.value.value, options);
|
3704 |
|
3705 | var node = new mathMLTree.MathNode("mstyle", inner);
|
3706 |
|
3707 | node.setAttribute("mathcolor", group.value.color);
|
3708 |
|
3709 | return node;
|
3710 | },
|
3711 |
|
3712 | supsub: function(group, options) {
|
3713 | var children = [buildGroup(group.value.base, options)];
|
3714 |
|
3715 | if (group.value.sub) {
|
3716 | children.push(buildGroup(group.value.sub, options));
|
3717 | }
|
3718 |
|
3719 | if (group.value.sup) {
|
3720 | children.push(buildGroup(group.value.sup, options));
|
3721 | }
|
3722 |
|
3723 | var nodeType;
|
3724 | if (!group.value.sub) {
|
3725 | nodeType = "msup";
|
3726 | } else if (!group.value.sup) {
|
3727 | nodeType = "msub";
|
3728 | } else {
|
3729 | nodeType = "msubsup";
|
3730 | }
|
3731 |
|
3732 | var node = new mathMLTree.MathNode(nodeType, children);
|
3733 |
|
3734 | return node;
|
3735 | },
|
3736 |
|
3737 | genfrac: function(group, options) {
|
3738 | var node = new mathMLTree.MathNode(
|
3739 | "mfrac",
|
3740 | [buildGroup(group.value.numer, options),
|
3741 | buildGroup(group.value.denom, options)]);
|
3742 |
|
3743 | if (!group.value.hasBarLine) {
|
3744 | node.setAttribute("linethickness", "0px");
|
3745 | }
|
3746 |
|
3747 | if (group.value.leftDelim != null || group.value.rightDelim != null) {
|
3748 | var withDelims = [];
|
3749 |
|
3750 | if (group.value.leftDelim != null) {
|
3751 | var leftOp = new mathMLTree.MathNode(
|
3752 | "mo", [new mathMLTree.TextNode(group.value.leftDelim)]);
|
3753 |
|
3754 | leftOp.setAttribute("fence", "true");
|
3755 |
|
3756 | withDelims.push(leftOp);
|
3757 | }
|
3758 |
|
3759 | withDelims.push(node);
|
3760 |
|
3761 | if (group.value.rightDelim != null) {
|
3762 | var rightOp = new mathMLTree.MathNode(
|
3763 | "mo", [new mathMLTree.TextNode(group.value.rightDelim)]);
|
3764 |
|
3765 | rightOp.setAttribute("fence", "true");
|
3766 |
|
3767 | withDelims.push(rightOp);
|
3768 | }
|
3769 |
|
3770 | var outerNode = new mathMLTree.MathNode("mrow", withDelims);
|
3771 |
|
3772 | return outerNode;
|
3773 | }
|
3774 |
|
3775 | return node;
|
3776 | },
|
3777 |
|
3778 | array: function(group, options) {
|
3779 | return new mathMLTree.MathNode(
|
3780 | "mtable", group.value.body.map(function(row) {
|
3781 | return new mathMLTree.MathNode(
|
3782 | "mtr", row.map(function(cell) {
|
3783 | return new mathMLTree.MathNode(
|
3784 | "mtd", [buildGroup(cell, options)]);
|
3785 | }));
|
3786 | }));
|
3787 | },
|
3788 |
|
3789 | sqrt: function(group, options) {
|
3790 | var node;
|
3791 | if (group.value.index) {
|
3792 | node = new mathMLTree.MathNode(
|
3793 | "mroot", [
|
3794 | buildGroup(group.value.body, options),
|
3795 | buildGroup(group.value.index, options)
|
3796 | ]);
|
3797 | } else {
|
3798 | node = new mathMLTree.MathNode(
|
3799 | "msqrt", [buildGroup(group.value.body, options)]);
|
3800 | }
|
3801 |
|
3802 | return node;
|
3803 | },
|
3804 |
|
3805 | leftright: function(group, options) {
|
3806 | var inner = buildExpression(group.value.body, options);
|
3807 |
|
3808 | if (group.value.left !== ".") {
|
3809 | var leftNode = new mathMLTree.MathNode(
|
3810 | "mo", [makeText(group.value.left, group.mode)]);
|
3811 |
|
3812 | leftNode.setAttribute("fence", "true");
|
3813 |
|
3814 | inner.unshift(leftNode);
|
3815 | }
|
3816 |
|
3817 | if (group.value.right !== ".") {
|
3818 | var rightNode = new mathMLTree.MathNode(
|
3819 | "mo", [makeText(group.value.right, group.mode)]);
|
3820 |
|
3821 | rightNode.setAttribute("fence", "true");
|
3822 |
|
3823 | inner.push(rightNode);
|
3824 | }
|
3825 |
|
3826 | var outerNode = new mathMLTree.MathNode("mrow", inner);
|
3827 |
|
3828 | return outerNode;
|
3829 | },
|
3830 |
|
3831 | accent: function(group, options) {
|
3832 | var accentNode = new mathMLTree.MathNode(
|
3833 | "mo", [makeText(group.value.accent, group.mode)]);
|
3834 |
|
3835 | var node = new mathMLTree.MathNode(
|
3836 | "mover",
|
3837 | [buildGroup(group.value.base, options),
|
3838 | accentNode]);
|
3839 |
|
3840 | node.setAttribute("accent", "true");
|
3841 |
|
3842 | return node;
|
3843 | },
|
3844 |
|
3845 | spacing: function(group) {
|
3846 | var node;
|
3847 |
|
3848 | if (group.value === "\\ " || group.value === "\\space" ||
|
3849 | group.value === " " || group.value === "~") {
|
3850 | node = new mathMLTree.MathNode(
|
3851 | "mtext", [new mathMLTree.TextNode("\u00a0")]);
|
3852 | } else {
|
3853 | node = new mathMLTree.MathNode("mspace");
|
3854 |
|
3855 | node.setAttribute(
|
3856 | "width", buildCommon.spacingFunctions[group.value].size);
|
3857 | }
|
3858 |
|
3859 | return node;
|
3860 | },
|
3861 |
|
3862 | op: function(group) {
|
3863 | var node;
|
3864 |
|
3865 | // TODO(emily): handle big operators using the `largeop` attribute
|
3866 |
|
3867 | if (group.value.symbol) {
|
3868 | // This is a symbol. Just add the symbol.
|
3869 | node = new mathMLTree.MathNode(
|
3870 | "mo", [makeText(group.value.body, group.mode)]);
|
3871 | } else {
|
3872 | // This is a text operator. Add all of the characters from the
|
3873 | // operator's name.
|
3874 | // TODO(emily): Add a space in the middle of some of these
|
3875 | // operators, like \limsup.
|
3876 | node = new mathMLTree.MathNode(
|
3877 | "mi", [new mathMLTree.TextNode(group.value.body.slice(1))]);
|
3878 | }
|
3879 |
|
3880 | return node;
|
3881 | },
|
3882 |
|
3883 | katex: function(group) {
|
3884 | var node = new mathMLTree.MathNode(
|
3885 | "mtext", [new mathMLTree.TextNode("KaTeX")]);
|
3886 |
|
3887 | return node;
|
3888 | },
|
3889 |
|
3890 | font: function(group, options) {
|
3891 | var font = group.value.font;
|
3892 | return buildGroup(group.value.body, options.withFont(font));
|
3893 | },
|
3894 |
|
3895 | delimsizing: function(group) {
|
3896 | var children = [];
|
3897 |
|
3898 | if (group.value.value !== ".") {
|
3899 | children.push(makeText(group.value.value, group.mode));
|
3900 | }
|
3901 |
|
3902 | var node = new mathMLTree.MathNode("mo", children);
|
3903 |
|
3904 | if (group.value.delimType === "open" ||
|
3905 | group.value.delimType === "close") {
|
3906 | // Only some of the delimsizing functions act as fences, and they
|
3907 | // return "open" or "close" delimTypes.
|
3908 | node.setAttribute("fence", "true");
|
3909 | } else {
|
3910 | // Explicitly disable fencing if it's not a fence, to override the
|
3911 | // defaults.
|
3912 | node.setAttribute("fence", "false");
|
3913 | }
|
3914 |
|
3915 | return node;
|
3916 | },
|
3917 |
|
3918 | styling: function(group, options) {
|
3919 | var inner = buildExpression(group.value.value, options);
|
3920 |
|
3921 | var node = new mathMLTree.MathNode("mstyle", inner);
|
3922 |
|
3923 | var styleAttributes = {
|
3924 | "display": ["0", "true"],
|
3925 | "text": ["0", "false"],
|
3926 | "script": ["1", "false"],
|
3927 | "scriptscript": ["2", "false"]
|
3928 | };
|
3929 |
|
3930 | var attr = styleAttributes[group.value.style];
|
3931 |
|
3932 | node.setAttribute("scriptlevel", attr[0]);
|
3933 | node.setAttribute("displaystyle", attr[1]);
|
3934 |
|
3935 | return node;
|
3936 | },
|
3937 |
|
3938 | sizing: function(group, options) {
|
3939 | var inner = buildExpression(group.value.value, options);
|
3940 |
|
3941 | var node = new mathMLTree.MathNode("mstyle", inner);
|
3942 |
|
3943 | // TODO(emily): This doesn't produce the correct size for nested size
|
3944 | // changes, because we don't keep state of what style we're currently
|
3945 | // in, so we can't reset the size to normal before changing it. Now
|
3946 | // that we're passing an options parameter we should be able to fix
|
3947 | // this.
|
3948 | node.setAttribute(
|
3949 | "mathsize", buildCommon.sizingMultiplier[group.value.size] + "em");
|
3950 |
|
3951 | return node;
|
3952 | },
|
3953 |
|
3954 | overline: function(group, options) {
|
3955 | var operator = new mathMLTree.MathNode(
|
3956 | "mo", [new mathMLTree.TextNode("\u203e")]);
|
3957 | operator.setAttribute("stretchy", "true");
|
3958 |
|
3959 | var node = new mathMLTree.MathNode(
|
3960 | "mover",
|
3961 | [buildGroup(group.value.body, options),
|
3962 | operator]);
|
3963 | node.setAttribute("accent", "true");
|
3964 |
|
3965 | return node;
|
3966 | },
|
3967 |
|
3968 | rule: function(group) {
|
3969 | // TODO(emily): Figure out if there's an actual way to draw black boxes
|
3970 | // in MathML.
|
3971 | var node = new mathMLTree.MathNode("mrow");
|
3972 |
|
3973 | return node;
|
3974 | },
|
3975 |
|
3976 | llap: function(group, options) {
|
3977 | var node = new mathMLTree.MathNode(
|
3978 | "mpadded", [buildGroup(group.value.body, options)]);
|
3979 |
|
3980 | node.setAttribute("lspace", "-1width");
|
3981 | node.setAttribute("width", "0px");
|
3982 |
|
3983 | return node;
|
3984 | },
|
3985 |
|
3986 | rlap: function(group, options) {
|
3987 | var node = new mathMLTree.MathNode(
|
3988 | "mpadded", [buildGroup(group.value.body, options)]);
|
3989 |
|
3990 | node.setAttribute("width", "0px");
|
3991 |
|
3992 | return node;
|
3993 | },
|
3994 |
|
3995 | phantom: function(group, options, prev) {
|
3996 | var inner = buildExpression(group.value.value, options);
|
3997 | return new mathMLTree.MathNode("mphantom", inner);
|
3998 | }
|
3999 | };
|
4000 |
|
4001 | /**
|
4002 | * Takes a list of nodes, builds them, and returns a list of the generated
|
4003 | * MathML nodes. A little simpler than the HTML version because we don't do any
|
4004 | * previous-node handling.
|
4005 | */
|
4006 | var buildExpression = function(expression, options) {
|
4007 | var groups = [];
|
4008 | for (var i = 0; i < expression.length; i++) {
|
4009 | var group = expression[i];
|
4010 | groups.push(buildGroup(group, options));
|
4011 | }
|
4012 | return groups;
|
4013 | };
|
4014 |
|
4015 | /**
|
4016 | * Takes a group from the parser and calls the appropriate groupTypes function
|
4017 | * on it to produce a MathML node.
|
4018 | */
|
4019 | var buildGroup = function(group, options) {
|
4020 | if (!group) {
|
4021 | return new mathMLTree.MathNode("mrow");
|
4022 | }
|
4023 |
|
4024 | if (groupTypes[group.type]) {
|
4025 | // Call the groupTypes function
|
4026 | return groupTypes[group.type](group, options);
|
4027 | } else {
|
4028 | throw new ParseError(
|
4029 | "Got group of unknown type: '" + group.type + "'");
|
4030 | }
|
4031 | };
|
4032 |
|
4033 | /**
|
4034 | * Takes a full parse tree and settings and builds a MathML representation of
|
4035 | * it. In particular, we put the elements from building the parse tree into a
|
4036 | * <semantics> tag so we can also include that TeX source as an annotation.
|
4037 | *
|
4038 | * Note that we actually return a domTree element with a `<math>` inside it so
|
4039 | * we can do appropriate styling.
|
4040 | */
|
4041 | var buildMathML = function(tree, texExpression, options) {
|
4042 | var expression = buildExpression(tree, options);
|
4043 |
|
4044 | // Wrap up the expression in an mrow so it is presented in the semantics
|
4045 | // tag correctly.
|
4046 | var wrapper = new mathMLTree.MathNode("mrow", expression);
|
4047 |
|
4048 | // Build a TeX annotation of the source
|
4049 | var annotation = new mathMLTree.MathNode(
|
4050 | "annotation", [new mathMLTree.TextNode(texExpression)]);
|
4051 |
|
4052 | annotation.setAttribute("encoding", "application/x-tex");
|
4053 |
|
4054 | var semantics = new mathMLTree.MathNode(
|
4055 | "semantics", [wrapper, annotation]);
|
4056 |
|
4057 | var math = new mathMLTree.MathNode("math", [semantics]);
|
4058 |
|
4059 | // You can't style <math> nodes, so we wrap the node in a span.
|
4060 | return makeSpan(["katex-mathml"], [math]);
|
4061 | };
|
4062 |
|
4063 | module.exports = buildMathML;
|
4064 |
|
4065 | },{"./ParseError":7,"./buildCommon":11,"./fontMetrics":18,"./mathMLTree":21,"./symbols":24,"./utils":25}],14:[function(require,module,exports){
|
4066 | var buildHTML = require("./buildHTML");
|
4067 | var buildMathML = require("./buildMathML");
|
4068 | var buildCommon = require("./buildCommon");
|
4069 | var Options = require("./Options");
|
4070 | var Settings = require("./Settings");
|
4071 | var Style = require("./Style");
|
4072 |
|
4073 | var makeSpan = buildCommon.makeSpan;
|
4074 |
|
4075 | var buildTree = function(tree, expression, settings) {
|
4076 | settings = settings || new Settings({});
|
4077 |
|
4078 | var startStyle = Style.TEXT;
|
4079 | if (settings.displayMode) {
|
4080 | startStyle = Style.DISPLAY;
|
4081 | }
|
4082 |
|
4083 | // Setup the default options
|
4084 | var options = new Options({
|
4085 | style: startStyle,
|
4086 | size: "size5"
|
4087 | });
|
4088 |
|
4089 | // `buildHTML` sometimes messes with the parse tree (like turning bins ->
|
4090 | // ords), so we build the MathML version first.
|
4091 | var mathMLNode = buildMathML(tree, expression, options);
|
4092 | var htmlNode = buildHTML(tree, options);
|
4093 |
|
4094 | var katexNode = makeSpan(["katex"], [
|
4095 | mathMLNode, htmlNode
|
4096 | ]);
|
4097 |
|
4098 | if (settings.displayMode) {
|
4099 | return makeSpan(["katex-display"], [katexNode]);
|
4100 | } else {
|
4101 | return katexNode;
|
4102 | }
|
4103 | };
|
4104 |
|
4105 | module.exports = buildTree;
|
4106 |
|
4107 | },{"./Options":6,"./Settings":9,"./Style":10,"./buildCommon":11,"./buildHTML":12,"./buildMathML":13}],15:[function(require,module,exports){
|
4108 | /**
|
4109 | * This file deals with creating delimiters of various sizes. The TeXbook
|
4110 | * discusses these routines on page 441-442, in the "Another subroutine sets box
|
4111 | * x to a specified variable delimiter" paragraph.
|
4112 | *
|
4113 | * There are three main routines here. `makeSmallDelim` makes a delimiter in the
|
4114 | * normal font, but in either text, script, or scriptscript style.
|
4115 | * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1,
|
4116 | * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of
|
4117 | * smaller pieces that are stacked on top of one another.
|
4118 | *
|
4119 | * The functions take a parameter `center`, which determines if the delimiter
|
4120 | * should be centered around the axis.
|
4121 | *
|
4122 | * Then, there are three exposed functions. `sizedDelim` makes a delimiter in
|
4123 | * one of the given sizes. This is used for things like `\bigl`.
|
4124 | * `customSizedDelim` makes a delimiter with a given total height+depth. It is
|
4125 | * called in places like `\sqrt`. `leftRightDelim` makes an appropriate
|
4126 | * delimiter which surrounds an expression of a given height an depth. It is
|
4127 | * used in `\left` and `\right`.
|
4128 | */
|
4129 |
|
4130 | var ParseError = require("./ParseError");
|
4131 | var Style = require("./Style");
|
4132 |
|
4133 | var buildCommon = require("./buildCommon");
|
4134 | var fontMetrics = require("./fontMetrics");
|
4135 | var symbols = require("./symbols");
|
4136 | var utils = require("./utils");
|
4137 |
|
4138 | var makeSpan = buildCommon.makeSpan;
|
4139 |
|
4140 | /**
|
4141 | * Get the metrics for a given symbol and font, after transformation (i.e.
|
4142 | * after following replacement from symbols.js)
|
4143 | */
|
4144 | var getMetrics = function(symbol, font) {
|
4145 | if (symbols.math[symbol] && symbols.math[symbol].replace) {
|
4146 | return fontMetrics.getCharacterMetrics(
|
4147 | symbols.math[symbol].replace, font);
|
4148 | } else {
|
4149 | return fontMetrics.getCharacterMetrics(
|
4150 | symbol, font);
|
4151 | }
|
4152 | };
|
4153 |
|
4154 | /**
|
4155 | * Builds a symbol in the given font size (note size is an integer)
|
4156 | */
|
4157 | var mathrmSize = function(value, size, mode) {
|
4158 | return buildCommon.makeSymbol(value, "Size" + size + "-Regular", mode);
|
4159 | };
|
4160 |
|
4161 | /**
|
4162 | * Puts a delimiter span in a given style, and adds appropriate height, depth,
|
4163 | * and maxFontSizes.
|
4164 | */
|
4165 | var styleWrap = function(delim, toStyle, options) {
|
4166 | var span = makeSpan(
|
4167 | ["style-wrap", options.style.reset(), toStyle.cls()], [delim]);
|
4168 |
|
4169 | var multiplier = toStyle.sizeMultiplier / options.style.sizeMultiplier;
|
4170 |
|
4171 | span.height *= multiplier;
|
4172 | span.depth *= multiplier;
|
4173 | span.maxFontSize = toStyle.sizeMultiplier;
|
4174 |
|
4175 | return span;
|
4176 | };
|
4177 |
|
4178 | /**
|
4179 | * Makes a small delimiter. This is a delimiter that comes in the Main-Regular
|
4180 | * font, but is restyled to either be in textstyle, scriptstyle, or
|
4181 | * scriptscriptstyle.
|
4182 | */
|
4183 | var makeSmallDelim = function(delim, style, center, options, mode) {
|
4184 | var text = buildCommon.makeSymbol(delim, "Main-Regular", mode);
|
4185 |
|
4186 | var span = styleWrap(text, style, options);
|
4187 |
|
4188 | if (center) {
|
4189 | var shift =
|
4190 | (1 - options.style.sizeMultiplier / style.sizeMultiplier) *
|
4191 | fontMetrics.metrics.axisHeight;
|
4192 |
|
4193 | span.style.top = shift + "em";
|
4194 | span.height -= shift;
|
4195 | span.depth += shift;
|
4196 | }
|
4197 |
|
4198 | return span;
|
4199 | };
|
4200 |
|
4201 | /**
|
4202 | * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2,
|
4203 | * Size3, or Size4 fonts. It is always rendered in textstyle.
|
4204 | */
|
4205 | var makeLargeDelim = function(delim, size, center, options, mode) {
|
4206 | var inner = mathrmSize(delim, size, mode);
|
4207 |
|
4208 | var span = styleWrap(
|
4209 | makeSpan(["delimsizing", "size" + size],
|
4210 | [inner], options.getColor()),
|
4211 | Style.TEXT, options);
|
4212 |
|
4213 | if (center) {
|
4214 | var shift = (1 - options.style.sizeMultiplier) *
|
4215 | fontMetrics.metrics.axisHeight;
|
4216 |
|
4217 | span.style.top = shift + "em";
|
4218 | span.height -= shift;
|
4219 | span.depth += shift;
|
4220 | }
|
4221 |
|
4222 | return span;
|
4223 | };
|
4224 |
|
4225 | /**
|
4226 | * Make an inner span with the given offset and in the given font. This is used
|
4227 | * in `makeStackedDelim` to make the stacking pieces for the delimiter.
|
4228 | */
|
4229 | var makeInner = function(symbol, font, mode) {
|
4230 | var sizeClass;
|
4231 | // Apply the correct CSS class to choose the right font.
|
4232 | if (font === "Size1-Regular") {
|
4233 | sizeClass = "delim-size1";
|
4234 | } else if (font === "Size4-Regular") {
|
4235 | sizeClass = "delim-size4";
|
4236 | }
|
4237 |
|
4238 | var inner = makeSpan(
|
4239 | ["delimsizinginner", sizeClass],
|
4240 | [makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]);
|
4241 |
|
4242 | // Since this will be passed into `makeVList` in the end, wrap the element
|
4243 | // in the appropriate tag that VList uses.
|
4244 | return {type: "elem", elem: inner};
|
4245 | };
|
4246 |
|
4247 | /**
|
4248 | * Make a stacked delimiter out of a given delimiter, with the total height at
|
4249 | * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook.
|
4250 | */
|
4251 | var makeStackedDelim = function(delim, heightTotal, center, options, mode) {
|
4252 | // There are four parts, the top, an optional middle, a repeated part, and a
|
4253 | // bottom.
|
4254 | var top, middle, repeat, bottom;
|
4255 | top = repeat = bottom = delim;
|
4256 | middle = null;
|
4257 | // Also keep track of what font the delimiters are in
|
4258 | var font = "Size1-Regular";
|
4259 |
|
4260 | // We set the parts and font based on the symbol. Note that we use
|
4261 | // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the
|
4262 | // repeats of the arrows
|
4263 | if (delim === "\\uparrow") {
|
4264 | repeat = bottom = "\u23d0";
|
4265 | } else if (delim === "\\Uparrow") {
|
4266 | repeat = bottom = "\u2016";
|
4267 | } else if (delim === "\\downarrow") {
|
4268 | top = repeat = "\u23d0";
|
4269 | } else if (delim === "\\Downarrow") {
|
4270 | top = repeat = "\u2016";
|
4271 | } else if (delim === "\\updownarrow") {
|
4272 | top = "\\uparrow";
|
4273 | repeat = "\u23d0";
|
4274 | bottom = "\\downarrow";
|
4275 | } else if (delim === "\\Updownarrow") {
|
4276 | top = "\\Uparrow";
|
4277 | repeat = "\u2016";
|
4278 | bottom = "\\Downarrow";
|
4279 | } else if (delim === "[" || delim === "\\lbrack") {
|
4280 | top = "\u23a1";
|
4281 | repeat = "\u23a2";
|
4282 | bottom = "\u23a3";
|
4283 | font = "Size4-Regular";
|
4284 | } else if (delim === "]" || delim === "\\rbrack") {
|
4285 | top = "\u23a4";
|
4286 | repeat = "\u23a5";
|
4287 | bottom = "\u23a6";
|
4288 | font = "Size4-Regular";
|
4289 | } else if (delim === "\\lfloor") {
|
4290 | repeat = top = "\u23a2";
|
4291 | bottom = "\u23a3";
|
4292 | font = "Size4-Regular";
|
4293 | } else if (delim === "\\lceil") {
|
4294 | top = "\u23a1";
|
4295 | repeat = bottom = "\u23a2";
|
4296 | font = "Size4-Regular";
|
4297 | } else if (delim === "\\rfloor") {
|
4298 | repeat = top = "\u23a5";
|
4299 | bottom = "\u23a6";
|
4300 | font = "Size4-Regular";
|
4301 | } else if (delim === "\\rceil") {
|
4302 | top = "\u23a4";
|
4303 | repeat = bottom = "\u23a5";
|
4304 | font = "Size4-Regular";
|
4305 | } else if (delim === "(") {
|
4306 | top = "\u239b";
|
4307 | repeat = "\u239c";
|
4308 | bottom = "\u239d";
|
4309 | font = "Size4-Regular";
|
4310 | } else if (delim === ")") {
|
4311 | top = "\u239e";
|
4312 | repeat = "\u239f";
|
4313 | bottom = "\u23a0";
|
4314 | font = "Size4-Regular";
|
4315 | } else if (delim === "\\{" || delim === "\\lbrace") {
|
4316 | top = "\u23a7";
|
4317 | middle = "\u23a8";
|
4318 | bottom = "\u23a9";
|
4319 | repeat = "\u23aa";
|
4320 | font = "Size4-Regular";
|
4321 | } else if (delim === "\\}" || delim === "\\rbrace") {
|
4322 | top = "\u23ab";
|
4323 | middle = "\u23ac";
|
4324 | bottom = "\u23ad";
|
4325 | repeat = "\u23aa";
|
4326 | font = "Size4-Regular";
|
4327 | } else if (delim === "\\lgroup") {
|
4328 | top = "\u23a7";
|
4329 | bottom = "\u23a9";
|
4330 | repeat = "\u23aa";
|
4331 | font = "Size4-Regular";
|
4332 | } else if (delim === "\\rgroup") {
|
4333 | top = "\u23ab";
|
4334 | bottom = "\u23ad";
|
4335 | repeat = "\u23aa";
|
4336 | font = "Size4-Regular";
|
4337 | } else if (delim === "\\lmoustache") {
|
4338 | top = "\u23a7";
|
4339 | bottom = "\u23ad";
|
4340 | repeat = "\u23aa";
|
4341 | font = "Size4-Regular";
|
4342 | } else if (delim === "\\rmoustache") {
|
4343 | top = "\u23ab";
|
4344 | bottom = "\u23a9";
|
4345 | repeat = "\u23aa";
|
4346 | font = "Size4-Regular";
|
4347 | } else if (delim === "\\surd") {
|
4348 | top = "\ue001";
|
4349 | bottom = "\u23b7";
|
4350 | repeat = "\ue000";
|
4351 | font = "Size4-Regular";
|
4352 | }
|
4353 |
|
4354 | // Get the metrics of the four sections
|
4355 | var topMetrics = getMetrics(top, font);
|
4356 | var topHeightTotal = topMetrics.height + topMetrics.depth;
|
4357 | var repeatMetrics = getMetrics(repeat, font);
|
4358 | var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth;
|
4359 | var bottomMetrics = getMetrics(bottom, font);
|
4360 | var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth;
|
4361 | var middleHeightTotal = 0;
|
4362 | var middleFactor = 1;
|
4363 | if (middle !== null) {
|
4364 | var middleMetrics = getMetrics(middle, font);
|
4365 | middleHeightTotal = middleMetrics.height + middleMetrics.depth;
|
4366 | middleFactor = 2; // repeat symmetrically above and below middle
|
4367 | }
|
4368 |
|
4369 | // Calcuate the minimal height that the delimiter can have.
|
4370 | // It is at least the size of the top, bottom, and optional middle combined.
|
4371 | var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;
|
4372 |
|
4373 | // Compute the number of copies of the repeat symbol we will need
|
4374 | var repeatCount = Math.ceil(
|
4375 | (heightTotal - minHeight) / (middleFactor * repeatHeightTotal));
|
4376 |
|
4377 | // Compute the total height of the delimiter including all the symbols
|
4378 | var realHeightTotal =
|
4379 | minHeight + repeatCount * middleFactor * repeatHeightTotal;
|
4380 |
|
4381 | // The center of the delimiter is placed at the center of the axis. Note
|
4382 | // that in this context, "center" means that the delimiter should be
|
4383 | // centered around the axis in the current style, while normally it is
|
4384 | // centered around the axis in textstyle.
|
4385 | var axisHeight = fontMetrics.metrics.axisHeight;
|
4386 | if (center) {
|
4387 | axisHeight *= options.style.sizeMultiplier;
|
4388 | }
|
4389 | // Calculate the depth
|
4390 | var depth = realHeightTotal / 2 - axisHeight;
|
4391 |
|
4392 | // Now, we start building the pieces that will go into the vlist
|
4393 |
|
4394 | // Keep a list of the inner pieces
|
4395 | var inners = [];
|
4396 |
|
4397 | // Add the bottom symbol
|
4398 | inners.push(makeInner(bottom, font, mode));
|
4399 |
|
4400 | var i;
|
4401 | if (middle === null) {
|
4402 | // Add that many symbols
|
4403 | for (i = 0; i < repeatCount; i++) {
|
4404 | inners.push(makeInner(repeat, font, mode));
|
4405 | }
|
4406 | } else {
|
4407 | // When there is a middle bit, we need the middle part and two repeated
|
4408 | // sections
|
4409 | for (i = 0; i < repeatCount; i++) {
|
4410 | inners.push(makeInner(repeat, font, mode));
|
4411 | }
|
4412 | inners.push(makeInner(middle, font, mode));
|
4413 | for (i = 0; i < repeatCount; i++) {
|
4414 | inners.push(makeInner(repeat, font, mode));
|
4415 | }
|
4416 | }
|
4417 |
|
4418 | // Add the top symbol
|
4419 | inners.push(makeInner(top, font, mode));
|
4420 |
|
4421 | // Finally, build the vlist
|
4422 | var inner = buildCommon.makeVList(inners, "bottom", depth, options);
|
4423 |
|
4424 | return styleWrap(
|
4425 | makeSpan(["delimsizing", "mult"], [inner], options.getColor()),
|
4426 | Style.TEXT, options);
|
4427 | };
|
4428 |
|
4429 | // There are three kinds of delimiters, delimiters that stack when they become
|
4430 | // too large
|
4431 | var stackLargeDelimiters = [
|
4432 | "(", ")", "[", "\\lbrack", "]", "\\rbrack",
|
4433 | "\\{", "\\lbrace", "\\}", "\\rbrace",
|
4434 | "\\lfloor", "\\rfloor", "\\lceil", "\\rceil",
|
4435 | "\\surd"
|
4436 | ];
|
4437 |
|
4438 | // delimiters that always stack
|
4439 | var stackAlwaysDelimiters = [
|
4440 | "\\uparrow", "\\downarrow", "\\updownarrow",
|
4441 | "\\Uparrow", "\\Downarrow", "\\Updownarrow",
|
4442 | "|", "\\|", "\\vert", "\\Vert",
|
4443 | "\\lvert", "\\rvert", "\\lVert", "\\rVert",
|
4444 | "\\lgroup", "\\rgroup", "\\lmoustache", "\\rmoustache"
|
4445 | ];
|
4446 |
|
4447 | // and delimiters that never stack
|
4448 | var stackNeverDelimiters = [
|
4449 | "<", ">", "\\langle", "\\rangle", "/", "\\backslash"
|
4450 | ];
|
4451 |
|
4452 | // Metrics of the different sizes. Found by looking at TeX's output of
|
4453 | // $\bigl| // \Bigl| \biggl| \Biggl| \showlists$
|
4454 | // Used to create stacked delimiters of appropriate sizes in makeSizedDelim.
|
4455 | var sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];
|
4456 |
|
4457 | /**
|
4458 | * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4.
|
4459 | */
|
4460 | var makeSizedDelim = function(delim, size, options, mode) {
|
4461 | // < and > turn into \langle and \rangle in delimiters
|
4462 | if (delim === "<") {
|
4463 | delim = "\\langle";
|
4464 | } else if (delim === ">") {
|
4465 | delim = "\\rangle";
|
4466 | }
|
4467 |
|
4468 | // Sized delimiters are never centered.
|
4469 | if (utils.contains(stackLargeDelimiters, delim) ||
|
4470 | utils.contains(stackNeverDelimiters, delim)) {
|
4471 | return makeLargeDelim(delim, size, false, options, mode);
|
4472 | } else if (utils.contains(stackAlwaysDelimiters, delim)) {
|
4473 | return makeStackedDelim(
|
4474 | delim, sizeToMaxHeight[size], false, options, mode);
|
4475 | } else {
|
4476 | throw new ParseError("Illegal delimiter: '" + delim + "'");
|
4477 | }
|
4478 | };
|
4479 |
|
4480 | /**
|
4481 | * There are three different sequences of delimiter sizes that the delimiters
|
4482 | * follow depending on the kind of delimiter. This is used when creating custom
|
4483 | * sized delimiters to decide whether to create a small, large, or stacked
|
4484 | * delimiter.
|
4485 | *
|
4486 | * In real TeX, these sequences aren't explicitly defined, but are instead
|
4487 | * defined inside the font metrics. Since there are only three sequences that
|
4488 | * are possible for the delimiters that TeX defines, it is easier to just encode
|
4489 | * them explicitly here.
|
4490 | */
|
4491 |
|
4492 | // Delimiters that never stack try small delimiters and large delimiters only
|
4493 | var stackNeverDelimiterSequence = [
|
4494 | {type: "small", style: Style.SCRIPTSCRIPT},
|
4495 | {type: "small", style: Style.SCRIPT},
|
4496 | {type: "small", style: Style.TEXT},
|
4497 | {type: "large", size: 1},
|
4498 | {type: "large", size: 2},
|
4499 | {type: "large", size: 3},
|
4500 | {type: "large", size: 4}
|
4501 | ];
|
4502 |
|
4503 | // Delimiters that always stack try the small delimiters first, then stack
|
4504 | var stackAlwaysDelimiterSequence = [
|
4505 | {type: "small", style: Style.SCRIPTSCRIPT},
|
4506 | {type: "small", style: Style.SCRIPT},
|
4507 | {type: "small", style: Style.TEXT},
|
4508 | {type: "stack"}
|
4509 | ];
|
4510 |
|
4511 | // Delimiters that stack when large try the small and then large delimiters, and
|
4512 | // stack afterwards
|
4513 | var stackLargeDelimiterSequence = [
|
4514 | {type: "small", style: Style.SCRIPTSCRIPT},
|
4515 | {type: "small", style: Style.SCRIPT},
|
4516 | {type: "small", style: Style.TEXT},
|
4517 | {type: "large", size: 1},
|
4518 | {type: "large", size: 2},
|
4519 | {type: "large", size: 3},
|
4520 | {type: "large", size: 4},
|
4521 | {type: "stack"}
|
4522 | ];
|
4523 |
|
4524 | /**
|
4525 | * Get the font used in a delimiter based on what kind of delimiter it is.
|
4526 | */
|
4527 | var delimTypeToFont = function(type) {
|
4528 | if (type.type === "small") {
|
4529 | return "Main-Regular";
|
4530 | } else if (type.type === "large") {
|
4531 | return "Size" + type.size + "-Regular";
|
4532 | } else if (type.type === "stack") {
|
4533 | return "Size4-Regular";
|
4534 | }
|
4535 | };
|
4536 |
|
4537 | /**
|
4538 | * Traverse a sequence of types of delimiters to decide what kind of delimiter
|
4539 | * should be used to create a delimiter of the given height+depth.
|
4540 | */
|
4541 | var traverseSequence = function(delim, height, sequence, options) {
|
4542 | // Here, we choose the index we should start at in the sequences. In smaller
|
4543 | // sizes (which correspond to larger numbers in style.size) we start earlier
|
4544 | // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts
|
4545 | // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2
|
4546 | var start = Math.min(2, 3 - options.style.size);
|
4547 | for (var i = start; i < sequence.length; i++) {
|
4548 | if (sequence[i].type === "stack") {
|
4549 | // This is always the last delimiter, so we just break the loop now.
|
4550 | break;
|
4551 | }
|
4552 |
|
4553 | var metrics = getMetrics(delim, delimTypeToFont(sequence[i]));
|
4554 | var heightDepth = metrics.height + metrics.depth;
|
4555 |
|
4556 | // Small delimiters are scaled down versions of the same font, so we
|
4557 | // account for the style change size.
|
4558 |
|
4559 | if (sequence[i].type === "small") {
|
4560 | heightDepth *= sequence[i].style.sizeMultiplier;
|
4561 | }
|
4562 |
|
4563 | // Check if the delimiter at this size works for the given height.
|
4564 | if (heightDepth > height) {
|
4565 | return sequence[i];
|
4566 | }
|
4567 | }
|
4568 |
|
4569 | // If we reached the end of the sequence, return the last sequence element.
|
4570 | return sequence[sequence.length - 1];
|
4571 | };
|
4572 |
|
4573 | /**
|
4574 | * Make a delimiter of a given height+depth, with optional centering. Here, we
|
4575 | * traverse the sequences, and create a delimiter that the sequence tells us to.
|
4576 | */
|
4577 | var makeCustomSizedDelim = function(delim, height, center, options, mode) {
|
4578 | if (delim === "<") {
|
4579 | delim = "\\langle";
|
4580 | } else if (delim === ">") {
|
4581 | delim = "\\rangle";
|
4582 | }
|
4583 |
|
4584 | // Decide what sequence to use
|
4585 | var sequence;
|
4586 | if (utils.contains(stackNeverDelimiters, delim)) {
|
4587 | sequence = stackNeverDelimiterSequence;
|
4588 | } else if (utils.contains(stackLargeDelimiters, delim)) {
|
4589 | sequence = stackLargeDelimiterSequence;
|
4590 | } else {
|
4591 | sequence = stackAlwaysDelimiterSequence;
|
4592 | }
|
4593 |
|
4594 | // Look through the sequence
|
4595 | var delimType = traverseSequence(delim, height, sequence, options);
|
4596 |
|
4597 | // Depending on the sequence element we decided on, call the appropriate
|
4598 | // function.
|
4599 | if (delimType.type === "small") {
|
4600 | return makeSmallDelim(delim, delimType.style, center, options, mode);
|
4601 | } else if (delimType.type === "large") {
|
4602 | return makeLargeDelim(delim, delimType.size, center, options, mode);
|
4603 | } else if (delimType.type === "stack") {
|
4604 | return makeStackedDelim(delim, height, center, options, mode);
|
4605 | }
|
4606 | };
|
4607 |
|
4608 | /**
|
4609 | * Make a delimiter for use with `\left` and `\right`, given a height and depth
|
4610 | * of an expression that the delimiters surround.
|
4611 | */
|
4612 | var makeLeftRightDelim = function(delim, height, depth, options, mode) {
|
4613 | // We always center \left/\right delimiters, so the axis is always shifted
|
4614 | var axisHeight =
|
4615 | fontMetrics.metrics.axisHeight * options.style.sizeMultiplier;
|
4616 |
|
4617 | // Taken from TeX source, tex.web, function make_left_right
|
4618 | var delimiterFactor = 901;
|
4619 | var delimiterExtend = 5.0 / fontMetrics.metrics.ptPerEm;
|
4620 |
|
4621 | var maxDistFromAxis = Math.max(
|
4622 | height - axisHeight, depth + axisHeight);
|
4623 |
|
4624 | var totalHeight = Math.max(
|
4625 | // In real TeX, calculations are done using integral values which are
|
4626 | // 65536 per pt, or 655360 per em. So, the division here truncates in
|
4627 | // TeX but doesn't here, producing different results. If we wanted to
|
4628 | // exactly match TeX's calculation, we could do
|
4629 | // Math.floor(655360 * maxDistFromAxis / 500) *
|
4630 | // delimiterFactor / 655360
|
4631 | // (To see the difference, compare
|
4632 | // x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
|
4633 | // in TeX and KaTeX)
|
4634 | maxDistFromAxis / 500 * delimiterFactor,
|
4635 | 2 * maxDistFromAxis - delimiterExtend);
|
4636 |
|
4637 | // Finally, we defer to `makeCustomSizedDelim` with our calculated total
|
4638 | // height
|
4639 | return makeCustomSizedDelim(delim, totalHeight, true, options, mode);
|
4640 | };
|
4641 |
|
4642 | module.exports = {
|
4643 | sizedDelim: makeSizedDelim,
|
4644 | customSizedDelim: makeCustomSizedDelim,
|
4645 | leftRightDelim: makeLeftRightDelim
|
4646 | };
|
4647 |
|
4648 | },{"./ParseError":7,"./Style":10,"./buildCommon":11,"./fontMetrics":18,"./symbols":24,"./utils":25}],16:[function(require,module,exports){
|
4649 | /**
|
4650 | * These objects store the data about the DOM nodes we create, as well as some
|
4651 | * extra data. They can then be transformed into real DOM nodes with the
|
4652 | * `toNode` function or HTML markup using `toMarkup`. They are useful for both
|
4653 | * storing extra properties on the nodes, as well as providing a way to easily
|
4654 | * work with the DOM.
|
4655 | *
|
4656 | * Similar functions for working with MathML nodes exist in mathMLTree.js.
|
4657 | */
|
4658 |
|
4659 | var utils = require("./utils");
|
4660 |
|
4661 | /**
|
4662 | * Create an HTML className based on a list of classes. In addition to joining
|
4663 | * with spaces, we also remove null or empty classes.
|
4664 | */
|
4665 | var createClass = function(classes) {
|
4666 | classes = classes.slice();
|
4667 | for (var i = classes.length - 1; i >= 0; i--) {
|
4668 | if (!classes[i]) {
|
4669 | classes.splice(i, 1);
|
4670 | }
|
4671 | }
|
4672 |
|
4673 | return classes.join(" ");
|
4674 | };
|
4675 |
|
4676 | /**
|
4677 | * This node represents a span node, with a className, a list of children, and
|
4678 | * an inline style. It also contains information about its height, depth, and
|
4679 | * maxFontSize.
|
4680 | */
|
4681 | function span(classes, children, height, depth, maxFontSize, style) {
|
4682 | this.classes = classes || [];
|
4683 | this.children = children || [];
|
4684 | this.height = height || 0;
|
4685 | this.depth = depth || 0;
|
4686 | this.maxFontSize = maxFontSize || 0;
|
4687 | this.style = style || {};
|
4688 | this.attributes = {};
|
4689 | }
|
4690 |
|
4691 | /**
|
4692 | * Sets an arbitrary attribute on the span. Warning: use this wisely. Not all
|
4693 | * browsers support attributes the same, and having too many custom attributes
|
4694 | * is probably bad.
|
4695 | */
|
4696 | span.prototype.setAttribute = function(attribute, value) {
|
4697 | this.attributes[attribute] = value;
|
4698 | };
|
4699 |
|
4700 | /**
|
4701 | * Convert the span into an HTML node
|
4702 | */
|
4703 | span.prototype.toNode = function() {
|
4704 | var span = document.createElement("span");
|
4705 |
|
4706 | // Apply the class
|
4707 | span.className = createClass(this.classes);
|
4708 |
|
4709 | // Apply inline styles
|
4710 | for (var style in this.style) {
|
4711 | if (Object.prototype.hasOwnProperty.call(this.style, style)) {
|
4712 | span.style[style] = this.style[style];
|
4713 | }
|
4714 | }
|
4715 |
|
4716 | // Apply attributes
|
4717 | for (var attr in this.attributes) {
|
4718 | if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
|
4719 | span.setAttribute(attr, this.attributes[attr]);
|
4720 | }
|
4721 | }
|
4722 |
|
4723 | // Append the children, also as HTML nodes
|
4724 | for (var i = 0; i < this.children.length; i++) {
|
4725 | span.appendChild(this.children[i].toNode());
|
4726 | }
|
4727 |
|
4728 | return span;
|
4729 | };
|
4730 |
|
4731 | /**
|
4732 | * Convert the span into an HTML markup string
|
4733 | */
|
4734 | span.prototype.toMarkup = function() {
|
4735 | var markup = "<span";
|
4736 |
|
4737 | // Add the class
|
4738 | if (this.classes.length) {
|
4739 | markup += " class=\"";
|
4740 | markup += utils.escape(createClass(this.classes));
|
4741 | markup += "\"";
|
4742 | }
|
4743 |
|
4744 | var styles = "";
|
4745 |
|
4746 | // Add the styles, after hyphenation
|
4747 | for (var style in this.style) {
|
4748 | if (this.style.hasOwnProperty(style)) {
|
4749 | styles += utils.hyphenate(style) + ":" + this.style[style] + ";";
|
4750 | }
|
4751 | }
|
4752 |
|
4753 | if (styles) {
|
4754 | markup += " style=\"" + utils.escape(styles) + "\"";
|
4755 | }
|
4756 |
|
4757 | // Add the attributes
|
4758 | for (var attr in this.attributes) {
|
4759 | if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
|
4760 | markup += " " + attr + "=\"";
|
4761 | markup += utils.escape(this.attributes[attr]);
|
4762 | markup += "\"";
|
4763 | }
|
4764 | }
|
4765 |
|
4766 | markup += ">";
|
4767 |
|
4768 | // Add the markup of the children, also as markup
|
4769 | for (var i = 0; i < this.children.length; i++) {
|
4770 | markup += this.children[i].toMarkup();
|
4771 | }
|
4772 |
|
4773 | markup += "</span>";
|
4774 |
|
4775 | return markup;
|
4776 | };
|
4777 |
|
4778 | /**
|
4779 | * This node represents a document fragment, which contains elements, but when
|
4780 | * placed into the DOM doesn't have any representation itself. Thus, it only
|
4781 | * contains children and doesn't have any HTML properties. It also keeps track
|
4782 | * of a height, depth, and maxFontSize.
|
4783 | */
|
4784 | function documentFragment(children, height, depth, maxFontSize) {
|
4785 | this.children = children || [];
|
4786 | this.height = height || 0;
|
4787 | this.depth = depth || 0;
|
4788 | this.maxFontSize = maxFontSize || 0;
|
4789 | }
|
4790 |
|
4791 | /**
|
4792 | * Convert the fragment into a node
|
4793 | */
|
4794 | documentFragment.prototype.toNode = function() {
|
4795 | // Create a fragment
|
4796 | var frag = document.createDocumentFragment();
|
4797 |
|
4798 | // Append the children
|
4799 | for (var i = 0; i < this.children.length; i++) {
|
4800 | frag.appendChild(this.children[i].toNode());
|
4801 | }
|
4802 |
|
4803 | return frag;
|
4804 | };
|
4805 |
|
4806 | /**
|
4807 | * Convert the fragment into HTML markup
|
4808 | */
|
4809 | documentFragment.prototype.toMarkup = function() {
|
4810 | var markup = "";
|
4811 |
|
4812 | // Simply concatenate the markup for the children together
|
4813 | for (var i = 0; i < this.children.length; i++) {
|
4814 | markup += this.children[i].toMarkup();
|
4815 | }
|
4816 |
|
4817 | return markup;
|
4818 | };
|
4819 |
|
4820 | /**
|
4821 | * A symbol node contains information about a single symbol. It either renders
|
4822 | * to a single text node, or a span with a single text node in it, depending on
|
4823 | * whether it has CSS classes, styles, or needs italic correction.
|
4824 | */
|
4825 | function symbolNode(value, height, depth, italic, skew, classes, style) {
|
4826 | this.value = value || "";
|
4827 | this.height = height || 0;
|
4828 | this.depth = depth || 0;
|
4829 | this.italic = italic || 0;
|
4830 | this.skew = skew || 0;
|
4831 | this.classes = classes || [];
|
4832 | this.style = style || {};
|
4833 | this.maxFontSize = 0;
|
4834 | }
|
4835 |
|
4836 | /**
|
4837 | * Creates a text node or span from a symbol node. Note that a span is only
|
4838 | * created if it is needed.
|
4839 | */
|
4840 | symbolNode.prototype.toNode = function() {
|
4841 | var node = document.createTextNode(this.value);
|
4842 | var span = null;
|
4843 |
|
4844 | if (this.italic > 0) {
|
4845 | span = document.createElement("span");
|
4846 | span.style.marginRight = this.italic + "em";
|
4847 | }
|
4848 |
|
4849 | if (this.classes.length > 0) {
|
4850 | span = span || document.createElement("span");
|
4851 | span.className = createClass(this.classes);
|
4852 | }
|
4853 |
|
4854 | for (var style in this.style) {
|
4855 | if (this.style.hasOwnProperty(style)) {
|
4856 | span = span || document.createElement("span");
|
4857 | span.style[style] = this.style[style];
|
4858 | }
|
4859 | }
|
4860 |
|
4861 | if (span) {
|
4862 | span.appendChild(node);
|
4863 | return span;
|
4864 | } else {
|
4865 | return node;
|
4866 | }
|
4867 | };
|
4868 |
|
4869 | /**
|
4870 | * Creates markup for a symbol node.
|
4871 | */
|
4872 | symbolNode.prototype.toMarkup = function() {
|
4873 | // TODO(alpert): More duplication than I'd like from
|
4874 | // span.prototype.toMarkup and symbolNode.prototype.toNode...
|
4875 | var needsSpan = false;
|
4876 |
|
4877 | var markup = "<span";
|
4878 |
|
4879 | if (this.classes.length) {
|
4880 | needsSpan = true;
|
4881 | markup += " class=\"";
|
4882 | markup += utils.escape(createClass(this.classes));
|
4883 | markup += "\"";
|
4884 | }
|
4885 |
|
4886 | var styles = "";
|
4887 |
|
4888 | if (this.italic > 0) {
|
4889 | styles += "margin-right:" + this.italic + "em;";
|
4890 | }
|
4891 | for (var style in this.style) {
|
4892 | if (this.style.hasOwnProperty(style)) {
|
4893 | styles += utils.hyphenate(style) + ":" + this.style[style] + ";";
|
4894 | }
|
4895 | }
|
4896 |
|
4897 | if (styles) {
|
4898 | needsSpan = true;
|
4899 | markup += " style=\"" + utils.escape(styles) + "\"";
|
4900 | }
|
4901 |
|
4902 | var escaped = utils.escape(this.value);
|
4903 | if (needsSpan) {
|
4904 | markup += ">";
|
4905 | markup += escaped;
|
4906 | markup += "</span>";
|
4907 | return markup;
|
4908 | } else {
|
4909 | return escaped;
|
4910 | }
|
4911 | };
|
4912 |
|
4913 | module.exports = {
|
4914 | span: span,
|
4915 | documentFragment: documentFragment,
|
4916 | symbolNode: symbolNode
|
4917 | };
|
4918 |
|
4919 | },{"./utils":25}],17:[function(require,module,exports){
|
4920 | var fontMetrics = require("./fontMetrics");
|
4921 | var parseData = require("./parseData");
|
4922 | var ParseError = require("./ParseError");
|
4923 |
|
4924 | var ParseNode = parseData.ParseNode;
|
4925 | var ParseResult = parseData.ParseResult;
|
4926 |
|
4927 | /**
|
4928 | * Parse the body of the environment, with rows delimited by \\ and
|
4929 | * columns delimited by &, and create a nested list in row-major order
|
4930 | * with one group per cell.
|
4931 | */
|
4932 | function parseArray(parser, pos, mode, result) {
|
4933 | var row = [], body = [row], rowGaps = [];
|
4934 | while (true) {
|
4935 | var cell = parser.parseExpression(pos, mode, false, null);
|
4936 | row.push(new ParseNode("ordgroup", cell.result, mode));
|
4937 | pos = cell.position;
|
4938 | var next = cell.peek.text;
|
4939 | if (next === "&") {
|
4940 | pos = cell.peek.position;
|
4941 | } else if (next === "\\end") {
|
4942 | break;
|
4943 | } else if (next === "\\\\" || next === "\\cr") {
|
4944 | var cr = parser.parseFunction(pos, mode);
|
4945 | rowGaps.push(cr.result.value.size);
|
4946 | pos = cr.position;
|
4947 | row = [];
|
4948 | body.push(row);
|
4949 | } else {
|
4950 | throw new ParseError("Expected & or \\\\ or \\end",
|
4951 | parser.lexer, cell.peek.position);
|
4952 | }
|
4953 | }
|
4954 | result.body = body;
|
4955 | result.rowGaps = rowGaps;
|
4956 | return new ParseResult(new ParseNode(result.type, result, mode), pos);
|
4957 | }
|
4958 |
|
4959 | /*
|
4960 | * An environment definition is very similar to a function definition.
|
4961 | * Each element of the following array may contain
|
4962 | * - names: The names associated with a function. This can be used to
|
4963 | * share one implementation between several similar environments.
|
4964 | * - numArgs: The number of arguments after the \begin{name} function.
|
4965 | * - argTypes: (optional) Just like for a function
|
4966 | * - allowedInText: (optional) Whether or not the environment is allowed inside
|
4967 | * text mode (default false) (not enforced yet)
|
4968 | * - numOptionalArgs: (optional) Just like for a function
|
4969 | * - handler: The function that is called to handle this environment.
|
4970 | * It will receive the following arguments:
|
4971 | * - pos: the current position of the parser.
|
4972 | * - mode: the current parsing mode.
|
4973 | * - envName: the name of the environment, one of the listed names.
|
4974 | * - [args]: the arguments passed to \begin.
|
4975 | * - positions: the positions associated with these arguments.
|
4976 | */
|
4977 |
|
4978 | var environmentDefinitions = [
|
4979 |
|
4980 | // Arrays are part of LaTeX, defined in lttab.dtx so its documentation
|
4981 | // is part of the source2e.pdf file of LaTeX2e source documentation.
|
4982 | {
|
4983 | names: ["array"],
|
4984 | numArgs: 1,
|
4985 | handler: function(pos, mode, envName, colalign, positions) {
|
4986 | var parser = this;
|
4987 | colalign = colalign.value.map ? colalign.value : [colalign];
|
4988 | var cols = colalign.map(function(node) {
|
4989 | var ca = node.value;
|
4990 | if ("lcr".indexOf(ca) !== -1) {
|
4991 | return {
|
4992 | type: "align",
|
4993 | align: ca
|
4994 | };
|
4995 | } else if (ca === "|") {
|
4996 | return {
|
4997 | type: "separator",
|
4998 | separator: "|"
|
4999 | };
|
5000 | }
|
5001 | throw new ParseError(
|
5002 | "Unknown column alignment: " + node.value,
|
5003 | parser.lexer, positions[1]);
|
5004 | });
|
5005 | var res = {
|
5006 | type: "array",
|
5007 | cols: cols,
|
5008 | hskipBeforeAndAfter: true // \@preamble in lttab.dtx
|
5009 | };
|
5010 | res = parseArray(parser, pos, mode, res);
|
5011 | return res;
|
5012 | }
|
5013 | },
|
5014 |
|
5015 | // The matrix environments of amsmath builds on the array environment
|
5016 | // of LaTeX, which is discussed above.
|
5017 | {
|
5018 | names: [
|
5019 | "matrix",
|
5020 | "pmatrix",
|
5021 | "bmatrix",
|
5022 | "Bmatrix",
|
5023 | "vmatrix",
|
5024 | "Vmatrix"
|
5025 | ],
|
5026 | handler: function(pos, mode, envName) {
|
5027 | var delimiters = {
|
5028 | "matrix": null,
|
5029 | "pmatrix": ["(", ")"],
|
5030 | "bmatrix": ["[", "]"],
|
5031 | "Bmatrix": ["\\{", "\\}"],
|
5032 | "vmatrix": ["|", "|"],
|
5033 | "Vmatrix": ["\\Vert", "\\Vert"]
|
5034 | }[envName];
|
5035 | var res = {
|
5036 | type: "array",
|
5037 | hskipBeforeAndAfter: false // \hskip -\arraycolsep in amsmath
|
5038 | };
|
5039 | res = parseArray(this, pos, mode, res);
|
5040 | if (delimiters) {
|
5041 | res.result = new ParseNode("leftright", {
|
5042 | body: [res.result],
|
5043 | left: delimiters[0],
|
5044 | right: delimiters[1]
|
5045 | }, mode);
|
5046 | }
|
5047 | return res;
|
5048 | }
|
5049 | },
|
5050 |
|
5051 | // A cases environment (in amsmath.sty) is almost equivalent to
|
5052 | // \def\arraystretch{1.2}%
|
5053 | // \left\{\begin{array}{@{}l@{\quad}l@{}} … \end{array}\right.
|
5054 | {
|
5055 | names: ["cases"],
|
5056 | handler: function(pos, mode, envName) {
|
5057 | var res = {
|
5058 | type: "array",
|
5059 | arraystretch: 1.2,
|
5060 | cols: [{
|
5061 | type: "align",
|
5062 | align: "l",
|
5063 | pregap: 0,
|
5064 | postgap: fontMetrics.metrics.quad
|
5065 | }, {
|
5066 | type: "align",
|
5067 | align: "l",
|
5068 | pregap: 0,
|
5069 | postgap: 0
|
5070 | }]
|
5071 | };
|
5072 | res = parseArray(this, pos, mode, res);
|
5073 | res.result = new ParseNode("leftright", {
|
5074 | body: [res.result],
|
5075 | left: "\\{",
|
5076 | right: "."
|
5077 | }, mode);
|
5078 | return res;
|
5079 | }
|
5080 | }
|
5081 | ];
|
5082 |
|
5083 | module.exports = (function() {
|
5084 | // nested function so we don't leak i and j into the module scope
|
5085 | var exports = {};
|
5086 | for (var i = 0; i < environmentDefinitions.length; ++i) {
|
5087 | var def = environmentDefinitions[i];
|
5088 | def.greediness = 1;
|
5089 | def.allowedInText = !!def.allowedInText;
|
5090 | def.numArgs = def.numArgs || 0;
|
5091 | def.numOptionalArgs = def.numOptionalArgs || 0;
|
5092 | for (var j = 0; j < def.names.length; ++j) {
|
5093 | exports[def.names[j]] = def;
|
5094 | }
|
5095 | }
|
5096 | return exports;
|
5097 | })();
|
5098 |
|
5099 | },{"./ParseError":7,"./fontMetrics":18,"./parseData":22}],18:[function(require,module,exports){
|
5100 | /* jshint unused:false */
|
5101 |
|
5102 | var Style = require("./Style");
|
5103 |
|
5104 | /**
|
5105 | * This file contains metrics regarding fonts and individual symbols. The sigma
|
5106 | * and xi variables, as well as the metricMap map contain data extracted from
|
5107 | * TeX, TeX font metrics, and the TTF files. These data are then exposed via the
|
5108 | * `metrics` variable and the getCharacterMetrics function.
|
5109 | */
|
5110 |
|
5111 | // These font metrics are extracted from TeX by using
|
5112 | // \font\a=cmmi10
|
5113 | // \showthe\fontdimenX\a
|
5114 | // where X is the corresponding variable number. These correspond to the font
|
5115 | // parameters of the symbol fonts. In TeX, there are actually three sets of
|
5116 | // dimensions, one for each of textstyle, scriptstyle, and scriptscriptstyle,
|
5117 | // but we only use the textstyle ones, and scale certain dimensions accordingly.
|
5118 | // See the TeXbook, page 441.
|
5119 | var sigma1 = 0.025;
|
5120 | var sigma2 = 0;
|
5121 | var sigma3 = 0;
|
5122 | var sigma4 = 0;
|
5123 | var sigma5 = 0.431;
|
5124 | var sigma6 = 1;
|
5125 | var sigma7 = 0;
|
5126 | var sigma8 = 0.677;
|
5127 | var sigma9 = 0.394;
|
5128 | var sigma10 = 0.444;
|
5129 | var sigma11 = 0.686;
|
5130 | var sigma12 = 0.345;
|
5131 | var sigma13 = 0.413;
|
5132 | var sigma14 = 0.363;
|
5133 | var sigma15 = 0.289;
|
5134 | var sigma16 = 0.150;
|
5135 | var sigma17 = 0.247;
|
5136 | var sigma18 = 0.386;
|
5137 | var sigma19 = 0.050;
|
5138 | var sigma20 = 2.390;
|
5139 | var sigma21 = 1.01;
|
5140 | var sigma21Script = 0.81;
|
5141 | var sigma21ScriptScript = 0.71;
|
5142 | var sigma22 = 0.250;
|
5143 |
|
5144 | // These font metrics are extracted from TeX by using
|
5145 | // \font\a=cmex10
|
5146 | // \showthe\fontdimenX\a
|
5147 | // where X is the corresponding variable number. These correspond to the font
|
5148 | // parameters of the extension fonts (family 3). See the TeXbook, page 441.
|
5149 | var xi1 = 0;
|
5150 | var xi2 = 0;
|
5151 | var xi3 = 0;
|
5152 | var xi4 = 0;
|
5153 | var xi5 = 0.431;
|
5154 | var xi6 = 1;
|
5155 | var xi7 = 0;
|
5156 | var xi8 = 0.04;
|
5157 | var xi9 = 0.111;
|
5158 | var xi10 = 0.166;
|
5159 | var xi11 = 0.2;
|
5160 | var xi12 = 0.6;
|
5161 | var xi13 = 0.1;
|
5162 |
|
5163 | // This value determines how large a pt is, for metrics which are defined in
|
5164 | // terms of pts.
|
5165 | // This value is also used in katex.less; if you change it make sure the values
|
5166 | // match.
|
5167 | var ptPerEm = 10.0;
|
5168 |
|
5169 | // The space between adjacent `|` columns in an array definition. From
|
5170 | // `\showthe\doublerulesep` in LaTeX.
|
5171 | var doubleRuleSep = 2.0 / ptPerEm;
|
5172 |
|
5173 | /**
|
5174 | * This is just a mapping from common names to real metrics
|
5175 | */
|
5176 | var metrics = {
|
5177 | xHeight: sigma5,
|
5178 | quad: sigma6,
|
5179 | num1: sigma8,
|
5180 | num2: sigma9,
|
5181 | num3: sigma10,
|
5182 | denom1: sigma11,
|
5183 | denom2: sigma12,
|
5184 | sup1: sigma13,
|
5185 | sup2: sigma14,
|
5186 | sup3: sigma15,
|
5187 | sub1: sigma16,
|
5188 | sub2: sigma17,
|
5189 | supDrop: sigma18,
|
5190 | subDrop: sigma19,
|
5191 | axisHeight: sigma22,
|
5192 | defaultRuleThickness: xi8,
|
5193 | bigOpSpacing1: xi9,
|
5194 | bigOpSpacing2: xi10,
|
5195 | bigOpSpacing3: xi11,
|
5196 | bigOpSpacing4: xi12,
|
5197 | bigOpSpacing5: xi13,
|
5198 | ptPerEm: ptPerEm,
|
5199 | emPerEx: sigma5 / sigma6,
|
5200 | doubleRuleSep: doubleRuleSep,
|
5201 |
|
5202 | // TODO(alpert): Missing parallel structure here. We should probably add
|
5203 | // style-specific metrics for all of these.
|
5204 | delim1: sigma20,
|
5205 | getDelim2: function(style) {
|
5206 | if (style.size === Style.TEXT.size) {
|
5207 | return sigma21;
|
5208 | } else if (style.size === Style.SCRIPT.size) {
|
5209 | return sigma21Script;
|
5210 | } else if (style.size === Style.SCRIPTSCRIPT.size) {
|
5211 | return sigma21ScriptScript;
|
5212 | }
|
5213 | throw new Error("Unexpected style size: " + style.size);
|
5214 | }
|
5215 | };
|
5216 |
|
5217 | // This map contains a mapping from font name and character code to character
|
5218 | // metrics, including height, depth, italic correction, and skew (kern from the
|
5219 | // character to the corresponding \skewchar)
|
5220 | // This map is generated via `make metrics`. It should not be changed manually.
|
5221 | var metricMap = require("./fontMetricsData");
|
5222 |
|
5223 | /**
|
5224 | * This function is a convience function for looking up information in the
|
5225 | * metricMap table. It takes a character as a string, and a style
|
5226 | */
|
5227 | var getCharacterMetrics = function(character, style) {
|
5228 | return metricMap[style][character.charCodeAt(0)];
|
5229 | };
|
5230 |
|
5231 | module.exports = {
|
5232 | metrics: metrics,
|
5233 | getCharacterMetrics: getCharacterMetrics
|
5234 | };
|
5235 |
|
5236 | },{"./Style":10,"./fontMetricsData":19}],19:[function(require,module,exports){
|
5237 | module.exports = {
|
5238 | "AMS-Regular": {
|
5239 | "65": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5240 | "66": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5241 | "67": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5242 | "68": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5243 | "69": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5244 | "70": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5245 | "71": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5246 | "72": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5247 | "73": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5248 | "74": {"depth": 0.16667, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5249 | "75": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5250 | "76": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5251 | "77": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5252 | "78": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5253 | "79": {"depth": 0.16667, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5254 | "80": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5255 | "81": {"depth": 0.16667, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5256 | "82": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5257 | "83": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5258 | "84": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5259 | "85": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5260 | "86": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5261 | "87": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5262 | "88": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5263 | "89": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5264 | "90": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5265 | "107": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5266 | "165": {"depth": 0.0, "height": 0.675, "italic": 0.025, "skew": 0.0},
|
5267 | "174": {"depth": 0.15559, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5268 | "240": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5269 | "295": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5270 | "710": {"depth": 0.0, "height": 0.825, "italic": 0.0, "skew": 0.0},
|
5271 | "732": {"depth": 0.0, "height": 0.9, "italic": 0.0, "skew": 0.0},
|
5272 | "770": {"depth": 0.0, "height": 0.825, "italic": 0.0, "skew": 0.0},
|
5273 | "771": {"depth": 0.0, "height": 0.9, "italic": 0.0, "skew": 0.0},
|
5274 | "989": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5275 | "1008": {"depth": 0.0, "height": 0.43056, "italic": 0.04028, "skew": 0.0},
|
5276 | "8245": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5277 | "8463": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5278 | "8487": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5279 | "8498": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5280 | "8502": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5281 | "8503": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5282 | "8504": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5283 | "8513": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5284 | "8592": {"depth": -0.03598, "height": 0.46402, "italic": 0.0, "skew": 0.0},
|
5285 | "8594": {"depth": -0.03598, "height": 0.46402, "italic": 0.0, "skew": 0.0},
|
5286 | "8602": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
5287 | "8603": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
5288 | "8606": {"depth": 0.01354, "height": 0.52239, "italic": 0.0, "skew": 0.0},
|
5289 | "8608": {"depth": 0.01354, "height": 0.52239, "italic": 0.0, "skew": 0.0},
|
5290 | "8610": {"depth": 0.01354, "height": 0.52239, "italic": 0.0, "skew": 0.0},
|
5291 | "8611": {"depth": 0.01354, "height": 0.52239, "italic": 0.0, "skew": 0.0},
|
5292 | "8619": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5293 | "8620": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5294 | "8621": {"depth": -0.13313, "height": 0.37788, "italic": 0.0, "skew": 0.0},
|
5295 | "8622": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
5296 | "8624": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5297 | "8625": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5298 | "8630": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5299 | "8631": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5300 | "8634": {"depth": 0.08198, "height": 0.58198, "italic": 0.0, "skew": 0.0},
|
5301 | "8635": {"depth": 0.08198, "height": 0.58198, "italic": 0.0, "skew": 0.0},
|
5302 | "8638": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5303 | "8639": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5304 | "8642": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5305 | "8643": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5306 | "8644": {"depth": 0.1808, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5307 | "8646": {"depth": 0.1808, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5308 | "8647": {"depth": 0.1808, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5309 | "8648": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5310 | "8649": {"depth": 0.1808, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5311 | "8650": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5312 | "8651": {"depth": 0.01354, "height": 0.52239, "italic": 0.0, "skew": 0.0},
|
5313 | "8652": {"depth": 0.01354, "height": 0.52239, "italic": 0.0, "skew": 0.0},
|
5314 | "8653": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
5315 | "8654": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
5316 | "8655": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
5317 | "8666": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5318 | "8667": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5319 | "8669": {"depth": -0.13313, "height": 0.37788, "italic": 0.0, "skew": 0.0},
|
5320 | "8672": {"depth": -0.064, "height": 0.437, "italic": 0, "skew": 0},
|
5321 | "8674": {"depth": -0.064, "height": 0.437, "italic": 0, "skew": 0},
|
5322 | "8705": {"depth": 0.0, "height": 0.825, "italic": 0.0, "skew": 0.0},
|
5323 | "8708": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5324 | "8709": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5325 | "8717": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5326 | "8722": {"depth": -0.03598, "height": 0.46402, "italic": 0.0, "skew": 0.0},
|
5327 | "8724": {"depth": 0.08198, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5328 | "8726": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5329 | "8733": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5330 | "8736": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5331 | "8737": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5332 | "8738": {"depth": 0.03517, "height": 0.52239, "italic": 0.0, "skew": 0.0},
|
5333 | "8739": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5334 | "8740": {"depth": 0.25142, "height": 0.74111, "italic": 0.0, "skew": 0.0},
|
5335 | "8741": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5336 | "8742": {"depth": 0.25142, "height": 0.74111, "italic": 0.0, "skew": 0.0},
|
5337 | "8756": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5338 | "8757": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5339 | "8764": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
5340 | "8765": {"depth": -0.13313, "height": 0.37788, "italic": 0.0, "skew": 0.0},
|
5341 | "8769": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
5342 | "8770": {"depth": -0.03625, "height": 0.46375, "italic": 0.0, "skew": 0.0},
|
5343 | "8774": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5344 | "8776": {"depth": -0.01688, "height": 0.48312, "italic": 0.0, "skew": 0.0},
|
5345 | "8778": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5346 | "8782": {"depth": 0.06062, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5347 | "8783": {"depth": 0.06062, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5348 | "8785": {"depth": 0.08198, "height": 0.58198, "italic": 0.0, "skew": 0.0},
|
5349 | "8786": {"depth": 0.08198, "height": 0.58198, "italic": 0.0, "skew": 0.0},
|
5350 | "8787": {"depth": 0.08198, "height": 0.58198, "italic": 0.0, "skew": 0.0},
|
5351 | "8790": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5352 | "8791": {"depth": 0.22958, "height": 0.72958, "italic": 0.0, "skew": 0.0},
|
5353 | "8796": {"depth": 0.08198, "height": 0.91667, "italic": 0.0, "skew": 0.0},
|
5354 | "8806": {"depth": 0.25583, "height": 0.75583, "italic": 0.0, "skew": 0.0},
|
5355 | "8807": {"depth": 0.25583, "height": 0.75583, "italic": 0.0, "skew": 0.0},
|
5356 | "8808": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5357 | "8809": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5358 | "8812": {"depth": 0.25583, "height": 0.75583, "italic": 0.0, "skew": 0.0},
|
5359 | "8814": {"depth": 0.20576, "height": 0.70576, "italic": 0.0, "skew": 0.0},
|
5360 | "8815": {"depth": 0.20576, "height": 0.70576, "italic": 0.0, "skew": 0.0},
|
5361 | "8816": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5362 | "8817": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5363 | "8818": {"depth": 0.22958, "height": 0.72958, "italic": 0.0, "skew": 0.0},
|
5364 | "8819": {"depth": 0.22958, "height": 0.72958, "italic": 0.0, "skew": 0.0},
|
5365 | "8822": {"depth": 0.1808, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5366 | "8823": {"depth": 0.1808, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5367 | "8828": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5368 | "8829": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5369 | "8830": {"depth": 0.22958, "height": 0.72958, "italic": 0.0, "skew": 0.0},
|
5370 | "8831": {"depth": 0.22958, "height": 0.72958, "italic": 0.0, "skew": 0.0},
|
5371 | "8832": {"depth": 0.20576, "height": 0.70576, "italic": 0.0, "skew": 0.0},
|
5372 | "8833": {"depth": 0.20576, "height": 0.70576, "italic": 0.0, "skew": 0.0},
|
5373 | "8840": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5374 | "8841": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5375 | "8842": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
5376 | "8843": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
5377 | "8847": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5378 | "8848": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5379 | "8858": {"depth": 0.08198, "height": 0.58198, "italic": 0.0, "skew": 0.0},
|
5380 | "8859": {"depth": 0.08198, "height": 0.58198, "italic": 0.0, "skew": 0.0},
|
5381 | "8861": {"depth": 0.08198, "height": 0.58198, "italic": 0.0, "skew": 0.0},
|
5382 | "8862": {"depth": 0.0, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5383 | "8863": {"depth": 0.0, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5384 | "8864": {"depth": 0.0, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5385 | "8865": {"depth": 0.0, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5386 | "8872": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5387 | "8873": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5388 | "8874": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5389 | "8876": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5390 | "8877": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5391 | "8878": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5392 | "8879": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5393 | "8882": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5394 | "8883": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5395 | "8884": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5396 | "8885": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5397 | "8888": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5398 | "8890": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5399 | "8891": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5400 | "8892": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5401 | "8901": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5402 | "8903": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5403 | "8905": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5404 | "8906": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5405 | "8907": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5406 | "8908": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5407 | "8909": {"depth": -0.03598, "height": 0.46402, "italic": 0.0, "skew": 0.0},
|
5408 | "8910": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5409 | "8911": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5410 | "8912": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5411 | "8913": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5412 | "8914": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5413 | "8915": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5414 | "8916": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5415 | "8918": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
5416 | "8919": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
5417 | "8920": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5418 | "8921": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5419 | "8922": {"depth": 0.38569, "height": 0.88569, "italic": 0.0, "skew": 0.0},
|
5420 | "8923": {"depth": 0.38569, "height": 0.88569, "italic": 0.0, "skew": 0.0},
|
5421 | "8926": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5422 | "8927": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5423 | "8928": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5424 | "8929": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5425 | "8934": {"depth": 0.23222, "height": 0.74111, "italic": 0.0, "skew": 0.0},
|
5426 | "8935": {"depth": 0.23222, "height": 0.74111, "italic": 0.0, "skew": 0.0},
|
5427 | "8936": {"depth": 0.23222, "height": 0.74111, "italic": 0.0, "skew": 0.0},
|
5428 | "8937": {"depth": 0.23222, "height": 0.74111, "italic": 0.0, "skew": 0.0},
|
5429 | "8938": {"depth": 0.20576, "height": 0.70576, "italic": 0.0, "skew": 0.0},
|
5430 | "8939": {"depth": 0.20576, "height": 0.70576, "italic": 0.0, "skew": 0.0},
|
5431 | "8940": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5432 | "8941": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5433 | "8994": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5434 | "8995": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5435 | "9416": {"depth": 0.15559, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5436 | "9484": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5437 | "9488": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5438 | "9492": {"depth": 0.0, "height": 0.37788, "italic": 0.0, "skew": 0.0},
|
5439 | "9496": {"depth": 0.0, "height": 0.37788, "italic": 0.0, "skew": 0.0},
|
5440 | "9585": {"depth": 0.19444, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
5441 | "9586": {"depth": 0.19444, "height": 0.74111, "italic": 0.0, "skew": 0.0},
|
5442 | "9632": {"depth": 0.0, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5443 | "9633": {"depth": 0.0, "height": 0.675, "italic": 0.0, "skew": 0.0},
|
5444 | "9650": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5445 | "9651": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5446 | "9654": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5447 | "9660": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5448 | "9661": {"depth": 0.0, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5449 | "9664": {"depth": 0.03517, "height": 0.54986, "italic": 0.0, "skew": 0.0},
|
5450 | "9674": {"depth": 0.11111, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5451 | "9733": {"depth": 0.19444, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5452 | "10003": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5453 | "10016": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5454 | "10731": {"depth": 0.11111, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5455 | "10846": {"depth": 0.19444, "height": 0.75583, "italic": 0.0, "skew": 0.0},
|
5456 | "10877": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5457 | "10878": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5458 | "10885": {"depth": 0.25583, "height": 0.75583, "italic": 0.0, "skew": 0.0},
|
5459 | "10886": {"depth": 0.25583, "height": 0.75583, "italic": 0.0, "skew": 0.0},
|
5460 | "10887": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
5461 | "10888": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
5462 | "10889": {"depth": 0.26167, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5463 | "10890": {"depth": 0.26167, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5464 | "10891": {"depth": 0.48256, "height": 0.98256, "italic": 0.0, "skew": 0.0},
|
5465 | "10892": {"depth": 0.48256, "height": 0.98256, "italic": 0.0, "skew": 0.0},
|
5466 | "10901": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5467 | "10902": {"depth": 0.13667, "height": 0.63667, "italic": 0.0, "skew": 0.0},
|
5468 | "10933": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5469 | "10934": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5470 | "10935": {"depth": 0.26167, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5471 | "10936": {"depth": 0.26167, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5472 | "10937": {"depth": 0.26167, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5473 | "10938": {"depth": 0.26167, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5474 | "10949": {"depth": 0.25583, "height": 0.75583, "italic": 0.0, "skew": 0.0},
|
5475 | "10950": {"depth": 0.25583, "height": 0.75583, "italic": 0.0, "skew": 0.0},
|
5476 | "10955": {"depth": 0.28481, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5477 | "10956": {"depth": 0.28481, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5478 | "57350": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5479 | "57351": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5480 | "57352": {"depth": 0.08167, "height": 0.58167, "italic": 0.0, "skew": 0.0},
|
5481 | "57353": {"depth": 0.0, "height": 0.43056, "italic": 0.04028, "skew": 0.0},
|
5482 | "57356": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5483 | "57357": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5484 | "57358": {"depth": 0.41951, "height": 0.91951, "italic": 0.0, "skew": 0.0},
|
5485 | "57359": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5486 | "57360": {"depth": 0.30274, "height": 0.79383, "italic": 0.0, "skew": 0.0},
|
5487 | "57361": {"depth": 0.41951, "height": 0.91951, "italic": 0.0, "skew": 0.0},
|
5488 | "57366": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5489 | "57367": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5490 | "57368": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5491 | "57369": {"depth": 0.25142, "height": 0.75726, "italic": 0.0, "skew": 0.0},
|
5492 | "57370": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
5493 | "57371": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0}
|
5494 | },
|
5495 | "Caligraphic-Regular": {
|
5496 | "48": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5497 | "49": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5498 | "50": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5499 | "51": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5500 | "52": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5501 | "53": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5502 | "54": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5503 | "55": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5504 | "56": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5505 | "57": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
5506 | "65": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.19445},
|
5507 | "66": {"depth": 0.0, "height": 0.68333, "italic": 0.03041, "skew": 0.13889},
|
5508 | "67": {"depth": 0.0, "height": 0.68333, "italic": 0.05834, "skew": 0.13889},
|
5509 | "68": {"depth": 0.0, "height": 0.68333, "italic": 0.02778, "skew": 0.08334},
|
5510 | "69": {"depth": 0.0, "height": 0.68333, "italic": 0.08944, "skew": 0.11111},
|
5511 | "70": {"depth": 0.0, "height": 0.68333, "italic": 0.09931, "skew": 0.11111},
|
5512 | "71": {"depth": 0.09722, "height": 0.68333, "italic": 0.0593, "skew": 0.11111},
|
5513 | "72": {"depth": 0.0, "height": 0.68333, "italic": 0.00965, "skew": 0.11111},
|
5514 | "73": {"depth": 0.0, "height": 0.68333, "italic": 0.07382, "skew": 0.0},
|
5515 | "74": {"depth": 0.09722, "height": 0.68333, "italic": 0.18472, "skew": 0.16667},
|
5516 | "75": {"depth": 0.0, "height": 0.68333, "italic": 0.01445, "skew": 0.05556},
|
5517 | "76": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.13889},
|
5518 | "77": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.13889},
|
5519 | "78": {"depth": 0.0, "height": 0.68333, "italic": 0.14736, "skew": 0.08334},
|
5520 | "79": {"depth": 0.0, "height": 0.68333, "italic": 0.02778, "skew": 0.11111},
|
5521 | "80": {"depth": 0.0, "height": 0.68333, "italic": 0.08222, "skew": 0.08334},
|
5522 | "81": {"depth": 0.09722, "height": 0.68333, "italic": 0.0, "skew": 0.11111},
|
5523 | "82": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.08334},
|
5524 | "83": {"depth": 0.0, "height": 0.68333, "italic": 0.075, "skew": 0.13889},
|
5525 | "84": {"depth": 0.0, "height": 0.68333, "italic": 0.25417, "skew": 0.0},
|
5526 | "85": {"depth": 0.0, "height": 0.68333, "italic": 0.09931, "skew": 0.08334},
|
5527 | "86": {"depth": 0.0, "height": 0.68333, "italic": 0.08222, "skew": 0.0},
|
5528 | "87": {"depth": 0.0, "height": 0.68333, "italic": 0.08222, "skew": 0.08334},
|
5529 | "88": {"depth": 0.0, "height": 0.68333, "italic": 0.14643, "skew": 0.13889},
|
5530 | "89": {"depth": 0.09722, "height": 0.68333, "italic": 0.08222, "skew": 0.08334},
|
5531 | "90": {"depth": 0.0, "height": 0.68333, "italic": 0.07944, "skew": 0.13889}
|
5532 | },
|
5533 | "Fraktur-Regular": {
|
5534 | "33": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5535 | "34": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5536 | "38": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5537 | "39": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5538 | "40": {"depth": 0.24982, "height": 0.74947, "italic": 0.0, "skew": 0.0},
|
5539 | "41": {"depth": 0.24982, "height": 0.74947, "italic": 0.0, "skew": 0.0},
|
5540 | "42": {"depth": 0.0, "height": 0.62119, "italic": 0.0, "skew": 0.0},
|
5541 | "43": {"depth": 0.08319, "height": 0.58283, "italic": 0.0, "skew": 0.0},
|
5542 | "44": {"depth": 0.0, "height": 0.10803, "italic": 0.0, "skew": 0.0},
|
5543 | "45": {"depth": 0.08319, "height": 0.58283, "italic": 0.0, "skew": 0.0},
|
5544 | "46": {"depth": 0.0, "height": 0.10803, "italic": 0.0, "skew": 0.0},
|
5545 | "47": {"depth": 0.24982, "height": 0.74947, "italic": 0.0, "skew": 0.0},
|
5546 | "48": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5547 | "49": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5548 | "50": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5549 | "51": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5550 | "52": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5551 | "53": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5552 | "54": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5553 | "55": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5554 | "56": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5555 | "57": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5556 | "58": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5557 | "59": {"depth": 0.12604, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5558 | "61": {"depth": -0.13099, "height": 0.36866, "italic": 0.0, "skew": 0.0},
|
5559 | "63": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5560 | "65": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5561 | "66": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5562 | "67": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5563 | "68": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5564 | "69": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5565 | "70": {"depth": 0.12604, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5566 | "71": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5567 | "72": {"depth": 0.06302, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5568 | "73": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5569 | "74": {"depth": 0.12604, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5570 | "75": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5571 | "76": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5572 | "77": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5573 | "78": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5574 | "79": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5575 | "80": {"depth": 0.18906, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5576 | "81": {"depth": 0.03781, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5577 | "82": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5578 | "83": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5579 | "84": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5580 | "85": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5581 | "86": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5582 | "87": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5583 | "88": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5584 | "89": {"depth": 0.18906, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5585 | "90": {"depth": 0.12604, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5586 | "91": {"depth": 0.24982, "height": 0.74947, "italic": 0.0, "skew": 0.0},
|
5587 | "93": {"depth": 0.24982, "height": 0.74947, "italic": 0.0, "skew": 0.0},
|
5588 | "94": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5589 | "97": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5590 | "98": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5591 | "99": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5592 | "100": {"depth": 0.0, "height": 0.62119, "italic": 0.0, "skew": 0.0},
|
5593 | "101": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5594 | "102": {"depth": 0.18906, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5595 | "103": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5596 | "104": {"depth": 0.18906, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5597 | "105": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5598 | "106": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5599 | "107": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5600 | "108": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5601 | "109": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5602 | "110": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5603 | "111": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5604 | "112": {"depth": 0.18906, "height": 0.52396, "italic": 0.0, "skew": 0.0},
|
5605 | "113": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5606 | "114": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5607 | "115": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5608 | "116": {"depth": 0.0, "height": 0.62119, "italic": 0.0, "skew": 0.0},
|
5609 | "117": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5610 | "118": {"depth": 0.0, "height": 0.52396, "italic": 0.0, "skew": 0.0},
|
5611 | "119": {"depth": 0.0, "height": 0.52396, "italic": 0.0, "skew": 0.0},
|
5612 | "120": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5613 | "121": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5614 | "122": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5615 | "8216": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5616 | "8217": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5617 | "58112": {"depth": 0.0, "height": 0.62119, "italic": 0.0, "skew": 0.0},
|
5618 | "58113": {"depth": 0.0, "height": 0.62119, "italic": 0.0, "skew": 0.0},
|
5619 | "58114": {"depth": 0.18906, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5620 | "58115": {"depth": 0.18906, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5621 | "58116": {"depth": 0.18906, "height": 0.47534, "italic": 0.0, "skew": 0.0},
|
5622 | "58117": {"depth": 0.0, "height": 0.69141, "italic": 0.0, "skew": 0.0},
|
5623 | "58118": {"depth": 0.0, "height": 0.62119, "italic": 0.0, "skew": 0.0},
|
5624 | "58119": {"depth": 0.0, "height": 0.47534, "italic": 0.0, "skew": 0.0}
|
5625 | },
|
5626 | "Main-Bold": {
|
5627 | "33": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5628 | "34": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5629 | "35": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5630 | "36": {"depth": 0.05556, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5631 | "37": {"depth": 0.05556, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5632 | "38": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5633 | "39": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5634 | "40": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5635 | "41": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5636 | "42": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5637 | "43": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5638 | "44": {"depth": 0.19444, "height": 0.15556, "italic": 0.0, "skew": 0.0},
|
5639 | "45": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5640 | "46": {"depth": 0.0, "height": 0.15556, "italic": 0.0, "skew": 0.0},
|
5641 | "47": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5642 | "48": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5643 | "49": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5644 | "50": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5645 | "51": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5646 | "52": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5647 | "53": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5648 | "54": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5649 | "55": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5650 | "56": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5651 | "57": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
5652 | "58": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5653 | "59": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5654 | "60": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5655 | "61": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5656 | "62": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5657 | "63": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5658 | "64": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5659 | "65": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5660 | "66": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5661 | "67": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5662 | "68": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5663 | "69": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5664 | "70": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5665 | "71": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5666 | "72": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5667 | "73": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5668 | "74": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5669 | "75": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5670 | "76": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5671 | "77": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5672 | "78": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5673 | "79": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5674 | "80": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5675 | "81": {"depth": 0.19444, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5676 | "82": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5677 | "83": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5678 | "84": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5679 | "85": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5680 | "86": {"depth": 0.0, "height": 0.68611, "italic": 0.01597, "skew": 0.0},
|
5681 | "87": {"depth": 0.0, "height": 0.68611, "italic": 0.01597, "skew": 0.0},
|
5682 | "88": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5683 | "89": {"depth": 0.0, "height": 0.68611, "italic": 0.02875, "skew": 0.0},
|
5684 | "90": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5685 | "91": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5686 | "92": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5687 | "93": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5688 | "94": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5689 | "95": {"depth": 0.31, "height": 0.13444, "italic": 0.03194, "skew": 0.0},
|
5690 | "96": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5691 | "97": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5692 | "98": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5693 | "99": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5694 | "100": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5695 | "101": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5696 | "102": {"depth": 0.0, "height": 0.69444, "italic": 0.10903, "skew": 0.0},
|
5697 | "103": {"depth": 0.19444, "height": 0.44444, "italic": 0.01597, "skew": 0.0},
|
5698 | "104": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5699 | "105": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5700 | "106": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5701 | "107": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5702 | "108": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5703 | "109": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5704 | "110": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5705 | "111": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5706 | "112": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5707 | "113": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5708 | "114": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5709 | "115": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5710 | "116": {"depth": 0.0, "height": 0.63492, "italic": 0.0, "skew": 0.0},
|
5711 | "117": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5712 | "118": {"depth": 0.0, "height": 0.44444, "italic": 0.01597, "skew": 0.0},
|
5713 | "119": {"depth": 0.0, "height": 0.44444, "italic": 0.01597, "skew": 0.0},
|
5714 | "120": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5715 | "121": {"depth": 0.19444, "height": 0.44444, "italic": 0.01597, "skew": 0.0},
|
5716 | "122": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5717 | "123": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5718 | "124": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5719 | "125": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5720 | "126": {"depth": 0.35, "height": 0.34444, "italic": 0.0, "skew": 0.0},
|
5721 | "168": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5722 | "172": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5723 | "175": {"depth": 0.0, "height": 0.59611, "italic": 0.0, "skew": 0.0},
|
5724 | "176": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5725 | "177": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5726 | "180": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5727 | "215": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5728 | "247": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5729 | "305": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5730 | "567": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5731 | "710": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5732 | "711": {"depth": 0.0, "height": 0.63194, "italic": 0.0, "skew": 0.0},
|
5733 | "713": {"depth": 0.0, "height": 0.59611, "italic": 0.0, "skew": 0.0},
|
5734 | "714": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5735 | "715": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5736 | "728": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5737 | "729": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5738 | "730": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5739 | "732": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5740 | "768": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5741 | "769": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5742 | "770": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5743 | "771": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5744 | "772": {"depth": 0.0, "height": 0.59611, "italic": 0.0, "skew": 0.0},
|
5745 | "774": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5746 | "775": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5747 | "776": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5748 | "778": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5749 | "779": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5750 | "780": {"depth": 0.0, "height": 0.63194, "italic": 0.0, "skew": 0.0},
|
5751 | "824": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5752 | "915": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5753 | "916": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5754 | "920": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5755 | "923": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5756 | "926": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5757 | "928": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5758 | "931": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5759 | "933": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5760 | "934": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5761 | "936": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5762 | "937": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5763 | "8211": {"depth": 0.0, "height": 0.44444, "italic": 0.03194, "skew": 0.0},
|
5764 | "8212": {"depth": 0.0, "height": 0.44444, "italic": 0.03194, "skew": 0.0},
|
5765 | "8216": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5766 | "8217": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5767 | "8220": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5768 | "8221": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5769 | "8224": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5770 | "8225": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5771 | "8242": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
5772 | "8407": {"depth": 0.0, "height": 0.72444, "italic": 0.15486, "skew": 0.0},
|
5773 | "8463": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5774 | "8465": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5775 | "8467": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5776 | "8472": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5777 | "8476": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5778 | "8501": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5779 | "8592": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5780 | "8593": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5781 | "8594": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5782 | "8595": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5783 | "8596": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5784 | "8597": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5785 | "8598": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5786 | "8599": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5787 | "8600": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5788 | "8601": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5789 | "8636": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5790 | "8637": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5791 | "8640": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5792 | "8641": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5793 | "8656": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5794 | "8657": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5795 | "8658": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5796 | "8659": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5797 | "8660": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5798 | "8661": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5799 | "8704": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5800 | "8706": {"depth": 0.0, "height": 0.69444, "italic": 0.06389, "skew": 0.0},
|
5801 | "8707": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5802 | "8709": {"depth": 0.05556, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5803 | "8711": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5804 | "8712": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5805 | "8715": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5806 | "8722": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5807 | "8723": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5808 | "8725": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5809 | "8726": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5810 | "8727": {"depth": -0.02778, "height": 0.47222, "italic": 0.0, "skew": 0.0},
|
5811 | "8728": {"depth": -0.02639, "height": 0.47361, "italic": 0.0, "skew": 0.0},
|
5812 | "8729": {"depth": -0.02639, "height": 0.47361, "italic": 0.0, "skew": 0.0},
|
5813 | "8730": {"depth": 0.18, "height": 0.82, "italic": 0.0, "skew": 0.0},
|
5814 | "8733": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5815 | "8734": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
5816 | "8736": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
5817 | "8739": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5818 | "8741": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5819 | "8743": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
5820 | "8744": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
5821 | "8745": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
5822 | "8746": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
5823 | "8747": {"depth": 0.19444, "height": 0.69444, "italic": 0.12778, "skew": 0.0},
|
5824 | "8764": {"depth": -0.10889, "height": 0.39111, "italic": 0.0, "skew": 0.0},
|
5825 | "8768": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5826 | "8771": {"depth": 0.00222, "height": 0.50222, "italic": 0.0, "skew": 0.0},
|
5827 | "8776": {"depth": 0.02444, "height": 0.52444, "italic": 0.0, "skew": 0.0},
|
5828 | "8781": {"depth": 0.00222, "height": 0.50222, "italic": 0.0, "skew": 0.0},
|
5829 | "8801": {"depth": 0.00222, "height": 0.50222, "italic": 0.0, "skew": 0.0},
|
5830 | "8804": {"depth": 0.19667, "height": 0.69667, "italic": 0.0, "skew": 0.0},
|
5831 | "8805": {"depth": 0.19667, "height": 0.69667, "italic": 0.0, "skew": 0.0},
|
5832 | "8810": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5833 | "8811": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5834 | "8826": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5835 | "8827": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5836 | "8834": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5837 | "8835": {"depth": 0.08556, "height": 0.58556, "italic": 0.0, "skew": 0.0},
|
5838 | "8838": {"depth": 0.19667, "height": 0.69667, "italic": 0.0, "skew": 0.0},
|
5839 | "8839": {"depth": 0.19667, "height": 0.69667, "italic": 0.0, "skew": 0.0},
|
5840 | "8846": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
5841 | "8849": {"depth": 0.19667, "height": 0.69667, "italic": 0.0, "skew": 0.0},
|
5842 | "8850": {"depth": 0.19667, "height": 0.69667, "italic": 0.0, "skew": 0.0},
|
5843 | "8851": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
5844 | "8852": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
5845 | "8853": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5846 | "8854": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5847 | "8855": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5848 | "8856": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5849 | "8857": {"depth": 0.13333, "height": 0.63333, "italic": 0.0, "skew": 0.0},
|
5850 | "8866": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5851 | "8867": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5852 | "8868": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5853 | "8869": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5854 | "8900": {"depth": -0.02639, "height": 0.47361, "italic": 0.0, "skew": 0.0},
|
5855 | "8901": {"depth": -0.02639, "height": 0.47361, "italic": 0.0, "skew": 0.0},
|
5856 | "8902": {"depth": -0.02778, "height": 0.47222, "italic": 0.0, "skew": 0.0},
|
5857 | "8968": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5858 | "8969": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5859 | "8970": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5860 | "8971": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5861 | "8994": {"depth": -0.13889, "height": 0.36111, "italic": 0.0, "skew": 0.0},
|
5862 | "8995": {"depth": -0.13889, "height": 0.36111, "italic": 0.0, "skew": 0.0},
|
5863 | "9651": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5864 | "9657": {"depth": -0.02778, "height": 0.47222, "italic": 0.0, "skew": 0.0},
|
5865 | "9661": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5866 | "9667": {"depth": -0.02778, "height": 0.47222, "italic": 0.0, "skew": 0.0},
|
5867 | "9711": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5868 | "9824": {"depth": 0.12963, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5869 | "9825": {"depth": 0.12963, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5870 | "9826": {"depth": 0.12963, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5871 | "9827": {"depth": 0.12963, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5872 | "9837": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5873 | "9838": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5874 | "9839": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5875 | "10216": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5876 | "10217": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
5877 | "10815": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
5878 | "10927": {"depth": 0.19667, "height": 0.69667, "italic": 0.0, "skew": 0.0},
|
5879 | "10928": {"depth": 0.19667, "height": 0.69667, "italic": 0.0, "skew": 0.0}
|
5880 | },
|
5881 | "Main-Italic": {
|
5882 | "33": {"depth": 0.0, "height": 0.69444, "italic": 0.12417, "skew": 0.0},
|
5883 | "34": {"depth": 0.0, "height": 0.69444, "italic": 0.06961, "skew": 0.0},
|
5884 | "35": {"depth": 0.19444, "height": 0.69444, "italic": 0.06616, "skew": 0.0},
|
5885 | "37": {"depth": 0.05556, "height": 0.75, "italic": 0.13639, "skew": 0.0},
|
5886 | "38": {"depth": 0.0, "height": 0.69444, "italic": 0.09694, "skew": 0.0},
|
5887 | "39": {"depth": 0.0, "height": 0.69444, "italic": 0.12417, "skew": 0.0},
|
5888 | "40": {"depth": 0.25, "height": 0.75, "italic": 0.16194, "skew": 0.0},
|
5889 | "41": {"depth": 0.25, "height": 0.75, "italic": 0.03694, "skew": 0.0},
|
5890 | "42": {"depth": 0.0, "height": 0.75, "italic": 0.14917, "skew": 0.0},
|
5891 | "43": {"depth": 0.05667, "height": 0.56167, "italic": 0.03694, "skew": 0.0},
|
5892 | "44": {"depth": 0.19444, "height": 0.10556, "italic": 0.0, "skew": 0.0},
|
5893 | "45": {"depth": 0.0, "height": 0.43056, "italic": 0.02826, "skew": 0.0},
|
5894 | "46": {"depth": 0.0, "height": 0.10556, "italic": 0.0, "skew": 0.0},
|
5895 | "47": {"depth": 0.25, "height": 0.75, "italic": 0.16194, "skew": 0.0},
|
5896 | "48": {"depth": 0.0, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5897 | "49": {"depth": 0.0, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5898 | "50": {"depth": 0.0, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5899 | "51": {"depth": 0.0, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5900 | "52": {"depth": 0.19444, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5901 | "53": {"depth": 0.0, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5902 | "54": {"depth": 0.0, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5903 | "55": {"depth": 0.19444, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5904 | "56": {"depth": 0.0, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5905 | "57": {"depth": 0.0, "height": 0.64444, "italic": 0.13556, "skew": 0.0},
|
5906 | "58": {"depth": 0.0, "height": 0.43056, "italic": 0.0582, "skew": 0.0},
|
5907 | "59": {"depth": 0.19444, "height": 0.43056, "italic": 0.0582, "skew": 0.0},
|
5908 | "61": {"depth": -0.13313, "height": 0.36687, "italic": 0.06616, "skew": 0.0},
|
5909 | "63": {"depth": 0.0, "height": 0.69444, "italic": 0.1225, "skew": 0.0},
|
5910 | "64": {"depth": 0.0, "height": 0.69444, "italic": 0.09597, "skew": 0.0},
|
5911 | "65": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
5912 | "66": {"depth": 0.0, "height": 0.68333, "italic": 0.10257, "skew": 0.0},
|
5913 | "67": {"depth": 0.0, "height": 0.68333, "italic": 0.14528, "skew": 0.0},
|
5914 | "68": {"depth": 0.0, "height": 0.68333, "italic": 0.09403, "skew": 0.0},
|
5915 | "69": {"depth": 0.0, "height": 0.68333, "italic": 0.12028, "skew": 0.0},
|
5916 | "70": {"depth": 0.0, "height": 0.68333, "italic": 0.13305, "skew": 0.0},
|
5917 | "71": {"depth": 0.0, "height": 0.68333, "italic": 0.08722, "skew": 0.0},
|
5918 | "72": {"depth": 0.0, "height": 0.68333, "italic": 0.16389, "skew": 0.0},
|
5919 | "73": {"depth": 0.0, "height": 0.68333, "italic": 0.15806, "skew": 0.0},
|
5920 | "74": {"depth": 0.0, "height": 0.68333, "italic": 0.14028, "skew": 0.0},
|
5921 | "75": {"depth": 0.0, "height": 0.68333, "italic": 0.14528, "skew": 0.0},
|
5922 | "76": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
5923 | "77": {"depth": 0.0, "height": 0.68333, "italic": 0.16389, "skew": 0.0},
|
5924 | "78": {"depth": 0.0, "height": 0.68333, "italic": 0.16389, "skew": 0.0},
|
5925 | "79": {"depth": 0.0, "height": 0.68333, "italic": 0.09403, "skew": 0.0},
|
5926 | "80": {"depth": 0.0, "height": 0.68333, "italic": 0.10257, "skew": 0.0},
|
5927 | "81": {"depth": 0.19444, "height": 0.68333, "italic": 0.09403, "skew": 0.0},
|
5928 | "82": {"depth": 0.0, "height": 0.68333, "italic": 0.03868, "skew": 0.0},
|
5929 | "83": {"depth": 0.0, "height": 0.68333, "italic": 0.11972, "skew": 0.0},
|
5930 | "84": {"depth": 0.0, "height": 0.68333, "italic": 0.13305, "skew": 0.0},
|
5931 | "85": {"depth": 0.0, "height": 0.68333, "italic": 0.16389, "skew": 0.0},
|
5932 | "86": {"depth": 0.0, "height": 0.68333, "italic": 0.18361, "skew": 0.0},
|
5933 | "87": {"depth": 0.0, "height": 0.68333, "italic": 0.18361, "skew": 0.0},
|
5934 | "88": {"depth": 0.0, "height": 0.68333, "italic": 0.15806, "skew": 0.0},
|
5935 | "89": {"depth": 0.0, "height": 0.68333, "italic": 0.19383, "skew": 0.0},
|
5936 | "90": {"depth": 0.0, "height": 0.68333, "italic": 0.14528, "skew": 0.0},
|
5937 | "91": {"depth": 0.25, "height": 0.75, "italic": 0.1875, "skew": 0.0},
|
5938 | "93": {"depth": 0.25, "height": 0.75, "italic": 0.10528, "skew": 0.0},
|
5939 | "94": {"depth": 0.0, "height": 0.69444, "italic": 0.06646, "skew": 0.0},
|
5940 | "95": {"depth": 0.31, "height": 0.12056, "italic": 0.09208, "skew": 0.0},
|
5941 | "97": {"depth": 0.0, "height": 0.43056, "italic": 0.07671, "skew": 0.0},
|
5942 | "98": {"depth": 0.0, "height": 0.69444, "italic": 0.06312, "skew": 0.0},
|
5943 | "99": {"depth": 0.0, "height": 0.43056, "italic": 0.05653, "skew": 0.0},
|
5944 | "100": {"depth": 0.0, "height": 0.69444, "italic": 0.10333, "skew": 0.0},
|
5945 | "101": {"depth": 0.0, "height": 0.43056, "italic": 0.07514, "skew": 0.0},
|
5946 | "102": {"depth": 0.19444, "height": 0.69444, "italic": 0.21194, "skew": 0.0},
|
5947 | "103": {"depth": 0.19444, "height": 0.43056, "italic": 0.08847, "skew": 0.0},
|
5948 | "104": {"depth": 0.0, "height": 0.69444, "italic": 0.07671, "skew": 0.0},
|
5949 | "105": {"depth": 0.0, "height": 0.65536, "italic": 0.1019, "skew": 0.0},
|
5950 | "106": {"depth": 0.19444, "height": 0.65536, "italic": 0.14467, "skew": 0.0},
|
5951 | "107": {"depth": 0.0, "height": 0.69444, "italic": 0.10764, "skew": 0.0},
|
5952 | "108": {"depth": 0.0, "height": 0.69444, "italic": 0.10333, "skew": 0.0},
|
5953 | "109": {"depth": 0.0, "height": 0.43056, "italic": 0.07671, "skew": 0.0},
|
5954 | "110": {"depth": 0.0, "height": 0.43056, "italic": 0.07671, "skew": 0.0},
|
5955 | "111": {"depth": 0.0, "height": 0.43056, "italic": 0.06312, "skew": 0.0},
|
5956 | "112": {"depth": 0.19444, "height": 0.43056, "italic": 0.06312, "skew": 0.0},
|
5957 | "113": {"depth": 0.19444, "height": 0.43056, "italic": 0.08847, "skew": 0.0},
|
5958 | "114": {"depth": 0.0, "height": 0.43056, "italic": 0.10764, "skew": 0.0},
|
5959 | "115": {"depth": 0.0, "height": 0.43056, "italic": 0.08208, "skew": 0.0},
|
5960 | "116": {"depth": 0.0, "height": 0.61508, "italic": 0.09486, "skew": 0.0},
|
5961 | "117": {"depth": 0.0, "height": 0.43056, "italic": 0.07671, "skew": 0.0},
|
5962 | "118": {"depth": 0.0, "height": 0.43056, "italic": 0.10764, "skew": 0.0},
|
5963 | "119": {"depth": 0.0, "height": 0.43056, "italic": 0.10764, "skew": 0.0},
|
5964 | "120": {"depth": 0.0, "height": 0.43056, "italic": 0.12042, "skew": 0.0},
|
5965 | "121": {"depth": 0.19444, "height": 0.43056, "italic": 0.08847, "skew": 0.0},
|
5966 | "122": {"depth": 0.0, "height": 0.43056, "italic": 0.12292, "skew": 0.0},
|
5967 | "126": {"depth": 0.35, "height": 0.31786, "italic": 0.11585, "skew": 0.0},
|
5968 | "163": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5969 | "305": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.02778},
|
5970 | "567": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
5971 | "768": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5972 | "769": {"depth": 0.0, "height": 0.69444, "italic": 0.09694, "skew": 0.0},
|
5973 | "770": {"depth": 0.0, "height": 0.69444, "italic": 0.06646, "skew": 0.0},
|
5974 | "771": {"depth": 0.0, "height": 0.66786, "italic": 0.11585, "skew": 0.0},
|
5975 | "772": {"depth": 0.0, "height": 0.56167, "italic": 0.10333, "skew": 0.0},
|
5976 | "774": {"depth": 0.0, "height": 0.69444, "italic": 0.10806, "skew": 0.0},
|
5977 | "775": {"depth": 0.0, "height": 0.66786, "italic": 0.11752, "skew": 0.0},
|
5978 | "776": {"depth": 0.0, "height": 0.66786, "italic": 0.10474, "skew": 0.0},
|
5979 | "778": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
5980 | "779": {"depth": 0.0, "height": 0.69444, "italic": 0.1225, "skew": 0.0},
|
5981 | "780": {"depth": 0.0, "height": 0.62847, "italic": 0.08295, "skew": 0.0},
|
5982 | "915": {"depth": 0.0, "height": 0.68333, "italic": 0.13305, "skew": 0.0},
|
5983 | "916": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
5984 | "920": {"depth": 0.0, "height": 0.68333, "italic": 0.09403, "skew": 0.0},
|
5985 | "923": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
5986 | "926": {"depth": 0.0, "height": 0.68333, "italic": 0.15294, "skew": 0.0},
|
5987 | "928": {"depth": 0.0, "height": 0.68333, "italic": 0.16389, "skew": 0.0},
|
5988 | "931": {"depth": 0.0, "height": 0.68333, "italic": 0.12028, "skew": 0.0},
|
5989 | "933": {"depth": 0.0, "height": 0.68333, "italic": 0.11111, "skew": 0.0},
|
5990 | "934": {"depth": 0.0, "height": 0.68333, "italic": 0.05986, "skew": 0.0},
|
5991 | "936": {"depth": 0.0, "height": 0.68333, "italic": 0.11111, "skew": 0.0},
|
5992 | "937": {"depth": 0.0, "height": 0.68333, "italic": 0.10257, "skew": 0.0},
|
5993 | "8211": {"depth": 0.0, "height": 0.43056, "italic": 0.09208, "skew": 0.0},
|
5994 | "8212": {"depth": 0.0, "height": 0.43056, "italic": 0.09208, "skew": 0.0},
|
5995 | "8216": {"depth": 0.0, "height": 0.69444, "italic": 0.12417, "skew": 0.0},
|
5996 | "8217": {"depth": 0.0, "height": 0.69444, "italic": 0.12417, "skew": 0.0},
|
5997 | "8220": {"depth": 0.0, "height": 0.69444, "italic": 0.1685, "skew": 0.0},
|
5998 | "8221": {"depth": 0.0, "height": 0.69444, "italic": 0.06961, "skew": 0.0},
|
5999 | "8463": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0}
|
6000 | },
|
6001 | "Main-Regular": {
|
6002 | "32": {"depth": 0.0, "height": 0.0, "italic": 0, "skew": 0},
|
6003 | "33": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6004 | "34": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6005 | "35": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6006 | "36": {"depth": 0.05556, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6007 | "37": {"depth": 0.05556, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6008 | "38": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6009 | "39": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6010 | "40": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6011 | "41": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6012 | "42": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6013 | "43": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6014 | "44": {"depth": 0.19444, "height": 0.10556, "italic": 0.0, "skew": 0.0},
|
6015 | "45": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6016 | "46": {"depth": 0.0, "height": 0.10556, "italic": 0.0, "skew": 0.0},
|
6017 | "47": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6018 | "48": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6019 | "49": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6020 | "50": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6021 | "51": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6022 | "52": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6023 | "53": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6024 | "54": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6025 | "55": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6026 | "56": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6027 | "57": {"depth": 0.0, "height": 0.64444, "italic": 0.0, "skew": 0.0},
|
6028 | "58": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6029 | "59": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6030 | "60": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6031 | "61": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6032 | "62": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6033 | "63": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6034 | "64": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6035 | "65": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6036 | "66": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6037 | "67": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6038 | "68": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6039 | "69": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6040 | "70": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6041 | "71": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6042 | "72": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6043 | "73": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6044 | "74": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6045 | "75": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6046 | "76": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6047 | "77": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6048 | "78": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6049 | "79": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6050 | "80": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6051 | "81": {"depth": 0.19444, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6052 | "82": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6053 | "83": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6054 | "84": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6055 | "85": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6056 | "86": {"depth": 0.0, "height": 0.68333, "italic": 0.01389, "skew": 0.0},
|
6057 | "87": {"depth": 0.0, "height": 0.68333, "italic": 0.01389, "skew": 0.0},
|
6058 | "88": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6059 | "89": {"depth": 0.0, "height": 0.68333, "italic": 0.025, "skew": 0.0},
|
6060 | "90": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6061 | "91": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6062 | "92": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6063 | "93": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6064 | "94": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6065 | "95": {"depth": 0.31, "height": 0.12056, "italic": 0.02778, "skew": 0.0},
|
6066 | "96": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6067 | "97": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6068 | "98": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6069 | "99": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6070 | "100": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6071 | "101": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6072 | "102": {"depth": 0.0, "height": 0.69444, "italic": 0.07778, "skew": 0.0},
|
6073 | "103": {"depth": 0.19444, "height": 0.43056, "italic": 0.01389, "skew": 0.0},
|
6074 | "104": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6075 | "105": {"depth": 0.0, "height": 0.66786, "italic": 0.0, "skew": 0.0},
|
6076 | "106": {"depth": 0.19444, "height": 0.66786, "italic": 0.0, "skew": 0.0},
|
6077 | "107": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6078 | "108": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6079 | "109": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6080 | "110": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6081 | "111": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6082 | "112": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6083 | "113": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6084 | "114": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6085 | "115": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6086 | "116": {"depth": 0.0, "height": 0.61508, "italic": 0.0, "skew": 0.0},
|
6087 | "117": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6088 | "118": {"depth": 0.0, "height": 0.43056, "italic": 0.01389, "skew": 0.0},
|
6089 | "119": {"depth": 0.0, "height": 0.43056, "italic": 0.01389, "skew": 0.0},
|
6090 | "120": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6091 | "121": {"depth": 0.19444, "height": 0.43056, "italic": 0.01389, "skew": 0.0},
|
6092 | "122": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6093 | "123": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6094 | "124": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6095 | "125": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6096 | "126": {"depth": 0.35, "height": 0.31786, "italic": 0.0, "skew": 0.0},
|
6097 | "160": {"depth": 0.0, "height": 0.0, "italic": 0, "skew": 0},
|
6098 | "168": {"depth": 0.0, "height": 0.66786, "italic": 0.0, "skew": 0.0},
|
6099 | "172": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6100 | "175": {"depth": 0.0, "height": 0.56778, "italic": 0.0, "skew": 0.0},
|
6101 | "176": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6102 | "177": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6103 | "180": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6104 | "215": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6105 | "247": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6106 | "305": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6107 | "567": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6108 | "710": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6109 | "711": {"depth": 0.0, "height": 0.62847, "italic": 0.0, "skew": 0.0},
|
6110 | "713": {"depth": 0.0, "height": 0.56778, "italic": 0.0, "skew": 0.0},
|
6111 | "714": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6112 | "715": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6113 | "728": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6114 | "729": {"depth": 0.0, "height": 0.66786, "italic": 0.0, "skew": 0.0},
|
6115 | "730": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6116 | "732": {"depth": 0.0, "height": 0.66786, "italic": 0.0, "skew": 0.0},
|
6117 | "768": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6118 | "769": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6119 | "770": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6120 | "771": {"depth": 0.0, "height": 0.66786, "italic": 0.0, "skew": 0.0},
|
6121 | "772": {"depth": 0.0, "height": 0.56778, "italic": 0.0, "skew": 0.0},
|
6122 | "774": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6123 | "775": {"depth": 0.0, "height": 0.66786, "italic": 0.0, "skew": 0.0},
|
6124 | "776": {"depth": 0.0, "height": 0.66786, "italic": 0.0, "skew": 0.0},
|
6125 | "778": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6126 | "779": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6127 | "780": {"depth": 0.0, "height": 0.62847, "italic": 0.0, "skew": 0.0},
|
6128 | "824": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6129 | "915": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6130 | "916": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6131 | "920": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6132 | "923": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6133 | "926": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6134 | "928": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6135 | "931": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6136 | "933": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6137 | "934": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6138 | "936": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6139 | "937": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6140 | "8211": {"depth": 0.0, "height": 0.43056, "italic": 0.02778, "skew": 0.0},
|
6141 | "8212": {"depth": 0.0, "height": 0.43056, "italic": 0.02778, "skew": 0.0},
|
6142 | "8216": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6143 | "8217": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6144 | "8220": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6145 | "8221": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6146 | "8224": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6147 | "8225": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6148 | "8230": {"depth": 0.0, "height": 0.12, "italic": 0, "skew": 0},
|
6149 | "8242": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6150 | "8407": {"depth": 0.0, "height": 0.71444, "italic": 0.15382, "skew": 0.0},
|
6151 | "8463": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
6152 | "8465": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6153 | "8467": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.11111},
|
6154 | "8472": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.11111},
|
6155 | "8476": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6156 | "8501": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6157 | "8592": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6158 | "8593": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6159 | "8594": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6160 | "8595": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6161 | "8596": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6162 | "8597": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6163 | "8598": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6164 | "8599": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6165 | "8600": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6166 | "8601": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6167 | "8614": {"depth": 0.011, "height": 0.511, "italic": 0, "skew": 0},
|
6168 | "8617": {"depth": 0.011, "height": 0.511, "italic": 0, "skew": 0},
|
6169 | "8618": {"depth": 0.011, "height": 0.511, "italic": 0, "skew": 0},
|
6170 | "8636": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6171 | "8637": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6172 | "8640": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6173 | "8641": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6174 | "8652": {"depth": 0.011, "height": 0.671, "italic": 0, "skew": 0},
|
6175 | "8656": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6176 | "8657": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6177 | "8658": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6178 | "8659": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6179 | "8660": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6180 | "8661": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6181 | "8704": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6182 | "8706": {"depth": 0.0, "height": 0.69444, "italic": 0.05556, "skew": 0.08334},
|
6183 | "8707": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6184 | "8709": {"depth": 0.05556, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6185 | "8711": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6186 | "8712": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6187 | "8715": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6188 | "8722": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6189 | "8723": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6190 | "8725": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6191 | "8726": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6192 | "8727": {"depth": -0.03472, "height": 0.46528, "italic": 0.0, "skew": 0.0},
|
6193 | "8728": {"depth": -0.05555, "height": 0.44445, "italic": 0.0, "skew": 0.0},
|
6194 | "8729": {"depth": -0.05555, "height": 0.44445, "italic": 0.0, "skew": 0.0},
|
6195 | "8730": {"depth": 0.2, "height": 0.8, "italic": 0.0, "skew": 0.0},
|
6196 | "8733": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6197 | "8734": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6198 | "8736": {"depth": 0.0, "height": 0.69224, "italic": 0.0, "skew": 0.0},
|
6199 | "8739": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6200 | "8741": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6201 | "8743": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6202 | "8744": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6203 | "8745": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6204 | "8746": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6205 | "8747": {"depth": 0.19444, "height": 0.69444, "italic": 0.11111, "skew": 0.0},
|
6206 | "8764": {"depth": -0.13313, "height": 0.36687, "italic": 0.0, "skew": 0.0},
|
6207 | "8768": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6208 | "8771": {"depth": -0.03625, "height": 0.46375, "italic": 0.0, "skew": 0.0},
|
6209 | "8773": {"depth": -0.022, "height": 0.589, "italic": 0, "skew": 0},
|
6210 | "8776": {"depth": -0.01688, "height": 0.48312, "italic": 0.0, "skew": 0.0},
|
6211 | "8781": {"depth": -0.03625, "height": 0.46375, "italic": 0.0, "skew": 0.0},
|
6212 | "8784": {"depth": -0.133, "height": 0.67, "italic": 0, "skew": 0},
|
6213 | "8800": {"depth": 0.215, "height": 0.716, "italic": 0, "skew": 0},
|
6214 | "8801": {"depth": -0.03625, "height": 0.46375, "italic": 0.0, "skew": 0.0},
|
6215 | "8804": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
6216 | "8805": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
6217 | "8810": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6218 | "8811": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6219 | "8826": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6220 | "8827": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6221 | "8834": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6222 | "8835": {"depth": 0.0391, "height": 0.5391, "italic": 0.0, "skew": 0.0},
|
6223 | "8838": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
6224 | "8839": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
6225 | "8846": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6226 | "8849": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
6227 | "8850": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
6228 | "8851": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6229 | "8852": {"depth": 0.0, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6230 | "8853": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6231 | "8854": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6232 | "8855": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6233 | "8856": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6234 | "8857": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6235 | "8866": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6236 | "8867": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6237 | "8868": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6238 | "8869": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6239 | "8872": {"depth": 0.249, "height": 0.75, "italic": 0, "skew": 0},
|
6240 | "8900": {"depth": -0.05555, "height": 0.44445, "italic": 0.0, "skew": 0.0},
|
6241 | "8901": {"depth": -0.05555, "height": 0.44445, "italic": 0.0, "skew": 0.0},
|
6242 | "8902": {"depth": -0.03472, "height": 0.46528, "italic": 0.0, "skew": 0.0},
|
6243 | "8904": {"depth": 0.005, "height": 0.505, "italic": 0, "skew": 0},
|
6244 | "8942": {"depth": 0.03, "height": 0.9, "italic": 0, "skew": 0},
|
6245 | "8943": {"depth": -0.19, "height": 0.31, "italic": 0, "skew": 0},
|
6246 | "8945": {"depth": -0.1, "height": 0.82, "italic": 0, "skew": 0},
|
6247 | "8968": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6248 | "8969": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6249 | "8970": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6250 | "8971": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6251 | "8994": {"depth": -0.14236, "height": 0.35764, "italic": 0.0, "skew": 0.0},
|
6252 | "8995": {"depth": -0.14236, "height": 0.35764, "italic": 0.0, "skew": 0.0},
|
6253 | "9136": {"depth": 0.244, "height": 0.744, "italic": 0, "skew": 0},
|
6254 | "9137": {"depth": 0.244, "height": 0.744, "italic": 0, "skew": 0},
|
6255 | "9651": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6256 | "9657": {"depth": -0.03472, "height": 0.46528, "italic": 0.0, "skew": 0.0},
|
6257 | "9661": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6258 | "9667": {"depth": -0.03472, "height": 0.46528, "italic": 0.0, "skew": 0.0},
|
6259 | "9711": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6260 | "9824": {"depth": 0.12963, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6261 | "9825": {"depth": 0.12963, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6262 | "9826": {"depth": 0.12963, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6263 | "9827": {"depth": 0.12963, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6264 | "9837": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6265 | "9838": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6266 | "9839": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6267 | "10216": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6268 | "10217": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6269 | "10222": {"depth": 0.244, "height": 0.744, "italic": 0, "skew": 0},
|
6270 | "10223": {"depth": 0.244, "height": 0.744, "italic": 0, "skew": 0},
|
6271 | "10229": {"depth": 0.011, "height": 0.511, "italic": 0, "skew": 0},
|
6272 | "10230": {"depth": 0.011, "height": 0.511, "italic": 0, "skew": 0},
|
6273 | "10231": {"depth": 0.011, "height": 0.511, "italic": 0, "skew": 0},
|
6274 | "10232": {"depth": 0.024, "height": 0.525, "italic": 0, "skew": 0},
|
6275 | "10233": {"depth": 0.024, "height": 0.525, "italic": 0, "skew": 0},
|
6276 | "10234": {"depth": 0.024, "height": 0.525, "italic": 0, "skew": 0},
|
6277 | "10236": {"depth": 0.011, "height": 0.511, "italic": 0, "skew": 0},
|
6278 | "10815": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.0},
|
6279 | "10927": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0},
|
6280 | "10928": {"depth": 0.13597, "height": 0.63597, "italic": 0.0, "skew": 0.0}
|
6281 | },
|
6282 | "Math-BoldItalic": {
|
6283 | "47": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6284 | "65": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
6285 | "66": {"depth": 0.0, "height": 0.68611, "italic": 0.04835, "skew": 0.0},
|
6286 | "67": {"depth": 0.0, "height": 0.68611, "italic": 0.06979, "skew": 0.0},
|
6287 | "68": {"depth": 0.0, "height": 0.68611, "italic": 0.03194, "skew": 0.0},
|
6288 | "69": {"depth": 0.0, "height": 0.68611, "italic": 0.05451, "skew": 0.0},
|
6289 | "70": {"depth": 0.0, "height": 0.68611, "italic": 0.15972, "skew": 0.0},
|
6290 | "71": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
6291 | "72": {"depth": 0.0, "height": 0.68611, "italic": 0.08229, "skew": 0.0},
|
6292 | "73": {"depth": 0.0, "height": 0.68611, "italic": 0.07778, "skew": 0.0},
|
6293 | "74": {"depth": 0.0, "height": 0.68611, "italic": 0.10069, "skew": 0.0},
|
6294 | "75": {"depth": 0.0, "height": 0.68611, "italic": 0.06979, "skew": 0.0},
|
6295 | "76": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
6296 | "77": {"depth": 0.0, "height": 0.68611, "italic": 0.11424, "skew": 0.0},
|
6297 | "78": {"depth": 0.0, "height": 0.68611, "italic": 0.11424, "skew": 0.0},
|
6298 | "79": {"depth": 0.0, "height": 0.68611, "italic": 0.03194, "skew": 0.0},
|
6299 | "80": {"depth": 0.0, "height": 0.68611, "italic": 0.15972, "skew": 0.0},
|
6300 | "81": {"depth": 0.19444, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
6301 | "82": {"depth": 0.0, "height": 0.68611, "italic": 0.00421, "skew": 0.0},
|
6302 | "83": {"depth": 0.0, "height": 0.68611, "italic": 0.05382, "skew": 0.0},
|
6303 | "84": {"depth": 0.0, "height": 0.68611, "italic": 0.15972, "skew": 0.0},
|
6304 | "85": {"depth": 0.0, "height": 0.68611, "italic": 0.11424, "skew": 0.0},
|
6305 | "86": {"depth": 0.0, "height": 0.68611, "italic": 0.25555, "skew": 0.0},
|
6306 | "87": {"depth": 0.0, "height": 0.68611, "italic": 0.15972, "skew": 0.0},
|
6307 | "88": {"depth": 0.0, "height": 0.68611, "italic": 0.07778, "skew": 0.0},
|
6308 | "89": {"depth": 0.0, "height": 0.68611, "italic": 0.25555, "skew": 0.0},
|
6309 | "90": {"depth": 0.0, "height": 0.68611, "italic": 0.06979, "skew": 0.0},
|
6310 | "97": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6311 | "98": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6312 | "99": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6313 | "100": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6314 | "101": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6315 | "102": {"depth": 0.19444, "height": 0.69444, "italic": 0.11042, "skew": 0.0},
|
6316 | "103": {"depth": 0.19444, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6317 | "104": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6318 | "105": {"depth": 0.0, "height": 0.69326, "italic": 0.0, "skew": 0.0},
|
6319 | "106": {"depth": 0.19444, "height": 0.69326, "italic": 0.0622, "skew": 0.0},
|
6320 | "107": {"depth": 0.0, "height": 0.69444, "italic": 0.01852, "skew": 0.0},
|
6321 | "108": {"depth": 0.0, "height": 0.69444, "italic": 0.0088, "skew": 0.0},
|
6322 | "109": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6323 | "110": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6324 | "111": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6325 | "112": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6326 | "113": {"depth": 0.19444, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6327 | "114": {"depth": 0.0, "height": 0.44444, "italic": 0.03194, "skew": 0.0},
|
6328 | "115": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6329 | "116": {"depth": 0.0, "height": 0.63492, "italic": 0.0, "skew": 0.0},
|
6330 | "117": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6331 | "118": {"depth": 0.0, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6332 | "119": {"depth": 0.0, "height": 0.44444, "italic": 0.02778, "skew": 0.0},
|
6333 | "120": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6334 | "121": {"depth": 0.19444, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6335 | "122": {"depth": 0.0, "height": 0.44444, "italic": 0.04213, "skew": 0.0},
|
6336 | "915": {"depth": 0.0, "height": 0.68611, "italic": 0.15972, "skew": 0.0},
|
6337 | "916": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
6338 | "920": {"depth": 0.0, "height": 0.68611, "italic": 0.03194, "skew": 0.0},
|
6339 | "923": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
6340 | "926": {"depth": 0.0, "height": 0.68611, "italic": 0.07458, "skew": 0.0},
|
6341 | "928": {"depth": 0.0, "height": 0.68611, "italic": 0.08229, "skew": 0.0},
|
6342 | "931": {"depth": 0.0, "height": 0.68611, "italic": 0.05451, "skew": 0.0},
|
6343 | "933": {"depth": 0.0, "height": 0.68611, "italic": 0.15972, "skew": 0.0},
|
6344 | "934": {"depth": 0.0, "height": 0.68611, "italic": 0.0, "skew": 0.0},
|
6345 | "936": {"depth": 0.0, "height": 0.68611, "italic": 0.11653, "skew": 0.0},
|
6346 | "937": {"depth": 0.0, "height": 0.68611, "italic": 0.04835, "skew": 0.0},
|
6347 | "945": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6348 | "946": {"depth": 0.19444, "height": 0.69444, "italic": 0.03403, "skew": 0.0},
|
6349 | "947": {"depth": 0.19444, "height": 0.44444, "italic": 0.06389, "skew": 0.0},
|
6350 | "948": {"depth": 0.0, "height": 0.69444, "italic": 0.03819, "skew": 0.0},
|
6351 | "949": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6352 | "950": {"depth": 0.19444, "height": 0.69444, "italic": 0.06215, "skew": 0.0},
|
6353 | "951": {"depth": 0.19444, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6354 | "952": {"depth": 0.0, "height": 0.69444, "italic": 0.03194, "skew": 0.0},
|
6355 | "953": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6356 | "954": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6357 | "955": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6358 | "956": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6359 | "957": {"depth": 0.0, "height": 0.44444, "italic": 0.06898, "skew": 0.0},
|
6360 | "958": {"depth": 0.19444, "height": 0.69444, "italic": 0.03021, "skew": 0.0},
|
6361 | "959": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6362 | "960": {"depth": 0.0, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6363 | "961": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6364 | "962": {"depth": 0.09722, "height": 0.44444, "italic": 0.07917, "skew": 0.0},
|
6365 | "963": {"depth": 0.0, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6366 | "964": {"depth": 0.0, "height": 0.44444, "italic": 0.13472, "skew": 0.0},
|
6367 | "965": {"depth": 0.0, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6368 | "966": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6369 | "967": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6370 | "968": {"depth": 0.19444, "height": 0.69444, "italic": 0.03704, "skew": 0.0},
|
6371 | "969": {"depth": 0.0, "height": 0.44444, "italic": 0.03704, "skew": 0.0},
|
6372 | "977": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6373 | "981": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6374 | "982": {"depth": 0.0, "height": 0.44444, "italic": 0.03194, "skew": 0.0},
|
6375 | "1009": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6376 | "1013": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0}
|
6377 | },
|
6378 | "Math-Italic": {
|
6379 | "47": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6380 | "65": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.13889},
|
6381 | "66": {"depth": 0.0, "height": 0.68333, "italic": 0.05017, "skew": 0.08334},
|
6382 | "67": {"depth": 0.0, "height": 0.68333, "italic": 0.07153, "skew": 0.08334},
|
6383 | "68": {"depth": 0.0, "height": 0.68333, "italic": 0.02778, "skew": 0.05556},
|
6384 | "69": {"depth": 0.0, "height": 0.68333, "italic": 0.05764, "skew": 0.08334},
|
6385 | "70": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.08334},
|
6386 | "71": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.08334},
|
6387 | "72": {"depth": 0.0, "height": 0.68333, "italic": 0.08125, "skew": 0.05556},
|
6388 | "73": {"depth": 0.0, "height": 0.68333, "italic": 0.07847, "skew": 0.11111},
|
6389 | "74": {"depth": 0.0, "height": 0.68333, "italic": 0.09618, "skew": 0.16667},
|
6390 | "75": {"depth": 0.0, "height": 0.68333, "italic": 0.07153, "skew": 0.05556},
|
6391 | "76": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.02778},
|
6392 | "77": {"depth": 0.0, "height": 0.68333, "italic": 0.10903, "skew": 0.08334},
|
6393 | "78": {"depth": 0.0, "height": 0.68333, "italic": 0.10903, "skew": 0.08334},
|
6394 | "79": {"depth": 0.0, "height": 0.68333, "italic": 0.02778, "skew": 0.08334},
|
6395 | "80": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.08334},
|
6396 | "81": {"depth": 0.19444, "height": 0.68333, "italic": 0.0, "skew": 0.08334},
|
6397 | "82": {"depth": 0.0, "height": 0.68333, "italic": 0.00773, "skew": 0.08334},
|
6398 | "83": {"depth": 0.0, "height": 0.68333, "italic": 0.05764, "skew": 0.08334},
|
6399 | "84": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.08334},
|
6400 | "85": {"depth": 0.0, "height": 0.68333, "italic": 0.10903, "skew": 0.02778},
|
6401 | "86": {"depth": 0.0, "height": 0.68333, "italic": 0.22222, "skew": 0.0},
|
6402 | "87": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.0},
|
6403 | "88": {"depth": 0.0, "height": 0.68333, "italic": 0.07847, "skew": 0.08334},
|
6404 | "89": {"depth": 0.0, "height": 0.68333, "italic": 0.22222, "skew": 0.0},
|
6405 | "90": {"depth": 0.0, "height": 0.68333, "italic": 0.07153, "skew": 0.08334},
|
6406 | "97": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6407 | "98": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6408 | "99": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6409 | "100": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.16667},
|
6410 | "101": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6411 | "102": {"depth": 0.19444, "height": 0.69444, "italic": 0.10764, "skew": 0.16667},
|
6412 | "103": {"depth": 0.19444, "height": 0.43056, "italic": 0.03588, "skew": 0.02778},
|
6413 | "104": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6414 | "105": {"depth": 0.0, "height": 0.65952, "italic": 0.0, "skew": 0.0},
|
6415 | "106": {"depth": 0.19444, "height": 0.65952, "italic": 0.05724, "skew": 0.0},
|
6416 | "107": {"depth": 0.0, "height": 0.69444, "italic": 0.03148, "skew": 0.0},
|
6417 | "108": {"depth": 0.0, "height": 0.69444, "italic": 0.01968, "skew": 0.08334},
|
6418 | "109": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6419 | "110": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6420 | "111": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6421 | "112": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6422 | "113": {"depth": 0.19444, "height": 0.43056, "italic": 0.03588, "skew": 0.08334},
|
6423 | "114": {"depth": 0.0, "height": 0.43056, "italic": 0.02778, "skew": 0.05556},
|
6424 | "115": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6425 | "116": {"depth": 0.0, "height": 0.61508, "italic": 0.0, "skew": 0.08334},
|
6426 | "117": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.02778},
|
6427 | "118": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.02778},
|
6428 | "119": {"depth": 0.0, "height": 0.43056, "italic": 0.02691, "skew": 0.08334},
|
6429 | "120": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.02778},
|
6430 | "121": {"depth": 0.19444, "height": 0.43056, "italic": 0.03588, "skew": 0.05556},
|
6431 | "122": {"depth": 0.0, "height": 0.43056, "italic": 0.04398, "skew": 0.05556},
|
6432 | "915": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.08334},
|
6433 | "916": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.16667},
|
6434 | "920": {"depth": 0.0, "height": 0.68333, "italic": 0.02778, "skew": 0.08334},
|
6435 | "923": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.16667},
|
6436 | "926": {"depth": 0.0, "height": 0.68333, "italic": 0.07569, "skew": 0.08334},
|
6437 | "928": {"depth": 0.0, "height": 0.68333, "italic": 0.08125, "skew": 0.05556},
|
6438 | "931": {"depth": 0.0, "height": 0.68333, "italic": 0.05764, "skew": 0.08334},
|
6439 | "933": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.05556},
|
6440 | "934": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.08334},
|
6441 | "936": {"depth": 0.0, "height": 0.68333, "italic": 0.11, "skew": 0.05556},
|
6442 | "937": {"depth": 0.0, "height": 0.68333, "italic": 0.05017, "skew": 0.08334},
|
6443 | "945": {"depth": 0.0, "height": 0.43056, "italic": 0.0037, "skew": 0.02778},
|
6444 | "946": {"depth": 0.19444, "height": 0.69444, "italic": 0.05278, "skew": 0.08334},
|
6445 | "947": {"depth": 0.19444, "height": 0.43056, "italic": 0.05556, "skew": 0.0},
|
6446 | "948": {"depth": 0.0, "height": 0.69444, "italic": 0.03785, "skew": 0.05556},
|
6447 | "949": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6448 | "950": {"depth": 0.19444, "height": 0.69444, "italic": 0.07378, "skew": 0.08334},
|
6449 | "951": {"depth": 0.19444, "height": 0.43056, "italic": 0.03588, "skew": 0.05556},
|
6450 | "952": {"depth": 0.0, "height": 0.69444, "italic": 0.02778, "skew": 0.08334},
|
6451 | "953": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6452 | "954": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6453 | "955": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6454 | "956": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.02778},
|
6455 | "957": {"depth": 0.0, "height": 0.43056, "italic": 0.06366, "skew": 0.02778},
|
6456 | "958": {"depth": 0.19444, "height": 0.69444, "italic": 0.04601, "skew": 0.11111},
|
6457 | "959": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6458 | "960": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.0},
|
6459 | "961": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6460 | "962": {"depth": 0.09722, "height": 0.43056, "italic": 0.07986, "skew": 0.08334},
|
6461 | "963": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.0},
|
6462 | "964": {"depth": 0.0, "height": 0.43056, "italic": 0.1132, "skew": 0.02778},
|
6463 | "965": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.02778},
|
6464 | "966": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6465 | "967": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6466 | "968": {"depth": 0.19444, "height": 0.69444, "italic": 0.03588, "skew": 0.11111},
|
6467 | "969": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.0},
|
6468 | "977": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.08334},
|
6469 | "981": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.08334},
|
6470 | "982": {"depth": 0.0, "height": 0.43056, "italic": 0.02778, "skew": 0.0},
|
6471 | "1009": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6472 | "1013": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556}
|
6473 | },
|
6474 | "Math-Regular": {
|
6475 | "65": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.13889},
|
6476 | "66": {"depth": 0.0, "height": 0.68333, "italic": 0.05017, "skew": 0.08334},
|
6477 | "67": {"depth": 0.0, "height": 0.68333, "italic": 0.07153, "skew": 0.08334},
|
6478 | "68": {"depth": 0.0, "height": 0.68333, "italic": 0.02778, "skew": 0.05556},
|
6479 | "69": {"depth": 0.0, "height": 0.68333, "italic": 0.05764, "skew": 0.08334},
|
6480 | "70": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.08334},
|
6481 | "71": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.08334},
|
6482 | "72": {"depth": 0.0, "height": 0.68333, "italic": 0.08125, "skew": 0.05556},
|
6483 | "73": {"depth": 0.0, "height": 0.68333, "italic": 0.07847, "skew": 0.11111},
|
6484 | "74": {"depth": 0.0, "height": 0.68333, "italic": 0.09618, "skew": 0.16667},
|
6485 | "75": {"depth": 0.0, "height": 0.68333, "italic": 0.07153, "skew": 0.05556},
|
6486 | "76": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.02778},
|
6487 | "77": {"depth": 0.0, "height": 0.68333, "italic": 0.10903, "skew": 0.08334},
|
6488 | "78": {"depth": 0.0, "height": 0.68333, "italic": 0.10903, "skew": 0.08334},
|
6489 | "79": {"depth": 0.0, "height": 0.68333, "italic": 0.02778, "skew": 0.08334},
|
6490 | "80": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.08334},
|
6491 | "81": {"depth": 0.19444, "height": 0.68333, "italic": 0.0, "skew": 0.08334},
|
6492 | "82": {"depth": 0.0, "height": 0.68333, "italic": 0.00773, "skew": 0.08334},
|
6493 | "83": {"depth": 0.0, "height": 0.68333, "italic": 0.05764, "skew": 0.08334},
|
6494 | "84": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.08334},
|
6495 | "85": {"depth": 0.0, "height": 0.68333, "italic": 0.10903, "skew": 0.02778},
|
6496 | "86": {"depth": 0.0, "height": 0.68333, "italic": 0.22222, "skew": 0.0},
|
6497 | "87": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.0},
|
6498 | "88": {"depth": 0.0, "height": 0.68333, "italic": 0.07847, "skew": 0.08334},
|
6499 | "89": {"depth": 0.0, "height": 0.68333, "italic": 0.22222, "skew": 0.0},
|
6500 | "90": {"depth": 0.0, "height": 0.68333, "italic": 0.07153, "skew": 0.08334},
|
6501 | "97": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6502 | "98": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6503 | "99": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6504 | "100": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.16667},
|
6505 | "101": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6506 | "102": {"depth": 0.19444, "height": 0.69444, "italic": 0.10764, "skew": 0.16667},
|
6507 | "103": {"depth": 0.19444, "height": 0.43056, "italic": 0.03588, "skew": 0.02778},
|
6508 | "104": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6509 | "105": {"depth": 0.0, "height": 0.65952, "italic": 0.0, "skew": 0.0},
|
6510 | "106": {"depth": 0.19444, "height": 0.65952, "italic": 0.05724, "skew": 0.0},
|
6511 | "107": {"depth": 0.0, "height": 0.69444, "italic": 0.03148, "skew": 0.0},
|
6512 | "108": {"depth": 0.0, "height": 0.69444, "italic": 0.01968, "skew": 0.08334},
|
6513 | "109": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6514 | "110": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6515 | "111": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6516 | "112": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6517 | "113": {"depth": 0.19444, "height": 0.43056, "italic": 0.03588, "skew": 0.08334},
|
6518 | "114": {"depth": 0.0, "height": 0.43056, "italic": 0.02778, "skew": 0.05556},
|
6519 | "115": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6520 | "116": {"depth": 0.0, "height": 0.61508, "italic": 0.0, "skew": 0.08334},
|
6521 | "117": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.02778},
|
6522 | "118": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.02778},
|
6523 | "119": {"depth": 0.0, "height": 0.43056, "italic": 0.02691, "skew": 0.08334},
|
6524 | "120": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.02778},
|
6525 | "121": {"depth": 0.19444, "height": 0.43056, "italic": 0.03588, "skew": 0.05556},
|
6526 | "122": {"depth": 0.0, "height": 0.43056, "italic": 0.04398, "skew": 0.05556},
|
6527 | "915": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.08334},
|
6528 | "916": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.16667},
|
6529 | "920": {"depth": 0.0, "height": 0.68333, "italic": 0.02778, "skew": 0.08334},
|
6530 | "923": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.16667},
|
6531 | "926": {"depth": 0.0, "height": 0.68333, "italic": 0.07569, "skew": 0.08334},
|
6532 | "928": {"depth": 0.0, "height": 0.68333, "italic": 0.08125, "skew": 0.05556},
|
6533 | "931": {"depth": 0.0, "height": 0.68333, "italic": 0.05764, "skew": 0.08334},
|
6534 | "933": {"depth": 0.0, "height": 0.68333, "italic": 0.13889, "skew": 0.05556},
|
6535 | "934": {"depth": 0.0, "height": 0.68333, "italic": 0.0, "skew": 0.08334},
|
6536 | "936": {"depth": 0.0, "height": 0.68333, "italic": 0.11, "skew": 0.05556},
|
6537 | "937": {"depth": 0.0, "height": 0.68333, "italic": 0.05017, "skew": 0.08334},
|
6538 | "945": {"depth": 0.0, "height": 0.43056, "italic": 0.0037, "skew": 0.02778},
|
6539 | "946": {"depth": 0.19444, "height": 0.69444, "italic": 0.05278, "skew": 0.08334},
|
6540 | "947": {"depth": 0.19444, "height": 0.43056, "italic": 0.05556, "skew": 0.0},
|
6541 | "948": {"depth": 0.0, "height": 0.69444, "italic": 0.03785, "skew": 0.05556},
|
6542 | "949": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6543 | "950": {"depth": 0.19444, "height": 0.69444, "italic": 0.07378, "skew": 0.08334},
|
6544 | "951": {"depth": 0.19444, "height": 0.43056, "italic": 0.03588, "skew": 0.05556},
|
6545 | "952": {"depth": 0.0, "height": 0.69444, "italic": 0.02778, "skew": 0.08334},
|
6546 | "953": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6547 | "954": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6548 | "955": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6549 | "956": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.02778},
|
6550 | "957": {"depth": 0.0, "height": 0.43056, "italic": 0.06366, "skew": 0.02778},
|
6551 | "958": {"depth": 0.19444, "height": 0.69444, "italic": 0.04601, "skew": 0.11111},
|
6552 | "959": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6553 | "960": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.0},
|
6554 | "961": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6555 | "962": {"depth": 0.09722, "height": 0.43056, "italic": 0.07986, "skew": 0.08334},
|
6556 | "963": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.0},
|
6557 | "964": {"depth": 0.0, "height": 0.43056, "italic": 0.1132, "skew": 0.02778},
|
6558 | "965": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.02778},
|
6559 | "966": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6560 | "967": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.05556},
|
6561 | "968": {"depth": 0.19444, "height": 0.69444, "italic": 0.03588, "skew": 0.11111},
|
6562 | "969": {"depth": 0.0, "height": 0.43056, "italic": 0.03588, "skew": 0.0},
|
6563 | "977": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.08334},
|
6564 | "981": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.08334},
|
6565 | "982": {"depth": 0.0, "height": 0.43056, "italic": 0.02778, "skew": 0.0},
|
6566 | "1009": {"depth": 0.19444, "height": 0.43056, "italic": 0.0, "skew": 0.08334},
|
6567 | "1013": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.05556}
|
6568 | },
|
6569 | "SansSerif-Regular": {
|
6570 | "33": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6571 | "34": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6572 | "35": {"depth": 0.19444, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6573 | "36": {"depth": 0.05556, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6574 | "37": {"depth": 0.05556, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6575 | "38": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6576 | "39": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6577 | "40": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6578 | "41": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6579 | "42": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6580 | "43": {"depth": 0.08333, "height": 0.58333, "italic": 0.0, "skew": 0.0},
|
6581 | "44": {"depth": 0.125, "height": 0.08333, "italic": 0.0, "skew": 0.0},
|
6582 | "45": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6583 | "46": {"depth": 0.0, "height": 0.08333, "italic": 0.0, "skew": 0.0},
|
6584 | "47": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6585 | "48": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6586 | "49": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6587 | "50": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6588 | "51": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6589 | "52": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6590 | "53": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6591 | "54": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6592 | "55": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6593 | "56": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6594 | "57": {"depth": 0.0, "height": 0.65556, "italic": 0.0, "skew": 0.0},
|
6595 | "58": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6596 | "59": {"depth": 0.125, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6597 | "61": {"depth": -0.13, "height": 0.37, "italic": 0.0, "skew": 0.0},
|
6598 | "63": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6599 | "64": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6600 | "65": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6601 | "66": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6602 | "67": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6603 | "68": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6604 | "69": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6605 | "70": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6606 | "71": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6607 | "72": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6608 | "73": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6609 | "74": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6610 | "75": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6611 | "76": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6612 | "77": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6613 | "78": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6614 | "79": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6615 | "80": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6616 | "81": {"depth": 0.125, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6617 | "82": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6618 | "83": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6619 | "84": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6620 | "85": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6621 | "86": {"depth": 0.0, "height": 0.69444, "italic": 0.01389, "skew": 0.0},
|
6622 | "87": {"depth": 0.0, "height": 0.69444, "italic": 0.01389, "skew": 0.0},
|
6623 | "88": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6624 | "89": {"depth": 0.0, "height": 0.69444, "italic": 0.025, "skew": 0.0},
|
6625 | "90": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6626 | "91": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6627 | "93": {"depth": 0.25, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6628 | "94": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6629 | "95": {"depth": 0.35, "height": 0.09444, "italic": 0.02778, "skew": 0.0},
|
6630 | "97": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6631 | "98": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6632 | "99": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6633 | "100": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6634 | "101": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6635 | "102": {"depth": 0.0, "height": 0.69444, "italic": 0.06944, "skew": 0.0},
|
6636 | "103": {"depth": 0.19444, "height": 0.44444, "italic": 0.01389, "skew": 0.0},
|
6637 | "104": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6638 | "105": {"depth": 0.0, "height": 0.67937, "italic": 0.0, "skew": 0.0},
|
6639 | "106": {"depth": 0.19444, "height": 0.67937, "italic": 0.0, "skew": 0.0},
|
6640 | "107": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6641 | "108": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6642 | "109": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6643 | "110": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6644 | "111": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6645 | "112": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6646 | "113": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6647 | "114": {"depth": 0.0, "height": 0.44444, "italic": 0.01389, "skew": 0.0},
|
6648 | "115": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6649 | "116": {"depth": 0.0, "height": 0.57143, "italic": 0.0, "skew": 0.0},
|
6650 | "117": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6651 | "118": {"depth": 0.0, "height": 0.44444, "italic": 0.01389, "skew": 0.0},
|
6652 | "119": {"depth": 0.0, "height": 0.44444, "italic": 0.01389, "skew": 0.0},
|
6653 | "120": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6654 | "121": {"depth": 0.19444, "height": 0.44444, "italic": 0.01389, "skew": 0.0},
|
6655 | "122": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6656 | "126": {"depth": 0.35, "height": 0.32659, "italic": 0.0, "skew": 0.0},
|
6657 | "305": {"depth": 0.0, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6658 | "567": {"depth": 0.19444, "height": 0.44444, "italic": 0.0, "skew": 0.0},
|
6659 | "768": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6660 | "769": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6661 | "770": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6662 | "771": {"depth": 0.0, "height": 0.67659, "italic": 0.0, "skew": 0.0},
|
6663 | "772": {"depth": 0.0, "height": 0.60889, "italic": 0.0, "skew": 0.0},
|
6664 | "774": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6665 | "775": {"depth": 0.0, "height": 0.67937, "italic": 0.0, "skew": 0.0},
|
6666 | "776": {"depth": 0.0, "height": 0.67937, "italic": 0.0, "skew": 0.0},
|
6667 | "778": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6668 | "779": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6669 | "780": {"depth": 0.0, "height": 0.63194, "italic": 0.0, "skew": 0.0},
|
6670 | "915": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6671 | "916": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6672 | "920": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6673 | "923": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6674 | "926": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6675 | "928": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6676 | "931": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6677 | "933": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6678 | "934": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6679 | "936": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6680 | "937": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6681 | "8211": {"depth": 0.0, "height": 0.44444, "italic": 0.02778, "skew": 0.0},
|
6682 | "8212": {"depth": 0.0, "height": 0.44444, "italic": 0.02778, "skew": 0.0},
|
6683 | "8216": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6684 | "8217": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6685 | "8220": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6686 | "8221": {"depth": 0.0, "height": 0.69444, "italic": 0.0, "skew": 0.0}
|
6687 | },
|
6688 | "Script-Regular": {
|
6689 | "65": {"depth": 0.0, "height": 0.7, "italic": 0.22925, "skew": 0.0},
|
6690 | "66": {"depth": 0.0, "height": 0.7, "italic": 0.04087, "skew": 0.0},
|
6691 | "67": {"depth": 0.0, "height": 0.7, "italic": 0.1689, "skew": 0.0},
|
6692 | "68": {"depth": 0.0, "height": 0.7, "italic": 0.09371, "skew": 0.0},
|
6693 | "69": {"depth": 0.0, "height": 0.7, "italic": 0.18583, "skew": 0.0},
|
6694 | "70": {"depth": 0.0, "height": 0.7, "italic": 0.13634, "skew": 0.0},
|
6695 | "71": {"depth": 0.0, "height": 0.7, "italic": 0.17322, "skew": 0.0},
|
6696 | "72": {"depth": 0.0, "height": 0.7, "italic": 0.29694, "skew": 0.0},
|
6697 | "73": {"depth": 0.0, "height": 0.7, "italic": 0.19189, "skew": 0.0},
|
6698 | "74": {"depth": 0.27778, "height": 0.7, "italic": 0.19189, "skew": 0.0},
|
6699 | "75": {"depth": 0.0, "height": 0.7, "italic": 0.31259, "skew": 0.0},
|
6700 | "76": {"depth": 0.0, "height": 0.7, "italic": 0.19189, "skew": 0.0},
|
6701 | "77": {"depth": 0.0, "height": 0.7, "italic": 0.15981, "skew": 0.0},
|
6702 | "78": {"depth": 0.0, "height": 0.7, "italic": 0.3525, "skew": 0.0},
|
6703 | "79": {"depth": 0.0, "height": 0.7, "italic": 0.08078, "skew": 0.0},
|
6704 | "80": {"depth": 0.0, "height": 0.7, "italic": 0.08078, "skew": 0.0},
|
6705 | "81": {"depth": 0.0, "height": 0.7, "italic": 0.03305, "skew": 0.0},
|
6706 | "82": {"depth": 0.0, "height": 0.7, "italic": 0.06259, "skew": 0.0},
|
6707 | "83": {"depth": 0.0, "height": 0.7, "italic": 0.19189, "skew": 0.0},
|
6708 | "84": {"depth": 0.0, "height": 0.7, "italic": 0.29087, "skew": 0.0},
|
6709 | "85": {"depth": 0.0, "height": 0.7, "italic": 0.25815, "skew": 0.0},
|
6710 | "86": {"depth": 0.0, "height": 0.7, "italic": 0.27523, "skew": 0.0},
|
6711 | "87": {"depth": 0.0, "height": 0.7, "italic": 0.27523, "skew": 0.0},
|
6712 | "88": {"depth": 0.0, "height": 0.7, "italic": 0.26006, "skew": 0.0},
|
6713 | "89": {"depth": 0.0, "height": 0.7, "italic": 0.2939, "skew": 0.0},
|
6714 | "90": {"depth": 0.0, "height": 0.7, "italic": 0.24037, "skew": 0.0}
|
6715 | },
|
6716 | "Size1-Regular": {
|
6717 | "40": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6718 | "41": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6719 | "47": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6720 | "91": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6721 | "92": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6722 | "93": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6723 | "123": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6724 | "125": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6725 | "710": {"depth": 0.0, "height": 0.72222, "italic": 0.0, "skew": 0.0},
|
6726 | "732": {"depth": 0.0, "height": 0.72222, "italic": 0.0, "skew": 0.0},
|
6727 | "770": {"depth": 0.0, "height": 0.72222, "italic": 0.0, "skew": 0.0},
|
6728 | "771": {"depth": 0.0, "height": 0.72222, "italic": 0.0, "skew": 0.0},
|
6729 | "8214": {"depth": -0.00099, "height": 0.601, "italic": 0.0, "skew": 0.0},
|
6730 | "8593": {"depth": 1e-05, "height": 0.6, "italic": 0.0, "skew": 0.0},
|
6731 | "8595": {"depth": 1e-05, "height": 0.6, "italic": 0.0, "skew": 0.0},
|
6732 | "8657": {"depth": 1e-05, "height": 0.6, "italic": 0.0, "skew": 0.0},
|
6733 | "8659": {"depth": 1e-05, "height": 0.6, "italic": 0.0, "skew": 0.0},
|
6734 | "8719": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6735 | "8720": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6736 | "8721": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6737 | "8730": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6738 | "8739": {"depth": -0.00599, "height": 0.606, "italic": 0.0, "skew": 0.0},
|
6739 | "8741": {"depth": -0.00599, "height": 0.606, "italic": 0.0, "skew": 0.0},
|
6740 | "8747": {"depth": 0.30612, "height": 0.805, "italic": 0.19445, "skew": 0.0},
|
6741 | "8748": {"depth": 0.306, "height": 0.805, "italic": 0.19445, "skew": 0.0},
|
6742 | "8749": {"depth": 0.306, "height": 0.805, "italic": 0.19445, "skew": 0.0},
|
6743 | "8750": {"depth": 0.30612, "height": 0.805, "italic": 0.19445, "skew": 0.0},
|
6744 | "8896": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6745 | "8897": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6746 | "8898": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6747 | "8899": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6748 | "8968": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6749 | "8969": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6750 | "8970": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6751 | "8971": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6752 | "9168": {"depth": -0.00099, "height": 0.601, "italic": 0.0, "skew": 0.0},
|
6753 | "10216": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6754 | "10217": {"depth": 0.35001, "height": 0.85, "italic": 0.0, "skew": 0.0},
|
6755 | "10752": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6756 | "10753": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6757 | "10754": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6758 | "10756": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6759 | "10758": {"depth": 0.25001, "height": 0.75, "italic": 0.0, "skew": 0.0}
|
6760 | },
|
6761 | "Size2-Regular": {
|
6762 | "40": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6763 | "41": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6764 | "47": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6765 | "91": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6766 | "92": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6767 | "93": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6768 | "123": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6769 | "125": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6770 | "710": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6771 | "732": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6772 | "770": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6773 | "771": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6774 | "8719": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6775 | "8720": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6776 | "8721": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6777 | "8730": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6778 | "8747": {"depth": 0.86225, "height": 1.36, "italic": 0.44445, "skew": 0.0},
|
6779 | "8748": {"depth": 0.862, "height": 1.36, "italic": 0.44445, "skew": 0.0},
|
6780 | "8749": {"depth": 0.862, "height": 1.36, "italic": 0.44445, "skew": 0.0},
|
6781 | "8750": {"depth": 0.86225, "height": 1.36, "italic": 0.44445, "skew": 0.0},
|
6782 | "8896": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6783 | "8897": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6784 | "8898": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6785 | "8899": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6786 | "8968": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6787 | "8969": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6788 | "8970": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6789 | "8971": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6790 | "10216": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6791 | "10217": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6792 | "10752": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6793 | "10753": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6794 | "10754": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6795 | "10756": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0},
|
6796 | "10758": {"depth": 0.55001, "height": 1.05, "italic": 0.0, "skew": 0.0}
|
6797 | },
|
6798 | "Size3-Regular": {
|
6799 | "40": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6800 | "41": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6801 | "47": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6802 | "91": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6803 | "92": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6804 | "93": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6805 | "123": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6806 | "125": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6807 | "710": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6808 | "732": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6809 | "770": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6810 | "771": {"depth": 0.0, "height": 0.75, "italic": 0.0, "skew": 0.0},
|
6811 | "8730": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6812 | "8968": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6813 | "8969": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6814 | "8970": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6815 | "8971": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6816 | "10216": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0},
|
6817 | "10217": {"depth": 0.95003, "height": 1.45, "italic": 0.0, "skew": 0.0}
|
6818 | },
|
6819 | "Size4-Regular": {
|
6820 | "40": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6821 | "41": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6822 | "47": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6823 | "91": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6824 | "92": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6825 | "93": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6826 | "123": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6827 | "125": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6828 | "710": {"depth": 0.0, "height": 0.825, "italic": 0.0, "skew": 0.0},
|
6829 | "732": {"depth": 0.0, "height": 0.825, "italic": 0.0, "skew": 0.0},
|
6830 | "770": {"depth": 0.0, "height": 0.825, "italic": 0.0, "skew": 0.0},
|
6831 | "771": {"depth": 0.0, "height": 0.825, "italic": 0.0, "skew": 0.0},
|
6832 | "8730": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6833 | "8968": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6834 | "8969": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6835 | "8970": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6836 | "8971": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6837 | "9115": {"depth": 0.64502, "height": 1.155, "italic": 0.0, "skew": 0.0},
|
6838 | "9116": {"depth": 1e-05, "height": 0.6, "italic": 0.0, "skew": 0.0},
|
6839 | "9117": {"depth": 0.64502, "height": 1.155, "italic": 0.0, "skew": 0.0},
|
6840 | "9118": {"depth": 0.64502, "height": 1.155, "italic": 0.0, "skew": 0.0},
|
6841 | "9119": {"depth": 1e-05, "height": 0.6, "italic": 0.0, "skew": 0.0},
|
6842 | "9120": {"depth": 0.64502, "height": 1.155, "italic": 0.0, "skew": 0.0},
|
6843 | "9121": {"depth": 0.64502, "height": 1.155, "italic": 0.0, "skew": 0.0},
|
6844 | "9122": {"depth": -0.00099, "height": 0.601, "italic": 0.0, "skew": 0.0},
|
6845 | "9123": {"depth": 0.64502, "height": 1.155, "italic": 0.0, "skew": 0.0},
|
6846 | "9124": {"depth": 0.64502, "height": 1.155, "italic": 0.0, "skew": 0.0},
|
6847 | "9125": {"depth": -0.00099, "height": 0.601, "italic": 0.0, "skew": 0.0},
|
6848 | "9126": {"depth": 0.64502, "height": 1.155, "italic": 0.0, "skew": 0.0},
|
6849 | "9127": {"depth": 1e-05, "height": 0.9, "italic": 0.0, "skew": 0.0},
|
6850 | "9128": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6851 | "9129": {"depth": 0.90001, "height": 0.0, "italic": 0.0, "skew": 0.0},
|
6852 | "9130": {"depth": 0.0, "height": 0.3, "italic": 0.0, "skew": 0.0},
|
6853 | "9131": {"depth": 1e-05, "height": 0.9, "italic": 0.0, "skew": 0.0},
|
6854 | "9132": {"depth": 0.65002, "height": 1.15, "italic": 0.0, "skew": 0.0},
|
6855 | "9133": {"depth": 0.90001, "height": 0.0, "italic": 0.0, "skew": 0.0},
|
6856 | "9143": {"depth": 0.88502, "height": 0.915, "italic": 0.0, "skew": 0.0},
|
6857 | "10216": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6858 | "10217": {"depth": 1.25003, "height": 1.75, "italic": 0.0, "skew": 0.0},
|
6859 | "57344": {"depth": -0.00499, "height": 0.605, "italic": 0.0, "skew": 0.0},
|
6860 | "57345": {"depth": -0.00499, "height": 0.605, "italic": 0.0, "skew": 0.0},
|
6861 | "57680": {"depth": 0.0, "height": 0.12, "italic": 0.0, "skew": 0.0},
|
6862 | "57681": {"depth": 0.0, "height": 0.12, "italic": 0.0, "skew": 0.0},
|
6863 | "57682": {"depth": 0.0, "height": 0.12, "italic": 0.0, "skew": 0.0},
|
6864 | "57683": {"depth": 0.0, "height": 0.12, "italic": 0.0, "skew": 0.0}
|
6865 | },
|
6866 | "Typewriter-Regular": {
|
6867 | "33": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6868 | "34": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6869 | "35": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6870 | "36": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6871 | "37": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6872 | "38": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6873 | "39": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6874 | "40": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6875 | "41": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6876 | "42": {"depth": 0.0, "height": 0.52083, "italic": 0.0, "skew": 0.0},
|
6877 | "43": {"depth": -0.08056, "height": 0.53055, "italic": 0.0, "skew": 0.0},
|
6878 | "44": {"depth": 0.13889, "height": 0.125, "italic": 0.0, "skew": 0.0},
|
6879 | "45": {"depth": -0.08056, "height": 0.53055, "italic": 0.0, "skew": 0.0},
|
6880 | "46": {"depth": 0.0, "height": 0.125, "italic": 0.0, "skew": 0.0},
|
6881 | "47": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6882 | "48": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6883 | "49": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6884 | "50": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6885 | "51": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6886 | "52": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6887 | "53": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6888 | "54": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6889 | "55": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6890 | "56": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6891 | "57": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6892 | "58": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6893 | "59": {"depth": 0.13889, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6894 | "60": {"depth": -0.05556, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6895 | "61": {"depth": -0.19549, "height": 0.41562, "italic": 0.0, "skew": 0.0},
|
6896 | "62": {"depth": -0.05556, "height": 0.55556, "italic": 0.0, "skew": 0.0},
|
6897 | "63": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6898 | "64": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6899 | "65": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6900 | "66": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6901 | "67": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6902 | "68": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6903 | "69": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6904 | "70": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6905 | "71": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6906 | "72": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6907 | "73": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6908 | "74": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6909 | "75": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6910 | "76": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6911 | "77": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6912 | "78": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6913 | "79": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6914 | "80": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6915 | "81": {"depth": 0.13889, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6916 | "82": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6917 | "83": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6918 | "84": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6919 | "85": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6920 | "86": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6921 | "87": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6922 | "88": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6923 | "89": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6924 | "90": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6925 | "91": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6926 | "92": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6927 | "93": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6928 | "94": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6929 | "95": {"depth": 0.09514, "height": 0.0, "italic": 0.0, "skew": 0.0},
|
6930 | "96": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6931 | "97": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6932 | "98": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6933 | "99": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6934 | "100": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6935 | "101": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6936 | "102": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6937 | "103": {"depth": 0.22222, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6938 | "104": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6939 | "105": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6940 | "106": {"depth": 0.22222, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6941 | "107": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6942 | "108": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6943 | "109": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6944 | "110": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6945 | "111": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6946 | "112": {"depth": 0.22222, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6947 | "113": {"depth": 0.22222, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6948 | "114": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6949 | "115": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6950 | "116": {"depth": 0.0, "height": 0.55358, "italic": 0.0, "skew": 0.0},
|
6951 | "117": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6952 | "118": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6953 | "119": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6954 | "120": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6955 | "121": {"depth": 0.22222, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6956 | "122": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6957 | "123": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6958 | "124": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6959 | "125": {"depth": 0.08333, "height": 0.69444, "italic": 0.0, "skew": 0.0},
|
6960 | "126": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6961 | "127": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6962 | "305": {"depth": 0.0, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6963 | "567": {"depth": 0.22222, "height": 0.43056, "italic": 0.0, "skew": 0.0},
|
6964 | "768": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6965 | "769": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6966 | "770": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6967 | "771": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6968 | "772": {"depth": 0.0, "height": 0.56555, "italic": 0.0, "skew": 0.0},
|
6969 | "774": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6970 | "776": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6971 | "778": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6972 | "780": {"depth": 0.0, "height": 0.56597, "italic": 0.0, "skew": 0.0},
|
6973 | "915": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6974 | "916": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6975 | "920": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6976 | "923": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6977 | "926": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6978 | "928": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6979 | "931": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6980 | "933": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6981 | "934": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6982 | "936": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6983 | "937": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6984 | "2018": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6985 | "2019": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
6986 | "8242": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0}
|
6987 | }};
|
6988 |
|
6989 | },{}],20:[function(require,module,exports){
|
6990 | var utils = require("./utils");
|
6991 | var ParseError = require("./ParseError");
|
6992 |
|
6993 | // This file contains a list of functions that we parse. The functions map
|
6994 | // contains the following data:
|
6995 |
|
6996 | /*
|
6997 | * Keys are the name of the functions to parse
|
6998 | * The data contains the following keys:
|
6999 | * - numArgs: The number of arguments the function takes.
|
7000 | * - argTypes: (optional) An array corresponding to each argument of the
|
7001 | * function, giving the type of argument that should be parsed. Its
|
7002 | * length should be equal to `numArgs + numOptionalArgs`. Valid
|
7003 | * types:
|
7004 | * - "size": A size-like thing, such as "1em" or "5ex"
|
7005 | * - "color": An html color, like "#abc" or "blue"
|
7006 | * - "original": The same type as the environment that the
|
7007 | * function being parsed is in (e.g. used for the
|
7008 | * bodies of functions like \color where the first
|
7009 | * argument is special and the second argument is
|
7010 | * parsed normally)
|
7011 | * Other possible types (probably shouldn't be used)
|
7012 | * - "text": Text-like (e.g. \text)
|
7013 | * - "math": Normal math
|
7014 | * If undefined, this will be treated as an appropriate length
|
7015 | * array of "original" strings
|
7016 | * - greediness: (optional) The greediness of the function to use ungrouped
|
7017 | * arguments.
|
7018 | *
|
7019 | * E.g. if you have an expression
|
7020 | * \sqrt \frac 1 2
|
7021 | * since \frac has greediness=2 vs \sqrt's greediness=1, \frac
|
7022 | * will use the two arguments '1' and '2' as its two arguments,
|
7023 | * then that whole function will be used as the argument to
|
7024 | * \sqrt. On the other hand, the expressions
|
7025 | * \frac \frac 1 2 3
|
7026 | * and
|
7027 | * \frac \sqrt 1 2
|
7028 | * will fail because \frac and \frac have equal greediness
|
7029 | * and \sqrt has a lower greediness than \frac respectively. To
|
7030 | * make these parse, we would have to change them to:
|
7031 | * \frac {\frac 1 2} 3
|
7032 | * and
|
7033 | * \frac {\sqrt 1} 2
|
7034 | *
|
7035 | * The default value is `1`
|
7036 | * - allowedInText: (optional) Whether or not the function is allowed inside
|
7037 | * text mode (default false)
|
7038 | * - numOptionalArgs: (optional) The number of optional arguments the function
|
7039 | * should parse. If the optional arguments aren't found,
|
7040 | * `null` will be passed to the handler in their place.
|
7041 | * (default 0)
|
7042 | * - handler: The function that is called to handle this function and its
|
7043 | * arguments. The arguments are:
|
7044 | * - func: the text of the function
|
7045 | * - [args]: the next arguments are the arguments to the function,
|
7046 | * of which there are numArgs of them
|
7047 | * - positions: the positions in the overall string of the function
|
7048 | * and the arguments. Should only be used to produce
|
7049 | * error messages
|
7050 | * The function should return an object with the following keys:
|
7051 | * - type: The type of element that this is. This is then used in
|
7052 | * buildHTML/buildMathML to determine which function
|
7053 | * should be called to build this node into a DOM node
|
7054 | * Any other data can be added to the object, which will be passed
|
7055 | * in to the function in buildHTML/buildMathML as `group.value`.
|
7056 | */
|
7057 |
|
7058 | var functions = {
|
7059 | // A normal square root
|
7060 | "\\sqrt": {
|
7061 | numArgs: 1,
|
7062 | numOptionalArgs: 1,
|
7063 | handler: function(func, index, body, positions) {
|
7064 | return {
|
7065 | type: "sqrt",
|
7066 | body: body,
|
7067 | index: index
|
7068 | };
|
7069 | }
|
7070 | },
|
7071 |
|
7072 | // Some non-mathy text
|
7073 | "\\text": {
|
7074 | numArgs: 1,
|
7075 | argTypes: ["text"],
|
7076 | greediness: 2,
|
7077 | handler: function(func, body) {
|
7078 | // Since the corresponding buildHTML/buildMathML function expects a
|
7079 | // list of elements, we normalize for different kinds of arguments
|
7080 | // TODO(emily): maybe this should be done somewhere else
|
7081 | var inner;
|
7082 | if (body.type === "ordgroup") {
|
7083 | inner = body.value;
|
7084 | } else {
|
7085 | inner = [body];
|
7086 | }
|
7087 |
|
7088 | return {
|
7089 | type: "text",
|
7090 | body: inner
|
7091 | };
|
7092 | }
|
7093 | },
|
7094 |
|
7095 | // A two-argument custom color
|
7096 | "\\color": {
|
7097 | numArgs: 2,
|
7098 | allowedInText: true,
|
7099 | greediness: 3,
|
7100 | argTypes: ["color", "original"],
|
7101 | handler: function(func, color, body) {
|
7102 | // Normalize the different kinds of bodies (see \text above)
|
7103 | var inner;
|
7104 | if (body.type === "ordgroup") {
|
7105 | inner = body.value;
|
7106 | } else {
|
7107 | inner = [body];
|
7108 | }
|
7109 |
|
7110 | return {
|
7111 | type: "color",
|
7112 | color: color.value,
|
7113 | value: inner
|
7114 | };
|
7115 | }
|
7116 | },
|
7117 |
|
7118 | // An overline
|
7119 | "\\overline": {
|
7120 | numArgs: 1,
|
7121 | handler: function(func, body) {
|
7122 | return {
|
7123 | type: "overline",
|
7124 | body: body
|
7125 | };
|
7126 | }
|
7127 | },
|
7128 |
|
7129 | // A box of the width and height
|
7130 | "\\rule": {
|
7131 | numArgs: 2,
|
7132 | numOptionalArgs: 1,
|
7133 | argTypes: ["size", "size", "size"],
|
7134 | handler: function(func, shift, width, height) {
|
7135 | return {
|
7136 | type: "rule",
|
7137 | shift: shift && shift.value,
|
7138 | width: width.value,
|
7139 | height: height.value
|
7140 | };
|
7141 | }
|
7142 | },
|
7143 |
|
7144 | // A KaTeX logo
|
7145 | "\\KaTeX": {
|
7146 | numArgs: 0,
|
7147 | handler: function(func) {
|
7148 | return {
|
7149 | type: "katex"
|
7150 | };
|
7151 | }
|
7152 | },
|
7153 |
|
7154 | "\\phantom": {
|
7155 | numArgs: 1,
|
7156 | handler: function(func, body) {
|
7157 | var inner;
|
7158 | if (body.type === "ordgroup") {
|
7159 | inner = body.value;
|
7160 | } else {
|
7161 | inner = [body];
|
7162 | }
|
7163 |
|
7164 | return {
|
7165 | type: "phantom",
|
7166 | value: inner
|
7167 | };
|
7168 | }
|
7169 | }
|
7170 | };
|
7171 |
|
7172 | // Extra data needed for the delimiter handler down below
|
7173 | var delimiterSizes = {
|
7174 | "\\bigl" : {type: "open", size: 1},
|
7175 | "\\Bigl" : {type: "open", size: 2},
|
7176 | "\\biggl": {type: "open", size: 3},
|
7177 | "\\Biggl": {type: "open", size: 4},
|
7178 | "\\bigr" : {type: "close", size: 1},
|
7179 | "\\Bigr" : {type: "close", size: 2},
|
7180 | "\\biggr": {type: "close", size: 3},
|
7181 | "\\Biggr": {type: "close", size: 4},
|
7182 | "\\bigm" : {type: "rel", size: 1},
|
7183 | "\\Bigm" : {type: "rel", size: 2},
|
7184 | "\\biggm": {type: "rel", size: 3},
|
7185 | "\\Biggm": {type: "rel", size: 4},
|
7186 | "\\big" : {type: "textord", size: 1},
|
7187 | "\\Big" : {type: "textord", size: 2},
|
7188 | "\\bigg" : {type: "textord", size: 3},
|
7189 | "\\Bigg" : {type: "textord", size: 4}
|
7190 | };
|
7191 |
|
7192 | var delimiters = [
|
7193 | "(", ")", "[", "\\lbrack", "]", "\\rbrack",
|
7194 | "\\{", "\\lbrace", "\\}", "\\rbrace",
|
7195 | "\\lfloor", "\\rfloor", "\\lceil", "\\rceil",
|
7196 | "<", ">", "\\langle", "\\rangle",
|
7197 | "\\lvert", "\\rvert", "\\lVert", "\\rVert",
|
7198 | "\\lgroup", "\\rgroup", "\\lmoustache", "\\rmoustache",
|
7199 | "/", "\\backslash",
|
7200 | "|", "\\vert", "\\|", "\\Vert",
|
7201 | "\\uparrow", "\\Uparrow",
|
7202 | "\\downarrow", "\\Downarrow",
|
7203 | "\\updownarrow", "\\Updownarrow",
|
7204 | "."
|
7205 | ];
|
7206 |
|
7207 | var fontAliases = {
|
7208 | "\\Bbb": "\\mathbb",
|
7209 | "\\bold": "\\mathbf",
|
7210 | "\\frak": "\\mathfrak"
|
7211 | };
|
7212 |
|
7213 | /*
|
7214 | * This is a list of functions which each have the same function but have
|
7215 | * different names so that we don't have to duplicate the data a bunch of times.
|
7216 | * Each element in the list is an object with the following keys:
|
7217 | * - funcs: A list of function names to be associated with the data
|
7218 | * - data: An objecty with the same data as in each value of the `function`
|
7219 | * table above
|
7220 | */
|
7221 | var duplicatedFunctions = [
|
7222 | // Single-argument color functions
|
7223 | {
|
7224 | funcs: [
|
7225 | "\\blue", "\\orange", "\\pink", "\\red",
|
7226 | "\\green", "\\gray", "\\purple",
|
7227 | "\\blueA", "\\blueB", "\\blueC", "\\blueD", "\\blueE",
|
7228 | "\\tealA", "\\tealB", "\\tealC", "\\tealD", "\\tealE",
|
7229 | "\\greenA", "\\greenB", "\\greenC", "\\greenD", "\\greenE",
|
7230 | "\\goldA", "\\goldB", "\\goldC", "\\goldD", "\\goldE",
|
7231 | "\\redA", "\\redB", "\\redC", "\\redD", "\\redE",
|
7232 | "\\maroonA", "\\maroonB", "\\maroonC", "\\maroonD", "\\maroonE",
|
7233 | "\\purpleA", "\\purpleB", "\\purpleC", "\\purpleD", "\\purpleE",
|
7234 | "\\mintA", "\\mintB", "\\mintC",
|
7235 | "\\grayA", "\\grayB", "\\grayC", "\\grayD", "\\grayE",
|
7236 | "\\grayF", "\\grayG", "\\grayH", "\\grayI",
|
7237 | "\\kaBlue", "\\kaGreen"
|
7238 | ],
|
7239 | data: {
|
7240 | numArgs: 1,
|
7241 | allowedInText: true,
|
7242 | greediness: 3,
|
7243 | handler: function(func, body) {
|
7244 | var atoms;
|
7245 | if (body.type === "ordgroup") {
|
7246 | atoms = body.value;
|
7247 | } else {
|
7248 | atoms = [body];
|
7249 | }
|
7250 |
|
7251 | return {
|
7252 | type: "color",
|
7253 | color: "katex-" + func.slice(1),
|
7254 | value: atoms
|
7255 | };
|
7256 | }
|
7257 | }
|
7258 | },
|
7259 |
|
7260 | // There are 2 flags for operators; whether they produce limits in
|
7261 | // displaystyle, and whether they are symbols and should grow in
|
7262 | // displaystyle. These four groups cover the four possible choices.
|
7263 |
|
7264 | // No limits, not symbols
|
7265 | {
|
7266 | funcs: [
|
7267 | "\\arcsin", "\\arccos", "\\arctan", "\\arg", "\\cos", "\\cosh",
|
7268 | "\\cot", "\\coth", "\\csc", "\\deg", "\\dim", "\\exp", "\\hom",
|
7269 | "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh",
|
7270 | "\\tan","\\tanh"
|
7271 | ],
|
7272 | data: {
|
7273 | numArgs: 0,
|
7274 | handler: function(func) {
|
7275 | return {
|
7276 | type: "op",
|
7277 | limits: false,
|
7278 | symbol: false,
|
7279 | body: func
|
7280 | };
|
7281 | }
|
7282 | }
|
7283 | },
|
7284 |
|
7285 | // Limits, not symbols
|
7286 | {
|
7287 | funcs: [
|
7288 | "\\det", "\\gcd", "\\inf", "\\lim", "\\liminf", "\\limsup", "\\max",
|
7289 | "\\min", "\\Pr", "\\sup"
|
7290 | ],
|
7291 | data: {
|
7292 | numArgs: 0,
|
7293 | handler: function(func) {
|
7294 | return {
|
7295 | type: "op",
|
7296 | limits: true,
|
7297 | symbol: false,
|
7298 | body: func
|
7299 | };
|
7300 | }
|
7301 | }
|
7302 | },
|
7303 |
|
7304 | // No limits, symbols
|
7305 | {
|
7306 | funcs: [
|
7307 | "\\int", "\\iint", "\\iiint", "\\oint"
|
7308 | ],
|
7309 | data: {
|
7310 | numArgs: 0,
|
7311 | handler: function(func) {
|
7312 | return {
|
7313 | type: "op",
|
7314 | limits: false,
|
7315 | symbol: true,
|
7316 | body: func
|
7317 | };
|
7318 | }
|
7319 | }
|
7320 | },
|
7321 |
|
7322 | // Limits, symbols
|
7323 | {
|
7324 | funcs: [
|
7325 | "\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap",
|
7326 | "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes",
|
7327 | "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint"
|
7328 | ],
|
7329 | data: {
|
7330 | numArgs: 0,
|
7331 | handler: function(func) {
|
7332 | return {
|
7333 | type: "op",
|
7334 | limits: true,
|
7335 | symbol: true,
|
7336 | body: func
|
7337 | };
|
7338 | }
|
7339 | }
|
7340 | },
|
7341 |
|
7342 | // Fractions
|
7343 | {
|
7344 | funcs: [
|
7345 | "\\dfrac", "\\frac", "\\tfrac",
|
7346 | "\\dbinom", "\\binom", "\\tbinom"
|
7347 | ],
|
7348 | data: {
|
7349 | numArgs: 2,
|
7350 | greediness: 2,
|
7351 | handler: function(func, numer, denom) {
|
7352 | var hasBarLine;
|
7353 | var leftDelim = null;
|
7354 | var rightDelim = null;
|
7355 | var size = "auto";
|
7356 |
|
7357 | switch (func) {
|
7358 | case "\\dfrac":
|
7359 | case "\\frac":
|
7360 | case "\\tfrac":
|
7361 | hasBarLine = true;
|
7362 | break;
|
7363 | case "\\dbinom":
|
7364 | case "\\binom":
|
7365 | case "\\tbinom":
|
7366 | hasBarLine = false;
|
7367 | leftDelim = "(";
|
7368 | rightDelim = ")";
|
7369 | break;
|
7370 | default:
|
7371 | throw new Error("Unrecognized genfrac command");
|
7372 | }
|
7373 |
|
7374 | switch (func) {
|
7375 | case "\\dfrac":
|
7376 | case "\\dbinom":
|
7377 | size = "display";
|
7378 | break;
|
7379 | case "\\tfrac":
|
7380 | case "\\tbinom":
|
7381 | size = "text";
|
7382 | break;
|
7383 | }
|
7384 |
|
7385 | return {
|
7386 | type: "genfrac",
|
7387 | numer: numer,
|
7388 | denom: denom,
|
7389 | hasBarLine: hasBarLine,
|
7390 | leftDelim: leftDelim,
|
7391 | rightDelim: rightDelim,
|
7392 | size: size
|
7393 | };
|
7394 | }
|
7395 | }
|
7396 | },
|
7397 |
|
7398 | // Left and right overlap functions
|
7399 | {
|
7400 | funcs: ["\\llap", "\\rlap"],
|
7401 | data: {
|
7402 | numArgs: 1,
|
7403 | allowedInText: true,
|
7404 | handler: function(func, body) {
|
7405 | return {
|
7406 | type: func.slice(1),
|
7407 | body: body
|
7408 | };
|
7409 | }
|
7410 | }
|
7411 | },
|
7412 |
|
7413 | // Delimiter functions
|
7414 | {
|
7415 | funcs: [
|
7416 | "\\bigl", "\\Bigl", "\\biggl", "\\Biggl",
|
7417 | "\\bigr", "\\Bigr", "\\biggr", "\\Biggr",
|
7418 | "\\bigm", "\\Bigm", "\\biggm", "\\Biggm",
|
7419 | "\\big", "\\Big", "\\bigg", "\\Bigg",
|
7420 | "\\left", "\\right"
|
7421 | ],
|
7422 | data: {
|
7423 | numArgs: 1,
|
7424 | handler: function(func, delim, positions) {
|
7425 | if (!utils.contains(delimiters, delim.value)) {
|
7426 | throw new ParseError(
|
7427 | "Invalid delimiter: '" + delim.value + "' after '" +
|
7428 | func + "'",
|
7429 | this.lexer, positions[1]);
|
7430 | }
|
7431 |
|
7432 | // \left and \right are caught somewhere in Parser.js, which is
|
7433 | // why this data doesn't match what is in buildHTML.
|
7434 | if (func === "\\left" || func === "\\right") {
|
7435 | return {
|
7436 | type: "leftright",
|
7437 | value: delim.value
|
7438 | };
|
7439 | } else {
|
7440 | return {
|
7441 | type: "delimsizing",
|
7442 | size: delimiterSizes[func].size,
|
7443 | delimType: delimiterSizes[func].type,
|
7444 | value: delim.value
|
7445 | };
|
7446 | }
|
7447 | }
|
7448 | }
|
7449 | },
|
7450 |
|
7451 | // Sizing functions (handled in Parser.js explicitly, hence no handler)
|
7452 | {
|
7453 | funcs: [
|
7454 | "\\tiny", "\\scriptsize", "\\footnotesize", "\\small",
|
7455 | "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"
|
7456 | ],
|
7457 | data: {
|
7458 | numArgs: 0
|
7459 | }
|
7460 | },
|
7461 |
|
7462 | // Style changing functions (handled in Parser.js explicitly, hence no
|
7463 | // handler)
|
7464 | {
|
7465 | funcs: [
|
7466 | "\\displaystyle", "\\textstyle", "\\scriptstyle",
|
7467 | "\\scriptscriptstyle"
|
7468 | ],
|
7469 | data: {
|
7470 | numArgs: 0
|
7471 | }
|
7472 | },
|
7473 |
|
7474 | {
|
7475 | funcs: [
|
7476 | // styles
|
7477 | "\\mathrm", "\\mathit", "\\mathbf",
|
7478 |
|
7479 | // families
|
7480 | "\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf",
|
7481 | "\\mathtt",
|
7482 |
|
7483 | // aliases
|
7484 | "\\Bbb", "\\bold", "\\frak"
|
7485 | ],
|
7486 | data: {
|
7487 | numArgs: 1,
|
7488 | handler: function (func, body) {
|
7489 | if (func in fontAliases) {
|
7490 | func = fontAliases[func];
|
7491 | }
|
7492 | return {
|
7493 | type: "font",
|
7494 | font: func.slice(1),
|
7495 | body: body
|
7496 | };
|
7497 | }
|
7498 | }
|
7499 | },
|
7500 |
|
7501 | // Accents
|
7502 | {
|
7503 | funcs: [
|
7504 | "\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve",
|
7505 | "\\check", "\\hat", "\\vec", "\\dot"
|
7506 | // We don't support expanding accents yet
|
7507 | // "\\widetilde", "\\widehat"
|
7508 | ],
|
7509 | data: {
|
7510 | numArgs: 1,
|
7511 | handler: function(func, base) {
|
7512 | return {
|
7513 | type: "accent",
|
7514 | accent: func,
|
7515 | base: base
|
7516 | };
|
7517 | }
|
7518 | }
|
7519 | },
|
7520 |
|
7521 | // Infix generalized fractions
|
7522 | {
|
7523 | funcs: ["\\over", "\\choose"],
|
7524 | data: {
|
7525 | numArgs: 0,
|
7526 | handler: function (func) {
|
7527 | var replaceWith;
|
7528 | switch (func) {
|
7529 | case "\\over":
|
7530 | replaceWith = "\\frac";
|
7531 | break;
|
7532 | case "\\choose":
|
7533 | replaceWith = "\\binom";
|
7534 | break;
|
7535 | default:
|
7536 | throw new Error("Unrecognized infix genfrac command");
|
7537 | }
|
7538 | return {
|
7539 | type: "infix",
|
7540 | replaceWith: replaceWith
|
7541 | };
|
7542 | }
|
7543 | }
|
7544 | },
|
7545 |
|
7546 | // Row breaks for aligned data
|
7547 | {
|
7548 | funcs: ["\\\\", "\\cr"],
|
7549 | data: {
|
7550 | numArgs: 0,
|
7551 | numOptionalArgs: 1,
|
7552 | argTypes: ["size"],
|
7553 | handler: function(func, size) {
|
7554 | return {
|
7555 | type: "cr",
|
7556 | size: size
|
7557 | };
|
7558 | }
|
7559 | }
|
7560 | },
|
7561 |
|
7562 | // Environment delimiters
|
7563 | {
|
7564 | funcs: ["\\begin", "\\end"],
|
7565 | data: {
|
7566 | numArgs: 1,
|
7567 | argTypes: ["text"],
|
7568 | handler: function(func, nameGroup, positions) {
|
7569 | if (nameGroup.type !== "ordgroup") {
|
7570 | throw new ParseError(
|
7571 | "Invalid environment name",
|
7572 | this.lexer, positions[1]);
|
7573 | }
|
7574 | var name = "";
|
7575 | for (var i = 0; i < nameGroup.value.length; ++i) {
|
7576 | name += nameGroup.value[i].value;
|
7577 | }
|
7578 | return {
|
7579 | type: "environment",
|
7580 | name: name,
|
7581 | namepos: positions[1]
|
7582 | };
|
7583 | }
|
7584 | }
|
7585 | }
|
7586 | ];
|
7587 |
|
7588 | var addFuncsWithData = function(funcs, data) {
|
7589 | for (var i = 0; i < funcs.length; i++) {
|
7590 | functions[funcs[i]] = data;
|
7591 | }
|
7592 | };
|
7593 |
|
7594 | // Add all of the functions in duplicatedFunctions to the functions map
|
7595 | for (var i = 0; i < duplicatedFunctions.length; i++) {
|
7596 | addFuncsWithData(duplicatedFunctions[i].funcs, duplicatedFunctions[i].data);
|
7597 | }
|
7598 |
|
7599 | // Set default values of functions
|
7600 | for (var f in functions) {
|
7601 | if (functions.hasOwnProperty(f)) {
|
7602 | var func = functions[f];
|
7603 |
|
7604 | functions[f] = {
|
7605 | numArgs: func.numArgs,
|
7606 | argTypes: func.argTypes,
|
7607 | greediness: (func.greediness === undefined) ? 1 : func.greediness,
|
7608 | allowedInText: func.allowedInText ? func.allowedInText : false,
|
7609 | numOptionalArgs: (func.numOptionalArgs === undefined) ? 0 :
|
7610 | func.numOptionalArgs,
|
7611 | handler: func.handler
|
7612 | };
|
7613 | }
|
7614 | }
|
7615 |
|
7616 | module.exports = {
|
7617 | funcs: functions
|
7618 | };
|
7619 |
|
7620 | },{"./ParseError":7,"./utils":25}],21:[function(require,module,exports){
|
7621 | /**
|
7622 | * These objects store data about MathML nodes. This is the MathML equivalent
|
7623 | * of the types in domTree.js. Since MathML handles its own rendering, and
|
7624 | * since we're mainly using MathML to improve accessibility, we don't manage
|
7625 | * any of the styling state that the plain DOM nodes do.
|
7626 | *
|
7627 | * The `toNode` and `toMarkup` functions work simlarly to how they do in
|
7628 | * domTree.js, creating namespaced DOM nodes and HTML text markup respectively.
|
7629 | */
|
7630 |
|
7631 | var utils = require("./utils");
|
7632 |
|
7633 | /**
|
7634 | * This node represents a general purpose MathML node of any type. The
|
7635 | * constructor requires the type of node to create (for example, `"mo"` or
|
7636 | * `"mspace"`, corresponding to `<mo>` and `<mspace>` tags).
|
7637 | */
|
7638 | function MathNode(type, children) {
|
7639 | this.type = type;
|
7640 | this.attributes = {};
|
7641 | this.children = children || [];
|
7642 | }
|
7643 |
|
7644 | /**
|
7645 | * Sets an attribute on a MathML node. MathML depends on attributes to convey a
|
7646 | * semantic content, so this is used heavily.
|
7647 | */
|
7648 | MathNode.prototype.setAttribute = function(name, value) {
|
7649 | this.attributes[name] = value;
|
7650 | };
|
7651 |
|
7652 | /**
|
7653 | * Converts the math node into a MathML-namespaced DOM element.
|
7654 | */
|
7655 | MathNode.prototype.toNode = function() {
|
7656 | var node = document.createElementNS(
|
7657 | "http://www.w3.org/1998/Math/MathML", this.type);
|
7658 |
|
7659 | for (var attr in this.attributes) {
|
7660 | if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
|
7661 | node.setAttribute(attr, this.attributes[attr]);
|
7662 | }
|
7663 | }
|
7664 |
|
7665 | for (var i = 0; i < this.children.length; i++) {
|
7666 | node.appendChild(this.children[i].toNode());
|
7667 | }
|
7668 |
|
7669 | return node;
|
7670 | };
|
7671 |
|
7672 | /**
|
7673 | * Converts the math node into an HTML markup string.
|
7674 | */
|
7675 | MathNode.prototype.toMarkup = function() {
|
7676 | var markup = "<" + this.type;
|
7677 |
|
7678 | // Add the attributes
|
7679 | for (var attr in this.attributes) {
|
7680 | if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
|
7681 | markup += " " + attr + "=\"";
|
7682 | markup += utils.escape(this.attributes[attr]);
|
7683 | markup += "\"";
|
7684 | }
|
7685 | }
|
7686 |
|
7687 | markup += ">";
|
7688 |
|
7689 | for (var i = 0; i < this.children.length; i++) {
|
7690 | markup += this.children[i].toMarkup();
|
7691 | }
|
7692 |
|
7693 | markup += "</" + this.type + ">";
|
7694 |
|
7695 | return markup;
|
7696 | };
|
7697 |
|
7698 | /**
|
7699 | * This node represents a piece of text.
|
7700 | */
|
7701 | function TextNode(text) {
|
7702 | this.text = text;
|
7703 | }
|
7704 |
|
7705 | /**
|
7706 | * Converts the text node into a DOM text node.
|
7707 | */
|
7708 | TextNode.prototype.toNode = function() {
|
7709 | return document.createTextNode(this.text);
|
7710 | };
|
7711 |
|
7712 | /**
|
7713 | * Converts the text node into HTML markup (which is just the text itself).
|
7714 | */
|
7715 | TextNode.prototype.toMarkup = function() {
|
7716 | return utils.escape(this.text);
|
7717 | };
|
7718 |
|
7719 | module.exports = {
|
7720 | MathNode: MathNode,
|
7721 | TextNode: TextNode
|
7722 | };
|
7723 |
|
7724 | },{"./utils":25}],22:[function(require,module,exports){
|
7725 | /**
|
7726 | * The resulting parse tree nodes of the parse tree.
|
7727 | */
|
7728 | function ParseNode(type, value, mode) {
|
7729 | this.type = type;
|
7730 | this.value = value;
|
7731 | this.mode = mode;
|
7732 | }
|
7733 |
|
7734 | /**
|
7735 | * A result and final position returned by the `.parse...` functions.
|
7736 | *
|
7737 | */
|
7738 | function ParseResult(result, newPosition, peek) {
|
7739 | this.result = result;
|
7740 | this.position = newPosition;
|
7741 | }
|
7742 |
|
7743 | module.exports = {
|
7744 | ParseNode: ParseNode,
|
7745 | ParseResult: ParseResult
|
7746 | };
|
7747 |
|
7748 |
|
7749 | },{}],23:[function(require,module,exports){
|
7750 | /**
|
7751 | * Provides a single function for parsing an expression using a Parser
|
7752 | * TODO(emily): Remove this
|
7753 | */
|
7754 |
|
7755 | var Parser = require("./Parser");
|
7756 |
|
7757 | /**
|
7758 | * Parses an expression using a Parser, then returns the parsed result.
|
7759 | */
|
7760 | var parseTree = function(toParse, settings) {
|
7761 | var parser = new Parser(toParse, settings);
|
7762 |
|
7763 | return parser.parse();
|
7764 | };
|
7765 |
|
7766 | module.exports = parseTree;
|
7767 |
|
7768 | },{"./Parser":8}],24:[function(require,module,exports){
|
7769 | /**
|
7770 | * This file holds a list of all no-argument functions and single-character
|
7771 | * symbols (like 'a' or ';').
|
7772 | *
|
7773 | * For each of the symbols, there are three properties they can have:
|
7774 | * - font (required): the font to be used for this symbol. Either "main" (the
|
7775 | normal font), or "ams" (the ams fonts).
|
7776 | * - group (required): the ParseNode group type the symbol should have (i.e.
|
7777 | "textord", "mathord", etc).
|
7778 | See https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
|
7779 | * - replace (optional): the character that this symbol or function should be
|
7780 | * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
|
7781 | * character in the main font).
|
7782 | *
|
7783 | * The outermost map in the table indicates what mode the symbols should be
|
7784 | * accepted in (e.g. "math" or "text").
|
7785 | */
|
7786 |
|
7787 | var symbols = {
|
7788 | "math": {
|
7789 | // Relation Symbols
|
7790 | "\\equiv": {
|
7791 | font: "main",
|
7792 | group: "rel",
|
7793 | replace: "\u2261"
|
7794 | },
|
7795 | "\\prec": {
|
7796 | font: "main",
|
7797 | group: "rel",
|
7798 | replace: "\u227a"
|
7799 | },
|
7800 | "\\succ": {
|
7801 | font: "main",
|
7802 | group: "rel",
|
7803 | replace: "\u227b"
|
7804 | },
|
7805 | "\\sim": {
|
7806 | font: "main",
|
7807 | group: "rel",
|
7808 | replace: "\u223c"
|
7809 | },
|
7810 | "\\perp": {
|
7811 | font: "main",
|
7812 | group: "rel",
|
7813 | replace: "\u22a5"
|
7814 | },
|
7815 | "\\preceq": {
|
7816 | font: "main",
|
7817 | group: "rel",
|
7818 | replace: "\u2aaf"
|
7819 | },
|
7820 | "\\succeq": {
|
7821 | font: "main",
|
7822 | group: "rel",
|
7823 | replace: "\u2ab0"
|
7824 | },
|
7825 | "\\simeq": {
|
7826 | font: "main",
|
7827 | group: "rel",
|
7828 | replace: "\u2243"
|
7829 | },
|
7830 | "\\mid": {
|
7831 | font: "main",
|
7832 | group: "rel",
|
7833 | replace: "\u2223"
|
7834 | },
|
7835 | "\\ll": {
|
7836 | font: "main",
|
7837 | group: "rel",
|
7838 | replace: "\u226a"
|
7839 | },
|
7840 | "\\gg": {
|
7841 | font: "main",
|
7842 | group: "rel",
|
7843 | replace: "\u226b"
|
7844 | },
|
7845 | "\\asymp": {
|
7846 | font: "main",
|
7847 | group: "rel",
|
7848 | replace: "\u224d"
|
7849 | },
|
7850 | "\\parallel": {
|
7851 | font: "main",
|
7852 | group: "rel",
|
7853 | replace: "\u2225"
|
7854 | },
|
7855 | "\\bowtie": {
|
7856 | font: "main",
|
7857 | group: "rel",
|
7858 | replace: "\u22c8"
|
7859 | },
|
7860 | "\\smile": {
|
7861 | font: "main",
|
7862 | group: "rel",
|
7863 | replace: "\u2323"
|
7864 | },
|
7865 | "\\sqsubseteq": {
|
7866 | font: "main",
|
7867 | group: "rel",
|
7868 | replace: "\u2291"
|
7869 | },
|
7870 | "\\sqsupseteq": {
|
7871 | font: "main",
|
7872 | group: "rel",
|
7873 | replace: "\u2292"
|
7874 | },
|
7875 | "\\doteq": {
|
7876 | font: "main",
|
7877 | group: "rel",
|
7878 | replace: "\u2250"
|
7879 | },
|
7880 | "\\frown": {
|
7881 | font: "main",
|
7882 | group: "rel",
|
7883 | replace: "\u2322"
|
7884 | },
|
7885 | "\\ni": {
|
7886 | font: "main",
|
7887 | group: "rel",
|
7888 | replace: "\u220b"
|
7889 | },
|
7890 | "\\propto": {
|
7891 | font: "main",
|
7892 | group: "rel",
|
7893 | replace: "\u221d"
|
7894 | },
|
7895 | "\\vdash": {
|
7896 | font: "main",
|
7897 | group: "rel",
|
7898 | replace: "\u22a2"
|
7899 | },
|
7900 | "\\dashv": {
|
7901 | font: "main",
|
7902 | group: "rel",
|
7903 | replace: "\u22a3"
|
7904 | },
|
7905 | "\\owns": {
|
7906 | font: "main",
|
7907 | group: "rel",
|
7908 | replace: "\u220b"
|
7909 | },
|
7910 |
|
7911 | // Punctuation
|
7912 | "\\ldotp": {
|
7913 | font: "main",
|
7914 | group: "punct",
|
7915 | replace: "\u002e"
|
7916 | },
|
7917 | "\\cdotp": {
|
7918 | font: "main",
|
7919 | group: "punct",
|
7920 | replace: "\u22c5"
|
7921 | },
|
7922 |
|
7923 | // Misc Symbols
|
7924 | "\\#": {
|
7925 | font: "main",
|
7926 | group: "textord",
|
7927 | replace: "\u0023"
|
7928 | },
|
7929 | "\\&": {
|
7930 | font: "main",
|
7931 | group: "textord",
|
7932 | replace: "\u0026"
|
7933 | },
|
7934 | "\\aleph": {
|
7935 | font: "main",
|
7936 | group: "textord",
|
7937 | replace: "\u2135"
|
7938 | },
|
7939 | "\\forall": {
|
7940 | font: "main",
|
7941 | group: "textord",
|
7942 | replace: "\u2200"
|
7943 | },
|
7944 | "\\hbar": {
|
7945 | font: "main",
|
7946 | group: "textord",
|
7947 | replace: "\u210f"
|
7948 | },
|
7949 | "\\exists": {
|
7950 | font: "main",
|
7951 | group: "textord",
|
7952 | replace: "\u2203"
|
7953 | },
|
7954 | "\\nabla": {
|
7955 | font: "main",
|
7956 | group: "textord",
|
7957 | replace: "\u2207"
|
7958 | },
|
7959 | "\\flat": {
|
7960 | font: "main",
|
7961 | group: "textord",
|
7962 | replace: "\u266d"
|
7963 | },
|
7964 | "\\ell": {
|
7965 | font: "main",
|
7966 | group: "textord",
|
7967 | replace: "\u2113"
|
7968 | },
|
7969 | "\\natural": {
|
7970 | font: "main",
|
7971 | group: "textord",
|
7972 | replace: "\u266e"
|
7973 | },
|
7974 | "\\clubsuit": {
|
7975 | font: "main",
|
7976 | group: "textord",
|
7977 | replace: "\u2663"
|
7978 | },
|
7979 | "\\wp": {
|
7980 | font: "main",
|
7981 | group: "textord",
|
7982 | replace: "\u2118"
|
7983 | },
|
7984 | "\\sharp": {
|
7985 | font: "main",
|
7986 | group: "textord",
|
7987 | replace: "\u266f"
|
7988 | },
|
7989 | "\\diamondsuit": {
|
7990 | font: "main",
|
7991 | group: "textord",
|
7992 | replace: "\u2662"
|
7993 | },
|
7994 | "\\Re": {
|
7995 | font: "main",
|
7996 | group: "textord",
|
7997 | replace: "\u211c"
|
7998 | },
|
7999 | "\\heartsuit": {
|
8000 | font: "main",
|
8001 | group: "textord",
|
8002 | replace: "\u2661"
|
8003 | },
|
8004 | "\\Im": {
|
8005 | font: "main",
|
8006 | group: "textord",
|
8007 | replace: "\u2111"
|
8008 | },
|
8009 | "\\spadesuit": {
|
8010 | font: "main",
|
8011 | group: "textord",
|
8012 | replace: "\u2660"
|
8013 | },
|
8014 |
|
8015 | // Math and Text
|
8016 | "\\dag": {
|
8017 | font: "main",
|
8018 | group: "textord",
|
8019 | replace: "\u2020"
|
8020 | },
|
8021 | "\\ddag": {
|
8022 | font: "main",
|
8023 | group: "textord",
|
8024 | replace: "\u2021"
|
8025 | },
|
8026 |
|
8027 | // Large Delimiters
|
8028 | "\\rmoustache": {
|
8029 | font: "main",
|
8030 | group: "close",
|
8031 | replace: "\u23b1"
|
8032 | },
|
8033 | "\\lmoustache": {
|
8034 | font: "main",
|
8035 | group: "open",
|
8036 | replace: "\u23b0"
|
8037 | },
|
8038 | "\\rgroup": {
|
8039 | font: "main",
|
8040 | group: "close",
|
8041 | replace: "\u27ef"
|
8042 | },
|
8043 | "\\lgroup": {
|
8044 | font: "main",
|
8045 | group: "open",
|
8046 | replace: "\u27ee"
|
8047 | },
|
8048 |
|
8049 | // Binary Operators
|
8050 | "\\mp": {
|
8051 | font: "main",
|
8052 | group: "bin",
|
8053 | replace: "\u2213"
|
8054 | },
|
8055 | "\\ominus": {
|
8056 | font: "main",
|
8057 | group: "bin",
|
8058 | replace: "\u2296"
|
8059 | },
|
8060 | "\\uplus": {
|
8061 | font: "main",
|
8062 | group: "bin",
|
8063 | replace: "\u228e"
|
8064 | },
|
8065 | "\\sqcap": {
|
8066 | font: "main",
|
8067 | group: "bin",
|
8068 | replace: "\u2293"
|
8069 | },
|
8070 | "\\ast": {
|
8071 | font: "main",
|
8072 | group: "bin",
|
8073 | replace: "\u2217"
|
8074 | },
|
8075 | "\\sqcup": {
|
8076 | font: "main",
|
8077 | group: "bin",
|
8078 | replace: "\u2294"
|
8079 | },
|
8080 | "\\bigcirc": {
|
8081 | font: "main",
|
8082 | group: "bin",
|
8083 | replace: "\u25ef"
|
8084 | },
|
8085 | "\\bullet": {
|
8086 | font: "main",
|
8087 | group: "bin",
|
8088 | replace: "\u2219"
|
8089 | },
|
8090 | "\\ddagger": {
|
8091 | font: "main",
|
8092 | group: "bin",
|
8093 | replace: "\u2021"
|
8094 | },
|
8095 | "\\wr": {
|
8096 | font: "main",
|
8097 | group: "bin",
|
8098 | replace: "\u2240"
|
8099 | },
|
8100 | "\\amalg": {
|
8101 | font: "main",
|
8102 | group: "bin",
|
8103 | replace: "\u2a3f"
|
8104 | },
|
8105 |
|
8106 | // Arrow Symbols
|
8107 | "\\longleftarrow": {
|
8108 | font: "main",
|
8109 | group: "rel",
|
8110 | replace: "\u27f5"
|
8111 | },
|
8112 | "\\Leftarrow": {
|
8113 | font: "main",
|
8114 | group: "rel",
|
8115 | replace: "\u21d0"
|
8116 | },
|
8117 | "\\Longleftarrow": {
|
8118 | font: "main",
|
8119 | group: "rel",
|
8120 | replace: "\u27f8"
|
8121 | },
|
8122 | "\\longrightarrow": {
|
8123 | font: "main",
|
8124 | group: "rel",
|
8125 | replace: "\u27f6"
|
8126 | },
|
8127 | "\\Rightarrow": {
|
8128 | font: "main",
|
8129 | group: "rel",
|
8130 | replace: "\u21d2"
|
8131 | },
|
8132 | "\\Longrightarrow": {
|
8133 | font: "main",
|
8134 | group: "rel",
|
8135 | replace: "\u27f9"
|
8136 | },
|
8137 | "\\leftrightarrow": {
|
8138 | font: "main",
|
8139 | group: "rel",
|
8140 | replace: "\u2194"
|
8141 | },
|
8142 | "\\longleftrightarrow": {
|
8143 | font: "main",
|
8144 | group: "rel",
|
8145 | replace: "\u27f7"
|
8146 | },
|
8147 | "\\Leftrightarrow": {
|
8148 | font: "main",
|
8149 | group: "rel",
|
8150 | replace: "\u21d4"
|
8151 | },
|
8152 | "\\Longleftrightarrow": {
|
8153 | font: "main",
|
8154 | group: "rel",
|
8155 | replace: "\u27fa"
|
8156 | },
|
8157 | "\\mapsto": {
|
8158 | font: "main",
|
8159 | group: "rel",
|
8160 | replace: "\u21a6"
|
8161 | },
|
8162 | "\\longmapsto": {
|
8163 | font: "main",
|
8164 | group: "rel",
|
8165 | replace: "\u27fc"
|
8166 | },
|
8167 | "\\nearrow": {
|
8168 | font: "main",
|
8169 | group: "rel",
|
8170 | replace: "\u2197"
|
8171 | },
|
8172 | "\\hookleftarrow": {
|
8173 | font: "main",
|
8174 | group: "rel",
|
8175 | replace: "\u21a9"
|
8176 | },
|
8177 | "\\hookrightarrow": {
|
8178 | font: "main",
|
8179 | group: "rel",
|
8180 | replace: "\u21aa"
|
8181 | },
|
8182 | "\\searrow": {
|
8183 | font: "main",
|
8184 | group: "rel",
|
8185 | replace: "\u2198"
|
8186 | },
|
8187 | "\\leftharpoonup": {
|
8188 | font: "main",
|
8189 | group: "rel",
|
8190 | replace: "\u21bc"
|
8191 | },
|
8192 | "\\rightharpoonup": {
|
8193 | font: "main",
|
8194 | group: "rel",
|
8195 | replace: "\u21c0"
|
8196 | },
|
8197 | "\\swarrow": {
|
8198 | font: "main",
|
8199 | group: "rel",
|
8200 | replace: "\u2199"
|
8201 | },
|
8202 | "\\leftharpoondown": {
|
8203 | font: "main",
|
8204 | group: "rel",
|
8205 | replace: "\u21bd"
|
8206 | },
|
8207 | "\\rightharpoondown": {
|
8208 | font: "main",
|
8209 | group: "rel",
|
8210 | replace: "\u21c1"
|
8211 | },
|
8212 | "\\nwarrow": {
|
8213 | font: "main",
|
8214 | group: "rel",
|
8215 | replace: "\u2196"
|
8216 | },
|
8217 | "\\rightleftharpoons": {
|
8218 | font: "main",
|
8219 | group: "rel",
|
8220 | replace: "\u21cc"
|
8221 | },
|
8222 |
|
8223 | // AMS Negated Binary Relations
|
8224 | "\\nless": {
|
8225 | font: "ams",
|
8226 | group: "rel",
|
8227 | replace: "\u226e"
|
8228 | },
|
8229 | "\\nleqslant": {
|
8230 | font: "ams",
|
8231 | group: "rel",
|
8232 | replace: "\ue010"
|
8233 | },
|
8234 | "\\nleqq": {
|
8235 | font: "ams",
|
8236 | group: "rel",
|
8237 | replace: "\ue011"
|
8238 | },
|
8239 | "\\lneq": {
|
8240 | font: "ams",
|
8241 | group: "rel",
|
8242 | replace: "\u2a87"
|
8243 | },
|
8244 | "\\lneqq": {
|
8245 | font: "ams",
|
8246 | group: "rel",
|
8247 | replace: "\u2268"
|
8248 | },
|
8249 | "\\lvertneqq": {
|
8250 | font: "ams",
|
8251 | group: "rel",
|
8252 | replace: "\ue00c"
|
8253 | },
|
8254 | "\\lnsim": {
|
8255 | font: "ams",
|
8256 | group: "rel",
|
8257 | replace: "\u22e6"
|
8258 | },
|
8259 | "\\lnapprox": {
|
8260 | font: "ams",
|
8261 | group: "rel",
|
8262 | replace: "\u2a89"
|
8263 | },
|
8264 | "\\nprec": {
|
8265 | font: "ams",
|
8266 | group: "rel",
|
8267 | replace: "\u2280"
|
8268 | },
|
8269 | "\\npreceq": {
|
8270 | font: "ams",
|
8271 | group: "rel",
|
8272 | replace: "\u22e0"
|
8273 | },
|
8274 | "\\precnsim": {
|
8275 | font: "ams",
|
8276 | group: "rel",
|
8277 | replace: "\u22e8"
|
8278 | },
|
8279 | "\\precnapprox": {
|
8280 | font: "ams",
|
8281 | group: "rel",
|
8282 | replace: "\u2ab9"
|
8283 | },
|
8284 | "\\nsim": {
|
8285 | font: "ams",
|
8286 | group: "rel",
|
8287 | replace: "\u2241"
|
8288 | },
|
8289 | "\\nshortmid": {
|
8290 | font: "ams",
|
8291 | group: "rel",
|
8292 | replace: "\ue006"
|
8293 | },
|
8294 | "\\nmid": {
|
8295 | font: "ams",
|
8296 | group: "rel",
|
8297 | replace: "\u2224"
|
8298 | },
|
8299 | "\\nvdash": {
|
8300 | font: "ams",
|
8301 | group: "rel",
|
8302 | replace: "\u22ac"
|
8303 | },
|
8304 | "\\nvDash": {
|
8305 | font: "ams",
|
8306 | group: "rel",
|
8307 | replace: "\u22ad"
|
8308 | },
|
8309 | "\\ntriangleleft": {
|
8310 | font: "ams",
|
8311 | group: "rel",
|
8312 | replace: "\u22ea"
|
8313 | },
|
8314 | "\\ntrianglelefteq": {
|
8315 | font: "ams",
|
8316 | group: "rel",
|
8317 | replace: "\u22ec"
|
8318 | },
|
8319 | "\\subsetneq": {
|
8320 | font: "ams",
|
8321 | group: "rel",
|
8322 | replace: "\u228a"
|
8323 | },
|
8324 | "\\varsubsetneq": {
|
8325 | font: "ams",
|
8326 | group: "rel",
|
8327 | replace: "\ue01a"
|
8328 | },
|
8329 | "\\subsetneqq": {
|
8330 | font: "ams",
|
8331 | group: "rel",
|
8332 | replace: "\u2acb"
|
8333 | },
|
8334 | "\\varsubsetneqq": {
|
8335 | font: "ams",
|
8336 | group: "rel",
|
8337 | replace: "\ue017"
|
8338 | },
|
8339 | "\\ngtr": {
|
8340 | font: "ams",
|
8341 | group: "rel",
|
8342 | replace: "\u226f"
|
8343 | },
|
8344 | "\\ngeqslant": {
|
8345 | font: "ams",
|
8346 | group: "rel",
|
8347 | replace: "\ue00f"
|
8348 | },
|
8349 | "\\ngeqq": {
|
8350 | font: "ams",
|
8351 | group: "rel",
|
8352 | replace: "\ue00e"
|
8353 | },
|
8354 | "\\gneq": {
|
8355 | font: "ams",
|
8356 | group: "rel",
|
8357 | replace: "\u2a88"
|
8358 | },
|
8359 | "\\gneqq": {
|
8360 | font: "ams",
|
8361 | group: "rel",
|
8362 | replace: "\u2269"
|
8363 | },
|
8364 | "\\gvertneqq": {
|
8365 | font: "ams",
|
8366 | group: "rel",
|
8367 | replace: "\ue00d"
|
8368 | },
|
8369 | "\\gnsim": {
|
8370 | font: "ams",
|
8371 | group: "rel",
|
8372 | replace: "\u22e7"
|
8373 | },
|
8374 | "\\gnapprox": {
|
8375 | font: "ams",
|
8376 | group: "rel",
|
8377 | replace: "\u2a8a"
|
8378 | },
|
8379 | "\\nsucc": {
|
8380 | font: "ams",
|
8381 | group: "rel",
|
8382 | replace: "\u2281"
|
8383 | },
|
8384 | "\\nsucceq": {
|
8385 | font: "ams",
|
8386 | group: "rel",
|
8387 | replace: "\u22e1"
|
8388 | },
|
8389 | "\\succnsim": {
|
8390 | font: "ams",
|
8391 | group: "rel",
|
8392 | replace: "\u22e9"
|
8393 | },
|
8394 | "\\succnapprox": {
|
8395 | font: "ams",
|
8396 | group: "rel",
|
8397 | replace: "\u2aba"
|
8398 | },
|
8399 | "\\ncong": {
|
8400 | font: "ams",
|
8401 | group: "rel",
|
8402 | replace: "\u2246"
|
8403 | },
|
8404 | "\\nshortparallel": {
|
8405 | font: "ams",
|
8406 | group: "rel",
|
8407 | replace: "\ue007"
|
8408 | },
|
8409 | "\\nparallel": {
|
8410 | font: "ams",
|
8411 | group: "rel",
|
8412 | replace: "\u2226"
|
8413 | },
|
8414 | "\\nVDash": {
|
8415 | font: "ams",
|
8416 | group: "rel",
|
8417 | replace: "\u22af"
|
8418 | },
|
8419 | "\\ntriangleright": {
|
8420 | font: "ams",
|
8421 | group: "rel",
|
8422 | replace: "\u22eb"
|
8423 | },
|
8424 | "\\ntrianglerighteq": {
|
8425 | font: "ams",
|
8426 | group: "rel",
|
8427 | replace: "\u22ed"
|
8428 | },
|
8429 | "\\nsupseteqq": {
|
8430 | font: "ams",
|
8431 | group: "rel",
|
8432 | replace: "\ue018"
|
8433 | },
|
8434 | "\\supsetneq": {
|
8435 | font: "ams",
|
8436 | group: "rel",
|
8437 | replace: "\u228b"
|
8438 | },
|
8439 | "\\varsupsetneq": {
|
8440 | font: "ams",
|
8441 | group: "rel",
|
8442 | replace: "\ue01b"
|
8443 | },
|
8444 | "\\supsetneqq": {
|
8445 | font: "ams",
|
8446 | group: "rel",
|
8447 | replace: "\u2acc"
|
8448 | },
|
8449 | "\\varsupsetneqq": {
|
8450 | font: "ams",
|
8451 | group: "rel",
|
8452 | replace: "\ue019"
|
8453 | },
|
8454 | "\\nVdash": {
|
8455 | font: "ams",
|
8456 | group: "rel",
|
8457 | replace: "\u22ae"
|
8458 | },
|
8459 | "\\precneqq": {
|
8460 | font: "ams",
|
8461 | group: "rel",
|
8462 | replace: "\u2ab5"
|
8463 | },
|
8464 | "\\succneqq": {
|
8465 | font: "ams",
|
8466 | group: "rel",
|
8467 | replace: "\u2ab6"
|
8468 | },
|
8469 | "\\nsubseteqq": {
|
8470 | font: "ams",
|
8471 | group: "rel",
|
8472 | replace: "\ue016"
|
8473 | },
|
8474 | "\\unlhd": {
|
8475 | font: "ams",
|
8476 | group: "bin",
|
8477 | replace: "\u22b4"
|
8478 | },
|
8479 | "\\unrhd": {
|
8480 | font: "ams",
|
8481 | group: "bin",
|
8482 | replace: "\u22b5"
|
8483 | },
|
8484 |
|
8485 | // AMS Negated Arrows
|
8486 | "\\nleftarrow": {
|
8487 | font: "ams",
|
8488 | group: "rel",
|
8489 | replace: "\u219a"
|
8490 | },
|
8491 | "\\nrightarrow": {
|
8492 | font: "ams",
|
8493 | group: "rel",
|
8494 | replace: "\u219b"
|
8495 | },
|
8496 | "\\nLeftarrow": {
|
8497 | font: "ams",
|
8498 | group: "rel",
|
8499 | replace: "\u21cd"
|
8500 | },
|
8501 | "\\nRightarrow": {
|
8502 | font: "ams",
|
8503 | group: "rel",
|
8504 | replace: "\u21cf"
|
8505 | },
|
8506 | "\\nleftrightarrow": {
|
8507 | font: "ams",
|
8508 | group: "rel",
|
8509 | replace: "\u21ae"
|
8510 | },
|
8511 | "\\nLeftrightarrow": {
|
8512 | font: "ams",
|
8513 | group: "rel",
|
8514 | replace: "\u21ce"
|
8515 | },
|
8516 |
|
8517 | // AMS Misc
|
8518 | "\\vartriangle": {
|
8519 | font: "ams",
|
8520 | group: "rel",
|
8521 | replace: "\u25b3"
|
8522 | },
|
8523 | "\\hslash": {
|
8524 | font: "ams",
|
8525 | group: "textord",
|
8526 | replace: "\u210f"
|
8527 | },
|
8528 | "\\triangledown": {
|
8529 | font: "ams",
|
8530 | group: "textord",
|
8531 | replace: "\u25bd"
|
8532 | },
|
8533 | "\\lozenge": {
|
8534 | font: "ams",
|
8535 | group: "textord",
|
8536 | replace: "\u25ca"
|
8537 | },
|
8538 | "\\circledS": {
|
8539 | font: "ams",
|
8540 | group: "textord",
|
8541 | replace: "\u24c8"
|
8542 | },
|
8543 | "\\circledR": {
|
8544 | font: "ams",
|
8545 | group: "textord",
|
8546 | replace: "\u00ae"
|
8547 | },
|
8548 | "\\measuredangle": {
|
8549 | font: "ams",
|
8550 | group: "textord",
|
8551 | replace: "\u2221"
|
8552 | },
|
8553 | "\\nexists": {
|
8554 | font: "ams",
|
8555 | group: "textord",
|
8556 | replace: "\u2204"
|
8557 | },
|
8558 | "\\mho": {
|
8559 | font: "ams",
|
8560 | group: "textord",
|
8561 | replace: "\u2127"
|
8562 | },
|
8563 | "\\Finv": {
|
8564 | font: "ams",
|
8565 | group: "textord",
|
8566 | replace: "\u2132"
|
8567 | },
|
8568 | "\\Game": {
|
8569 | font: "ams",
|
8570 | group: "textord",
|
8571 | replace: "\u2141"
|
8572 | },
|
8573 | "\\Bbbk": {
|
8574 | font: "ams",
|
8575 | group: "textord",
|
8576 | replace: "\u006b"
|
8577 | },
|
8578 | "\\backprime": {
|
8579 | font: "ams",
|
8580 | group: "textord",
|
8581 | replace: "\u2035"
|
8582 | },
|
8583 | "\\blacktriangle": {
|
8584 | font: "ams",
|
8585 | group: "textord",
|
8586 | replace: "\u25b2"
|
8587 | },
|
8588 | "\\blacktriangledown": {
|
8589 | font: "ams",
|
8590 | group: "textord",
|
8591 | replace: "\u25bc"
|
8592 | },
|
8593 | "\\blacksquare": {
|
8594 | font: "ams",
|
8595 | group: "textord",
|
8596 | replace: "\u25a0"
|
8597 | },
|
8598 | "\\blacklozenge": {
|
8599 | font: "ams",
|
8600 | group: "textord",
|
8601 | replace: "\u29eb"
|
8602 | },
|
8603 | "\\bigstar": {
|
8604 | font: "ams",
|
8605 | group: "textord",
|
8606 | replace: "\u2605"
|
8607 | },
|
8608 | "\\sphericalangle": {
|
8609 | font: "ams",
|
8610 | group: "textord",
|
8611 | replace: "\u2222"
|
8612 | },
|
8613 | "\\complement": {
|
8614 | font: "ams",
|
8615 | group: "textord",
|
8616 | replace: "\u2201"
|
8617 | },
|
8618 | "\\eth": {
|
8619 | font: "ams",
|
8620 | group: "textord",
|
8621 | replace: "\u00f0"
|
8622 | },
|
8623 | "\\diagup": {
|
8624 | font: "ams",
|
8625 | group: "textord",
|
8626 | replace: "\u2571"
|
8627 | },
|
8628 | "\\diagdown": {
|
8629 | font: "ams",
|
8630 | group: "textord",
|
8631 | replace: "\u2572"
|
8632 | },
|
8633 | "\\square": {
|
8634 | font: "ams",
|
8635 | group: "textord",
|
8636 | replace: "\u25a1"
|
8637 | },
|
8638 | "\\Box": {
|
8639 | font: "ams",
|
8640 | group: "textord",
|
8641 | replace: "\u25a1"
|
8642 | },
|
8643 | "\\Diamond": {
|
8644 | font: "ams",
|
8645 | group: "textord",
|
8646 | replace: "\u25ca"
|
8647 | },
|
8648 | "\\yen": {
|
8649 | font: "ams",
|
8650 | group: "textord",
|
8651 | replace: "\u00a5"
|
8652 | },
|
8653 | "\\checkmark": {
|
8654 | font: "ams",
|
8655 | group: "textord",
|
8656 | replace: "\u2713"
|
8657 | },
|
8658 |
|
8659 | // AMS Hebrew
|
8660 | "\\beth": {
|
8661 | font: "ams",
|
8662 | group: "textord",
|
8663 | replace: "\u2136"
|
8664 | },
|
8665 | "\\daleth": {
|
8666 | font: "ams",
|
8667 | group: "textord",
|
8668 | replace: "\u2138"
|
8669 | },
|
8670 | "\\gimel": {
|
8671 | font: "ams",
|
8672 | group: "textord",
|
8673 | replace: "\u2137"
|
8674 | },
|
8675 |
|
8676 | // AMS Greek
|
8677 | "\\digamma": {
|
8678 | font: "ams",
|
8679 | group: "textord",
|
8680 | replace: "\u03dd"
|
8681 | },
|
8682 | "\\varkappa": {
|
8683 | font: "ams",
|
8684 | group: "textord",
|
8685 | replace: "\u03f0"
|
8686 | },
|
8687 |
|
8688 | // AMS Delimiters
|
8689 | "\\ulcorner": {
|
8690 | font: "ams",
|
8691 | group: "open",
|
8692 | replace: "\u250c"
|
8693 | },
|
8694 | "\\urcorner": {
|
8695 | font: "ams",
|
8696 | group: "close",
|
8697 | replace: "\u2510"
|
8698 | },
|
8699 | "\\llcorner": {
|
8700 | font: "ams",
|
8701 | group: "open",
|
8702 | replace: "\u2514"
|
8703 | },
|
8704 | "\\lrcorner": {
|
8705 | font: "ams",
|
8706 | group: "close",
|
8707 | replace: "\u2518"
|
8708 | },
|
8709 |
|
8710 | // AMS Binary Relations
|
8711 | "\\leqq": {
|
8712 | font: "ams",
|
8713 | group: "rel",
|
8714 | replace: "\u2266"
|
8715 | },
|
8716 | "\\leqslant": {
|
8717 | font: "ams",
|
8718 | group: "rel",
|
8719 | replace: "\u2a7d"
|
8720 | },
|
8721 | "\\eqslantless": {
|
8722 | font: "ams",
|
8723 | group: "rel",
|
8724 | replace: "\u2a95"
|
8725 | },
|
8726 | "\\lesssim": {
|
8727 | font: "ams",
|
8728 | group: "rel",
|
8729 | replace: "\u2272"
|
8730 | },
|
8731 | "\\lessapprox": {
|
8732 | font: "ams",
|
8733 | group: "rel",
|
8734 | replace: "\u2a85"
|
8735 | },
|
8736 | "\\approxeq": {
|
8737 | font: "ams",
|
8738 | group: "rel",
|
8739 | replace: "\u224a"
|
8740 | },
|
8741 | "\\lessdot": {
|
8742 | font: "ams",
|
8743 | group: "bin",
|
8744 | replace: "\u22d6"
|
8745 | },
|
8746 | "\\lll": {
|
8747 | font: "ams",
|
8748 | group: "rel",
|
8749 | replace: "\u22d8"
|
8750 | },
|
8751 | "\\lessgtr": {
|
8752 | font: "ams",
|
8753 | group: "rel",
|
8754 | replace: "\u2276"
|
8755 | },
|
8756 | "\\lesseqgtr": {
|
8757 | font: "ams",
|
8758 | group: "rel",
|
8759 | replace: "\u22da"
|
8760 | },
|
8761 | "\\lesseqqgtr": {
|
8762 | font: "ams",
|
8763 | group: "rel",
|
8764 | replace: "\u2a8b"
|
8765 | },
|
8766 | "\\doteqdot": {
|
8767 | font: "ams",
|
8768 | group: "rel",
|
8769 | replace: "\u2251"
|
8770 | },
|
8771 | "\\risingdotseq": {
|
8772 | font: "ams",
|
8773 | group: "rel",
|
8774 | replace: "\u2253"
|
8775 | },
|
8776 | "\\fallingdotseq": {
|
8777 | font: "ams",
|
8778 | group: "rel",
|
8779 | replace: "\u2252"
|
8780 | },
|
8781 | "\\backsim": {
|
8782 | font: "ams",
|
8783 | group: "rel",
|
8784 | replace: "\u223d"
|
8785 | },
|
8786 | "\\backsimeq": {
|
8787 | font: "ams",
|
8788 | group: "rel",
|
8789 | replace: "\u22cd"
|
8790 | },
|
8791 | "\\subseteqq": {
|
8792 | font: "ams",
|
8793 | group: "rel",
|
8794 | replace: "\u2ac5"
|
8795 | },
|
8796 | "\\Subset": {
|
8797 | font: "ams",
|
8798 | group: "rel",
|
8799 | replace: "\u22d0"
|
8800 | },
|
8801 | "\\sqsubset": {
|
8802 | font: "ams",
|
8803 | group: "rel",
|
8804 | replace: "\u228f"
|
8805 | },
|
8806 | "\\preccurlyeq": {
|
8807 | font: "ams",
|
8808 | group: "rel",
|
8809 | replace: "\u227c"
|
8810 | },
|
8811 | "\\curlyeqprec": {
|
8812 | font: "ams",
|
8813 | group: "rel",
|
8814 | replace: "\u22de"
|
8815 | },
|
8816 | "\\precsim": {
|
8817 | font: "ams",
|
8818 | group: "rel",
|
8819 | replace: "\u227e"
|
8820 | },
|
8821 | "\\precapprox": {
|
8822 | font: "ams",
|
8823 | group: "rel",
|
8824 | replace: "\u2ab7"
|
8825 | },
|
8826 | "\\vartriangleleft": {
|
8827 | font: "ams",
|
8828 | group: "rel",
|
8829 | replace: "\u22b2"
|
8830 | },
|
8831 | "\\trianglelefteq": {
|
8832 | font: "ams",
|
8833 | group: "rel",
|
8834 | replace: "\u22b4"
|
8835 | },
|
8836 | "\\vDash": {
|
8837 | font: "ams",
|
8838 | group: "rel",
|
8839 | replace: "\u22a8"
|
8840 | },
|
8841 | "\\Vvdash": {
|
8842 | font: "ams",
|
8843 | group: "rel",
|
8844 | replace: "\u22aa"
|
8845 | },
|
8846 | "\\smallsmile": {
|
8847 | font: "ams",
|
8848 | group: "rel",
|
8849 | replace: "\u2323"
|
8850 | },
|
8851 | "\\smallfrown": {
|
8852 | font: "ams",
|
8853 | group: "rel",
|
8854 | replace: "\u2322"
|
8855 | },
|
8856 | "\\bumpeq": {
|
8857 | font: "ams",
|
8858 | group: "rel",
|
8859 | replace: "\u224f"
|
8860 | },
|
8861 | "\\Bumpeq": {
|
8862 | font: "ams",
|
8863 | group: "rel",
|
8864 | replace: "\u224e"
|
8865 | },
|
8866 | "\\geqq": {
|
8867 | font: "ams",
|
8868 | group: "rel",
|
8869 | replace: "\u2267"
|
8870 | },
|
8871 | "\\geqslant": {
|
8872 | font: "ams",
|
8873 | group: "rel",
|
8874 | replace: "\u2a7e"
|
8875 | },
|
8876 | "\\eqslantgtr": {
|
8877 | font: "ams",
|
8878 | group: "rel",
|
8879 | replace: "\u2a96"
|
8880 | },
|
8881 | "\\gtrsim": {
|
8882 | font: "ams",
|
8883 | group: "rel",
|
8884 | replace: "\u2273"
|
8885 | },
|
8886 | "\\gtrapprox": {
|
8887 | font: "ams",
|
8888 | group: "rel",
|
8889 | replace: "\u2a86"
|
8890 | },
|
8891 | "\\gtrdot": {
|
8892 | font: "ams",
|
8893 | group: "bin",
|
8894 | replace: "\u22d7"
|
8895 | },
|
8896 | "\\ggg": {
|
8897 | font: "ams",
|
8898 | group: "rel",
|
8899 | replace: "\u22d9"
|
8900 | },
|
8901 | "\\gtrless": {
|
8902 | font: "ams",
|
8903 | group: "rel",
|
8904 | replace: "\u2277"
|
8905 | },
|
8906 | "\\gtreqless": {
|
8907 | font: "ams",
|
8908 | group: "rel",
|
8909 | replace: "\u22db"
|
8910 | },
|
8911 | "\\gtreqqless": {
|
8912 | font: "ams",
|
8913 | group: "rel",
|
8914 | replace: "\u2a8c"
|
8915 | },
|
8916 | "\\eqcirc": {
|
8917 | font: "ams",
|
8918 | group: "rel",
|
8919 | replace: "\u2256"
|
8920 | },
|
8921 | "\\circeq": {
|
8922 | font: "ams",
|
8923 | group: "rel",
|
8924 | replace: "\u2257"
|
8925 | },
|
8926 | "\\triangleq": {
|
8927 | font: "ams",
|
8928 | group: "rel",
|
8929 | replace: "\u225c"
|
8930 | },
|
8931 | "\\thicksim": {
|
8932 | font: "ams",
|
8933 | group: "rel",
|
8934 | replace: "\u223c"
|
8935 | },
|
8936 | "\\thickapprox": {
|
8937 | font: "ams",
|
8938 | group: "rel",
|
8939 | replace: "\u2248"
|
8940 | },
|
8941 | "\\supseteqq": {
|
8942 | font: "ams",
|
8943 | group: "rel",
|
8944 | replace: "\u2ac6"
|
8945 | },
|
8946 | "\\Supset": {
|
8947 | font: "ams",
|
8948 | group: "rel",
|
8949 | replace: "\u22d1"
|
8950 | },
|
8951 | "\\sqsupset": {
|
8952 | font: "ams",
|
8953 | group: "rel",
|
8954 | replace: "\u2290"
|
8955 | },
|
8956 | "\\succcurlyeq": {
|
8957 | font: "ams",
|
8958 | group: "rel",
|
8959 | replace: "\u227d"
|
8960 | },
|
8961 | "\\curlyeqsucc": {
|
8962 | font: "ams",
|
8963 | group: "rel",
|
8964 | replace: "\u22df"
|
8965 | },
|
8966 | "\\succsim": {
|
8967 | font: "ams",
|
8968 | group: "rel",
|
8969 | replace: "\u227f"
|
8970 | },
|
8971 | "\\succapprox": {
|
8972 | font: "ams",
|
8973 | group: "rel",
|
8974 | replace: "\u2ab8"
|
8975 | },
|
8976 | "\\vartriangleright": {
|
8977 | font: "ams",
|
8978 | group: "rel",
|
8979 | replace: "\u22b3"
|
8980 | },
|
8981 | "\\trianglerighteq": {
|
8982 | font: "ams",
|
8983 | group: "rel",
|
8984 | replace: "\u22b5"
|
8985 | },
|
8986 | "\\Vdash": {
|
8987 | font: "ams",
|
8988 | group: "rel",
|
8989 | replace: "\u22a9"
|
8990 | },
|
8991 | "\\shortmid": {
|
8992 | font: "ams",
|
8993 | group: "rel",
|
8994 | replace: "\u2223"
|
8995 | },
|
8996 | "\\shortparallel": {
|
8997 | font: "ams",
|
8998 | group: "rel",
|
8999 | replace: "\u2225"
|
9000 | },
|
9001 | "\\between": {
|
9002 | font: "ams",
|
9003 | group: "rel",
|
9004 | replace: "\u226c"
|
9005 | },
|
9006 | "\\pitchfork": {
|
9007 | font: "ams",
|
9008 | group: "rel",
|
9009 | replace: "\u22d4"
|
9010 | },
|
9011 | "\\varpropto": {
|
9012 | font: "ams",
|
9013 | group: "rel",
|
9014 | replace: "\u221d"
|
9015 | },
|
9016 | "\\blacktriangleleft": {
|
9017 | font: "ams",
|
9018 | group: "rel",
|
9019 | replace: "\u25c0"
|
9020 | },
|
9021 | "\\therefore": {
|
9022 | font: "ams",
|
9023 | group: "rel",
|
9024 | replace: "\u2234"
|
9025 | },
|
9026 | "\\backepsilon": {
|
9027 | font: "ams",
|
9028 | group: "rel",
|
9029 | replace: "\u220d"
|
9030 | },
|
9031 | "\\blacktriangleright": {
|
9032 | font: "ams",
|
9033 | group: "rel",
|
9034 | replace: "\u25b6"
|
9035 | },
|
9036 | "\\because": {
|
9037 | font: "ams",
|
9038 | group: "rel",
|
9039 | replace: "\u2235"
|
9040 | },
|
9041 | "\\llless": {
|
9042 | font: "ams",
|
9043 | group: "rel",
|
9044 | replace: "\u22d8"
|
9045 | },
|
9046 | "\\gggtr": {
|
9047 | font: "ams",
|
9048 | group: "rel",
|
9049 | replace: "\u22d9"
|
9050 | },
|
9051 | "\\lhd": {
|
9052 | font: "ams",
|
9053 | group: "bin",
|
9054 | replace: "\u22b2"
|
9055 | },
|
9056 | "\\rhd": {
|
9057 | font: "ams",
|
9058 | group: "bin",
|
9059 | replace: "\u22b3"
|
9060 | },
|
9061 | "\\eqsim": {
|
9062 | font: "ams",
|
9063 | group: "rel",
|
9064 | replace: "\u2242"
|
9065 | },
|
9066 | "\\Join": {
|
9067 | font: "main",
|
9068 | group: "rel",
|
9069 | replace: "\u22c8"
|
9070 | },
|
9071 | "\\Doteq": {
|
9072 | font: "ams",
|
9073 | group: "rel",
|
9074 | replace: "\u2251"
|
9075 | },
|
9076 |
|
9077 | // AMS Binary Operators
|
9078 | "\\dotplus": {
|
9079 | font: "ams",
|
9080 | group: "bin",
|
9081 | replace: "\u2214"
|
9082 | },
|
9083 | "\\smallsetminus": {
|
9084 | font: "ams",
|
9085 | group: "bin",
|
9086 | replace: "\u2216"
|
9087 | },
|
9088 | "\\Cap": {
|
9089 | font: "ams",
|
9090 | group: "bin",
|
9091 | replace: "\u22d2"
|
9092 | },
|
9093 | "\\Cup": {
|
9094 | font: "ams",
|
9095 | group: "bin",
|
9096 | replace: "\u22d3"
|
9097 | },
|
9098 | "\\doublebarwedge": {
|
9099 | font: "ams",
|
9100 | group: "bin",
|
9101 | replace: "\u2a5e"
|
9102 | },
|
9103 | "\\boxminus": {
|
9104 | font: "ams",
|
9105 | group: "bin",
|
9106 | replace: "\u229f"
|
9107 | },
|
9108 | "\\boxplus": {
|
9109 | font: "ams",
|
9110 | group: "bin",
|
9111 | replace: "\u229e"
|
9112 | },
|
9113 | "\\divideontimes": {
|
9114 | font: "ams",
|
9115 | group: "bin",
|
9116 | replace: "\u22c7"
|
9117 | },
|
9118 | "\\ltimes": {
|
9119 | font: "ams",
|
9120 | group: "bin",
|
9121 | replace: "\u22c9"
|
9122 | },
|
9123 | "\\rtimes": {
|
9124 | font: "ams",
|
9125 | group: "bin",
|
9126 | replace: "\u22ca"
|
9127 | },
|
9128 | "\\leftthreetimes": {
|
9129 | font: "ams",
|
9130 | group: "bin",
|
9131 | replace: "\u22cb"
|
9132 | },
|
9133 | "\\rightthreetimes": {
|
9134 | font: "ams",
|
9135 | group: "bin",
|
9136 | replace: "\u22cc"
|
9137 | },
|
9138 | "\\curlywedge": {
|
9139 | font: "ams",
|
9140 | group: "bin",
|
9141 | replace: "\u22cf"
|
9142 | },
|
9143 | "\\curlyvee": {
|
9144 | font: "ams",
|
9145 | group: "bin",
|
9146 | replace: "\u22ce"
|
9147 | },
|
9148 | "\\circleddash": {
|
9149 | font: "ams",
|
9150 | group: "bin",
|
9151 | replace: "\u229d"
|
9152 | },
|
9153 | "\\circledast": {
|
9154 | font: "ams",
|
9155 | group: "bin",
|
9156 | replace: "\u229b"
|
9157 | },
|
9158 | "\\centerdot": {
|
9159 | font: "ams",
|
9160 | group: "bin",
|
9161 | replace: "\u22c5"
|
9162 | },
|
9163 | "\\intercal": {
|
9164 | font: "ams",
|
9165 | group: "bin",
|
9166 | replace: "\u22ba"
|
9167 | },
|
9168 | "\\doublecap": {
|
9169 | font: "ams",
|
9170 | group: "bin",
|
9171 | replace: "\u22d2"
|
9172 | },
|
9173 | "\\doublecup": {
|
9174 | font: "ams",
|
9175 | group: "bin",
|
9176 | replace: "\u22d3"
|
9177 | },
|
9178 | "\\boxtimes": {
|
9179 | font: "ams",
|
9180 | group: "bin",
|
9181 | replace: "\u22a0"
|
9182 | },
|
9183 |
|
9184 | // AMS Arrows
|
9185 | "\\dashrightarrow": {
|
9186 | font: "ams",
|
9187 | group: "rel",
|
9188 | replace: "\u21e2"
|
9189 | },
|
9190 | "\\dashleftarrow": {
|
9191 | font: "ams",
|
9192 | group: "rel",
|
9193 | replace: "\u21e0"
|
9194 | },
|
9195 | "\\leftleftarrows": {
|
9196 | font: "ams",
|
9197 | group: "rel",
|
9198 | replace: "\u21c7"
|
9199 | },
|
9200 | "\\leftrightarrows": {
|
9201 | font: "ams",
|
9202 | group: "rel",
|
9203 | replace: "\u21c6"
|
9204 | },
|
9205 | "\\Lleftarrow": {
|
9206 | font: "ams",
|
9207 | group: "rel",
|
9208 | replace: "\u21da"
|
9209 | },
|
9210 | "\\twoheadleftarrow": {
|
9211 | font: "ams",
|
9212 | group: "rel",
|
9213 | replace: "\u219e"
|
9214 | },
|
9215 | "\\leftarrowtail": {
|
9216 | font: "ams",
|
9217 | group: "rel",
|
9218 | replace: "\u21a2"
|
9219 | },
|
9220 | "\\looparrowleft": {
|
9221 | font: "ams",
|
9222 | group: "rel",
|
9223 | replace: "\u21ab"
|
9224 | },
|
9225 | "\\leftrightharpoons": {
|
9226 | font: "ams",
|
9227 | group: "rel",
|
9228 | replace: "\u21cb"
|
9229 | },
|
9230 | "\\curvearrowleft": {
|
9231 | font: "ams",
|
9232 | group: "rel",
|
9233 | replace: "\u21b6"
|
9234 | },
|
9235 | "\\circlearrowleft": {
|
9236 | font: "ams",
|
9237 | group: "rel",
|
9238 | replace: "\u21ba"
|
9239 | },
|
9240 | "\\Lsh": {
|
9241 | font: "ams",
|
9242 | group: "rel",
|
9243 | replace: "\u21b0"
|
9244 | },
|
9245 | "\\upuparrows": {
|
9246 | font: "ams",
|
9247 | group: "rel",
|
9248 | replace: "\u21c8"
|
9249 | },
|
9250 | "\\upharpoonleft": {
|
9251 | font: "ams",
|
9252 | group: "rel",
|
9253 | replace: "\u21bf"
|
9254 | },
|
9255 | "\\downharpoonleft": {
|
9256 | font: "ams",
|
9257 | group: "rel",
|
9258 | replace: "\u21c3"
|
9259 | },
|
9260 | "\\multimap": {
|
9261 | font: "ams",
|
9262 | group: "rel",
|
9263 | replace: "\u22b8"
|
9264 | },
|
9265 | "\\leftrightsquigarrow": {
|
9266 | font: "ams",
|
9267 | group: "rel",
|
9268 | replace: "\u21ad"
|
9269 | },
|
9270 | "\\rightrightarrows": {
|
9271 | font: "ams",
|
9272 | group: "rel",
|
9273 | replace: "\u21c9"
|
9274 | },
|
9275 | "\\rightleftarrows": {
|
9276 | font: "ams",
|
9277 | group: "rel",
|
9278 | replace: "\u21c4"
|
9279 | },
|
9280 | "\\twoheadrightarrow": {
|
9281 | font: "ams",
|
9282 | group: "rel",
|
9283 | replace: "\u21a0"
|
9284 | },
|
9285 | "\\rightarrowtail": {
|
9286 | font: "ams",
|
9287 | group: "rel",
|
9288 | replace: "\u21a3"
|
9289 | },
|
9290 | "\\looparrowright": {
|
9291 | font: "ams",
|
9292 | group: "rel",
|
9293 | replace: "\u21ac"
|
9294 | },
|
9295 | "\\curvearrowright": {
|
9296 | font: "ams",
|
9297 | group: "rel",
|
9298 | replace: "\u21b7"
|
9299 | },
|
9300 | "\\circlearrowright": {
|
9301 | font: "ams",
|
9302 | group: "rel",
|
9303 | replace: "\u21bb"
|
9304 | },
|
9305 | "\\Rsh": {
|
9306 | font: "ams",
|
9307 | group: "rel",
|
9308 | replace: "\u21b1"
|
9309 | },
|
9310 | "\\downdownarrows": {
|
9311 | font: "ams",
|
9312 | group: "rel",
|
9313 | replace: "\u21ca"
|
9314 | },
|
9315 | "\\upharpoonright": {
|
9316 | font: "ams",
|
9317 | group: "rel",
|
9318 | replace: "\u21be"
|
9319 | },
|
9320 | "\\downharpoonright": {
|
9321 | font: "ams",
|
9322 | group: "rel",
|
9323 | replace: "\u21c2"
|
9324 | },
|
9325 | "\\rightsquigarrow": {
|
9326 | font: "ams",
|
9327 | group: "rel",
|
9328 | replace: "\u21dd"
|
9329 | },
|
9330 | "\\leadsto": {
|
9331 | font: "ams",
|
9332 | group: "rel",
|
9333 | replace: "\u21dd"
|
9334 | },
|
9335 | "\\Rrightarrow": {
|
9336 | font: "ams",
|
9337 | group: "rel",
|
9338 | replace: "\u21db"
|
9339 | },
|
9340 | "\\restriction": {
|
9341 | font: "ams",
|
9342 | group: "rel",
|
9343 | replace: "\u21be"
|
9344 | },
|
9345 |
|
9346 | "`": {
|
9347 | font: "main",
|
9348 | group: "textord",
|
9349 | replace: "\u2018"
|
9350 | },
|
9351 | "\\$": {
|
9352 | font: "main",
|
9353 | group: "textord",
|
9354 | replace: "$"
|
9355 | },
|
9356 | "\\%": {
|
9357 | font: "main",
|
9358 | group: "textord",
|
9359 | replace: "%"
|
9360 | },
|
9361 | "\\_": {
|
9362 | font: "main",
|
9363 | group: "textord",
|
9364 | replace: "_"
|
9365 | },
|
9366 | "\\angle": {
|
9367 | font: "main",
|
9368 | group: "textord",
|
9369 | replace: "\u2220"
|
9370 | },
|
9371 | "\\infty": {
|
9372 | font: "main",
|
9373 | group: "textord",
|
9374 | replace: "\u221e"
|
9375 | },
|
9376 | "\\prime": {
|
9377 | font: "main",
|
9378 | group: "textord",
|
9379 | replace: "\u2032"
|
9380 | },
|
9381 | "\\triangle": {
|
9382 | font: "main",
|
9383 | group: "textord",
|
9384 | replace: "\u25b3"
|
9385 | },
|
9386 | "\\Gamma": {
|
9387 | font: "main",
|
9388 | group: "textord",
|
9389 | replace: "\u0393"
|
9390 | },
|
9391 | "\\Delta": {
|
9392 | font: "main",
|
9393 | group: "textord",
|
9394 | replace: "\u0394"
|
9395 | },
|
9396 | "\\Theta": {
|
9397 | font: "main",
|
9398 | group: "textord",
|
9399 | replace: "\u0398"
|
9400 | },
|
9401 | "\\Lambda": {
|
9402 | font: "main",
|
9403 | group: "textord",
|
9404 | replace: "\u039b"
|
9405 | },
|
9406 | "\\Xi": {
|
9407 | font: "main",
|
9408 | group: "textord",
|
9409 | replace: "\u039e"
|
9410 | },
|
9411 | "\\Pi": {
|
9412 | font: "main",
|
9413 | group: "textord",
|
9414 | replace: "\u03a0"
|
9415 | },
|
9416 | "\\Sigma": {
|
9417 | font: "main",
|
9418 | group: "textord",
|
9419 | replace: "\u03a3"
|
9420 | },
|
9421 | "\\Upsilon": {
|
9422 | font: "main",
|
9423 | group: "textord",
|
9424 | replace: "\u03a5"
|
9425 | },
|
9426 | "\\Phi": {
|
9427 | font: "main",
|
9428 | group: "textord",
|
9429 | replace: "\u03a6"
|
9430 | },
|
9431 | "\\Psi": {
|
9432 | font: "main",
|
9433 | group: "textord",
|
9434 | replace: "\u03a8"
|
9435 | },
|
9436 | "\\Omega": {
|
9437 | font: "main",
|
9438 | group: "textord",
|
9439 | replace: "\u03a9"
|
9440 | },
|
9441 | "\\neg": {
|
9442 | font: "main",
|
9443 | group: "textord",
|
9444 | replace: "\u00ac"
|
9445 | },
|
9446 | "\\lnot": {
|
9447 | font: "main",
|
9448 | group: "textord",
|
9449 | replace: "\u00ac"
|
9450 | },
|
9451 | "\\top": {
|
9452 | font: "main",
|
9453 | group: "textord",
|
9454 | replace: "\u22a4"
|
9455 | },
|
9456 | "\\bot": {
|
9457 | font: "main",
|
9458 | group: "textord",
|
9459 | replace: "\u22a5"
|
9460 | },
|
9461 | "\\emptyset": {
|
9462 | font: "main",
|
9463 | group: "textord",
|
9464 | replace: "\u2205"
|
9465 | },
|
9466 | "\\varnothing": {
|
9467 | font: "ams",
|
9468 | group: "textord",
|
9469 | replace: "\u2205"
|
9470 | },
|
9471 | "\\alpha": {
|
9472 | font: "main",
|
9473 | group: "mathord",
|
9474 | replace: "\u03b1"
|
9475 | },
|
9476 | "\\beta": {
|
9477 | font: "main",
|
9478 | group: "mathord",
|
9479 | replace: "\u03b2"
|
9480 | },
|
9481 | "\\gamma": {
|
9482 | font: "main",
|
9483 | group: "mathord",
|
9484 | replace: "\u03b3"
|
9485 | },
|
9486 | "\\delta": {
|
9487 | font: "main",
|
9488 | group: "mathord",
|
9489 | replace: "\u03b4"
|
9490 | },
|
9491 | "\\epsilon": {
|
9492 | font: "main",
|
9493 | group: "mathord",
|
9494 | replace: "\u03f5"
|
9495 | },
|
9496 | "\\zeta": {
|
9497 | font: "main",
|
9498 | group: "mathord",
|
9499 | replace: "\u03b6"
|
9500 | },
|
9501 | "\\eta": {
|
9502 | font: "main",
|
9503 | group: "mathord",
|
9504 | replace: "\u03b7"
|
9505 | },
|
9506 | "\\theta": {
|
9507 | font: "main",
|
9508 | group: "mathord",
|
9509 | replace: "\u03b8"
|
9510 | },
|
9511 | "\\iota": {
|
9512 | font: "main",
|
9513 | group: "mathord",
|
9514 | replace: "\u03b9"
|
9515 | },
|
9516 | "\\kappa": {
|
9517 | font: "main",
|
9518 | group: "mathord",
|
9519 | replace: "\u03ba"
|
9520 | },
|
9521 | "\\lambda": {
|
9522 | font: "main",
|
9523 | group: "mathord",
|
9524 | replace: "\u03bb"
|
9525 | },
|
9526 | "\\mu": {
|
9527 | font: "main",
|
9528 | group: "mathord",
|
9529 | replace: "\u03bc"
|
9530 | },
|
9531 | "\\nu": {
|
9532 | font: "main",
|
9533 | group: "mathord",
|
9534 | replace: "\u03bd"
|
9535 | },
|
9536 | "\\xi": {
|
9537 | font: "main",
|
9538 | group: "mathord",
|
9539 | replace: "\u03be"
|
9540 | },
|
9541 | "\\omicron": {
|
9542 | font: "main",
|
9543 | group: "mathord",
|
9544 | replace: "o"
|
9545 | },
|
9546 | "\\pi": {
|
9547 | font: "main",
|
9548 | group: "mathord",
|
9549 | replace: "\u03c0"
|
9550 | },
|
9551 | "\\rho": {
|
9552 | font: "main",
|
9553 | group: "mathord",
|
9554 | replace: "\u03c1"
|
9555 | },
|
9556 | "\\sigma": {
|
9557 | font: "main",
|
9558 | group: "mathord",
|
9559 | replace: "\u03c3"
|
9560 | },
|
9561 | "\\tau": {
|
9562 | font: "main",
|
9563 | group: "mathord",
|
9564 | replace: "\u03c4"
|
9565 | },
|
9566 | "\\upsilon": {
|
9567 | font: "main",
|
9568 | group: "mathord",
|
9569 | replace: "\u03c5"
|
9570 | },
|
9571 | "\\phi": {
|
9572 | font: "main",
|
9573 | group: "mathord",
|
9574 | replace: "\u03d5"
|
9575 | },
|
9576 | "\\chi": {
|
9577 | font: "main",
|
9578 | group: "mathord",
|
9579 | replace: "\u03c7"
|
9580 | },
|
9581 | "\\psi": {
|
9582 | font: "main",
|
9583 | group: "mathord",
|
9584 | replace: "\u03c8"
|
9585 | },
|
9586 | "\\omega": {
|
9587 | font: "main",
|
9588 | group: "mathord",
|
9589 | replace: "\u03c9"
|
9590 | },
|
9591 | "\\varepsilon": {
|
9592 | font: "main",
|
9593 | group: "mathord",
|
9594 | replace: "\u03b5"
|
9595 | },
|
9596 | "\\vartheta": {
|
9597 | font: "main",
|
9598 | group: "mathord",
|
9599 | replace: "\u03d1"
|
9600 | },
|
9601 | "\\varpi": {
|
9602 | font: "main",
|
9603 | group: "mathord",
|
9604 | replace: "\u03d6"
|
9605 | },
|
9606 | "\\varrho": {
|
9607 | font: "main",
|
9608 | group: "mathord",
|
9609 | replace: "\u03f1"
|
9610 | },
|
9611 | "\\varsigma": {
|
9612 | font: "main",
|
9613 | group: "mathord",
|
9614 | replace: "\u03c2"
|
9615 | },
|
9616 | "\\varphi": {
|
9617 | font: "main",
|
9618 | group: "mathord",
|
9619 | replace: "\u03c6"
|
9620 | },
|
9621 | "*": {
|
9622 | font: "main",
|
9623 | group: "bin",
|
9624 | replace: "\u2217"
|
9625 | },
|
9626 | "+": {
|
9627 | font: "main",
|
9628 | group: "bin"
|
9629 | },
|
9630 | "-": {
|
9631 | font: "main",
|
9632 | group: "bin",
|
9633 | replace: "\u2212"
|
9634 | },
|
9635 | "\\cdot": {
|
9636 | font: "main",
|
9637 | group: "bin",
|
9638 | replace: "\u22c5"
|
9639 | },
|
9640 | "\\circ": {
|
9641 | font: "main",
|
9642 | group: "bin",
|
9643 | replace: "\u2218"
|
9644 | },
|
9645 | "\\div": {
|
9646 | font: "main",
|
9647 | group: "bin",
|
9648 | replace: "\u00f7"
|
9649 | },
|
9650 | "\\pm": {
|
9651 | font: "main",
|
9652 | group: "bin",
|
9653 | replace: "\u00b1"
|
9654 | },
|
9655 | "\\times": {
|
9656 | font: "main",
|
9657 | group: "bin",
|
9658 | replace: "\u00d7"
|
9659 | },
|
9660 | "\\cap": {
|
9661 | font: "main",
|
9662 | group: "bin",
|
9663 | replace: "\u2229"
|
9664 | },
|
9665 | "\\cup": {
|
9666 | font: "main",
|
9667 | group: "bin",
|
9668 | replace: "\u222a"
|
9669 | },
|
9670 | "\\setminus": {
|
9671 | font: "main",
|
9672 | group: "bin",
|
9673 | replace: "\u2216"
|
9674 | },
|
9675 | "\\land": {
|
9676 | font: "main",
|
9677 | group: "bin",
|
9678 | replace: "\u2227"
|
9679 | },
|
9680 | "\\lor": {
|
9681 | font: "main",
|
9682 | group: "bin",
|
9683 | replace: "\u2228"
|
9684 | },
|
9685 | "\\wedge": {
|
9686 | font: "main",
|
9687 | group: "bin",
|
9688 | replace: "\u2227"
|
9689 | },
|
9690 | "\\vee": {
|
9691 | font: "main",
|
9692 | group: "bin",
|
9693 | replace: "\u2228"
|
9694 | },
|
9695 | "\\surd": {
|
9696 | font: "main",
|
9697 | group: "textord",
|
9698 | replace: "\u221a"
|
9699 | },
|
9700 | "(": {
|
9701 | font: "main",
|
9702 | group: "open"
|
9703 | },
|
9704 | "[": {
|
9705 | font: "main",
|
9706 | group: "open"
|
9707 | },
|
9708 | "\\langle": {
|
9709 | font: "main",
|
9710 | group: "open",
|
9711 | replace: "\u27e8"
|
9712 | },
|
9713 | "\\lvert": {
|
9714 | font: "main",
|
9715 | group: "open",
|
9716 | replace: "\u2223"
|
9717 | },
|
9718 | "\\lVert": {
|
9719 | font: "main",
|
9720 | group: "open",
|
9721 | replace: "\u2225"
|
9722 | },
|
9723 | ")": {
|
9724 | font: "main",
|
9725 | group: "close"
|
9726 | },
|
9727 | "]": {
|
9728 | font: "main",
|
9729 | group: "close"
|
9730 | },
|
9731 | "?": {
|
9732 | font: "main",
|
9733 | group: "close"
|
9734 | },
|
9735 | "!": {
|
9736 | font: "main",
|
9737 | group: "close"
|
9738 | },
|
9739 | "\\rangle": {
|
9740 | font: "main",
|
9741 | group: "close",
|
9742 | replace: "\u27e9"
|
9743 | },
|
9744 | "\\rvert": {
|
9745 | font: "main",
|
9746 | group: "close",
|
9747 | replace: "\u2223"
|
9748 | },
|
9749 | "\\rVert": {
|
9750 | font: "main",
|
9751 | group: "close",
|
9752 | replace: "\u2225"
|
9753 | },
|
9754 | "=": {
|
9755 | font: "main",
|
9756 | group: "rel"
|
9757 | },
|
9758 | "<": {
|
9759 | font: "main",
|
9760 | group: "rel"
|
9761 | },
|
9762 | ">": {
|
9763 | font: "main",
|
9764 | group: "rel"
|
9765 | },
|
9766 | ":": {
|
9767 | font: "main",
|
9768 | group: "rel"
|
9769 | },
|
9770 | "\\approx": {
|
9771 | font: "main",
|
9772 | group: "rel",
|
9773 | replace: "\u2248"
|
9774 | },
|
9775 | "\\cong": {
|
9776 | font: "main",
|
9777 | group: "rel",
|
9778 | replace: "\u2245"
|
9779 | },
|
9780 | "\\ge": {
|
9781 | font: "main",
|
9782 | group: "rel",
|
9783 | replace: "\u2265"
|
9784 | },
|
9785 | "\\geq": {
|
9786 | font: "main",
|
9787 | group: "rel",
|
9788 | replace: "\u2265"
|
9789 | },
|
9790 | "\\gets": {
|
9791 | font: "main",
|
9792 | group: "rel",
|
9793 | replace: "\u2190"
|
9794 | },
|
9795 | "\\in": {
|
9796 | font: "main",
|
9797 | group: "rel",
|
9798 | replace: "\u2208"
|
9799 | },
|
9800 | "\\notin": {
|
9801 | font: "main",
|
9802 | group: "rel",
|
9803 | replace: "\u2209"
|
9804 | },
|
9805 | "\\subset": {
|
9806 | font: "main",
|
9807 | group: "rel",
|
9808 | replace: "\u2282"
|
9809 | },
|
9810 | "\\supset": {
|
9811 | font: "main",
|
9812 | group: "rel",
|
9813 | replace: "\u2283"
|
9814 | },
|
9815 | "\\subseteq": {
|
9816 | font: "main",
|
9817 | group: "rel",
|
9818 | replace: "\u2286"
|
9819 | },
|
9820 | "\\supseteq": {
|
9821 | font: "main",
|
9822 | group: "rel",
|
9823 | replace: "\u2287"
|
9824 | },
|
9825 | "\\nsubseteq": {
|
9826 | font: "ams",
|
9827 | group: "rel",
|
9828 | replace: "\u2288"
|
9829 | },
|
9830 | "\\nsupseteq": {
|
9831 | font: "ams",
|
9832 | group: "rel",
|
9833 | replace: "\u2289"
|
9834 | },
|
9835 | "\\models": {
|
9836 | font: "main",
|
9837 | group: "rel",
|
9838 | replace: "\u22a8"
|
9839 | },
|
9840 | "\\leftarrow": {
|
9841 | font: "main",
|
9842 | group: "rel",
|
9843 | replace: "\u2190"
|
9844 | },
|
9845 | "\\le": {
|
9846 | font: "main",
|
9847 | group: "rel",
|
9848 | replace: "\u2264"
|
9849 | },
|
9850 | "\\leq": {
|
9851 | font: "main",
|
9852 | group: "rel",
|
9853 | replace: "\u2264"
|
9854 | },
|
9855 | "\\ne": {
|
9856 | font: "main",
|
9857 | group: "rel",
|
9858 | replace: "\u2260"
|
9859 | },
|
9860 | "\\neq": {
|
9861 | font: "main",
|
9862 | group: "rel",
|
9863 | replace: "\u2260"
|
9864 | },
|
9865 | "\\rightarrow": {
|
9866 | font: "main",
|
9867 | group: "rel",
|
9868 | replace: "\u2192"
|
9869 | },
|
9870 | "\\to": {
|
9871 | font: "main",
|
9872 | group: "rel",
|
9873 | replace: "\u2192"
|
9874 | },
|
9875 | "\\ngeq": {
|
9876 | font: "ams",
|
9877 | group: "rel",
|
9878 | replace: "\u2271"
|
9879 | },
|
9880 | "\\nleq": {
|
9881 | font: "ams",
|
9882 | group: "rel",
|
9883 | replace: "\u2270"
|
9884 | },
|
9885 | "\\!": {
|
9886 | font: "main",
|
9887 | group: "spacing"
|
9888 | },
|
9889 | "\\ ": {
|
9890 | font: "main",
|
9891 | group: "spacing",
|
9892 | replace: "\u00a0"
|
9893 | },
|
9894 | "~": {
|
9895 | font: "main",
|
9896 | group: "spacing",
|
9897 | replace: "\u00a0"
|
9898 | },
|
9899 | "\\,": {
|
9900 | font: "main",
|
9901 | group: "spacing"
|
9902 | },
|
9903 | "\\:": {
|
9904 | font: "main",
|
9905 | group: "spacing"
|
9906 | },
|
9907 | "\\;": {
|
9908 | font: "main",
|
9909 | group: "spacing"
|
9910 | },
|
9911 | "\\enspace": {
|
9912 | font: "main",
|
9913 | group: "spacing"
|
9914 | },
|
9915 | "\\qquad": {
|
9916 | font: "main",
|
9917 | group: "spacing"
|
9918 | },
|
9919 | "\\quad": {
|
9920 | font: "main",
|
9921 | group: "spacing"
|
9922 | },
|
9923 | "\\space": {
|
9924 | font: "main",
|
9925 | group: "spacing",
|
9926 | replace: "\u00a0"
|
9927 | },
|
9928 | ",": {
|
9929 | font: "main",
|
9930 | group: "punct"
|
9931 | },
|
9932 | ";": {
|
9933 | font: "main",
|
9934 | group: "punct"
|
9935 | },
|
9936 | "\\colon": {
|
9937 | font: "main",
|
9938 | group: "punct",
|
9939 | replace: ":"
|
9940 | },
|
9941 | "\\barwedge": {
|
9942 | font: "ams",
|
9943 | group: "bin",
|
9944 | replace: "\u22bc"
|
9945 | },
|
9946 | "\\veebar": {
|
9947 | font: "ams",
|
9948 | group: "bin",
|
9949 | replace: "\u22bb"
|
9950 | },
|
9951 | "\\odot": {
|
9952 | font: "main",
|
9953 | group: "bin",
|
9954 | replace: "\u2299"
|
9955 | },
|
9956 | "\\oplus": {
|
9957 | font: "main",
|
9958 | group: "bin",
|
9959 | replace: "\u2295"
|
9960 | },
|
9961 | "\\otimes": {
|
9962 | font: "main",
|
9963 | group: "bin",
|
9964 | replace: "\u2297"
|
9965 | },
|
9966 | "\\partial":{
|
9967 | font: "main",
|
9968 | group: "textord",
|
9969 | replace: "\u2202"
|
9970 | },
|
9971 | "\\oslash": {
|
9972 | font: "main",
|
9973 | group: "bin",
|
9974 | replace: "\u2298"
|
9975 | },
|
9976 | "\\circledcirc": {
|
9977 | font: "ams",
|
9978 | group: "bin",
|
9979 | replace: "\u229a"
|
9980 | },
|
9981 | "\\boxdot": {
|
9982 | font: "ams",
|
9983 | group: "bin",
|
9984 | replace: "\u22a1"
|
9985 | },
|
9986 | "\\bigtriangleup": {
|
9987 | font: "main",
|
9988 | group: "bin",
|
9989 | replace: "\u25b3"
|
9990 | },
|
9991 | "\\bigtriangledown": {
|
9992 | font: "main",
|
9993 | group: "bin",
|
9994 | replace: "\u25bd"
|
9995 | },
|
9996 | "\\dagger": {
|
9997 | font: "main",
|
9998 | group: "bin",
|
9999 | replace: "\u2020"
|
10000 | },
|
10001 | "\\diamond": {
|
10002 | font: "main",
|
10003 | group: "bin",
|
10004 | replace: "\u22c4"
|
10005 | },
|
10006 | "\\star": {
|
10007 | font: "main",
|
10008 | group: "bin",
|
10009 | replace: "\u22c6"
|
10010 | },
|
10011 | "\\triangleleft": {
|
10012 | font: "main",
|
10013 | group: "bin",
|
10014 | replace: "\u25c3"
|
10015 | },
|
10016 | "\\triangleright": {
|
10017 | font: "main",
|
10018 | group: "bin",
|
10019 | replace: "\u25b9"
|
10020 | },
|
10021 | "\\{": {
|
10022 | font: "main",
|
10023 | group: "open",
|
10024 | replace: "{"
|
10025 | },
|
10026 | "\\}": {
|
10027 | font: "main",
|
10028 | group: "close",
|
10029 | replace: "}"
|
10030 | },
|
10031 | "\\lbrace": {
|
10032 | font: "main",
|
10033 | group: "open",
|
10034 | replace: "{"
|
10035 | },
|
10036 | "\\rbrace": {
|
10037 | font: "main",
|
10038 | group: "close",
|
10039 | replace: "}"
|
10040 | },
|
10041 | "\\lbrack": {
|
10042 | font: "main",
|
10043 | group: "open",
|
10044 | replace: "["
|
10045 | },
|
10046 | "\\rbrack": {
|
10047 | font: "main",
|
10048 | group: "close",
|
10049 | replace: "]"
|
10050 | },
|
10051 | "\\lfloor": {
|
10052 | font: "main",
|
10053 | group: "open",
|
10054 | replace: "\u230a"
|
10055 | },
|
10056 | "\\rfloor": {
|
10057 | font: "main",
|
10058 | group: "close",
|
10059 | replace: "\u230b"
|
10060 | },
|
10061 | "\\lceil": {
|
10062 | font: "main",
|
10063 | group: "open",
|
10064 | replace: "\u2308"
|
10065 | },
|
10066 | "\\rceil": {
|
10067 | font: "main",
|
10068 | group: "close",
|
10069 | replace: "\u2309"
|
10070 | },
|
10071 | "\\backslash": {
|
10072 | font: "main",
|
10073 | group: "textord",
|
10074 | replace: "\\"
|
10075 | },
|
10076 | "|": {
|
10077 | font: "main",
|
10078 | group: "textord",
|
10079 | replace: "\u2223"
|
10080 | },
|
10081 | "\\vert": {
|
10082 | font: "main",
|
10083 | group: "textord",
|
10084 | replace: "\u2223"
|
10085 | },
|
10086 | "\\|": {
|
10087 | font: "main",
|
10088 | group: "textord",
|
10089 | replace: "\u2225"
|
10090 | },
|
10091 | "\\Vert": {
|
10092 | font: "main",
|
10093 | group: "textord",
|
10094 | replace: "\u2225"
|
10095 | },
|
10096 | "\\uparrow": {
|
10097 | font: "main",
|
10098 | group: "rel",
|
10099 | replace: "\u2191"
|
10100 | },
|
10101 | "\\Uparrow": {
|
10102 | font: "main",
|
10103 | group: "rel",
|
10104 | replace: "\u21d1"
|
10105 | },
|
10106 | "\\downarrow": {
|
10107 | font: "main",
|
10108 | group: "rel",
|
10109 | replace: "\u2193"
|
10110 | },
|
10111 | "\\Downarrow": {
|
10112 | font: "main",
|
10113 | group: "rel",
|
10114 | replace: "\u21d3"
|
10115 | },
|
10116 | "\\updownarrow": {
|
10117 | font: "main",
|
10118 | group: "rel",
|
10119 | replace: "\u2195"
|
10120 | },
|
10121 | "\\Updownarrow": {
|
10122 | font: "main",
|
10123 | group: "rel",
|
10124 | replace: "\u21d5"
|
10125 | },
|
10126 | "\\coprod": {
|
10127 | font: "math",
|
10128 | group: "op",
|
10129 | replace: "\u2210"
|
10130 | },
|
10131 | "\\bigvee": {
|
10132 | font: "math",
|
10133 | group: "op",
|
10134 | replace: "\u22c1"
|
10135 | },
|
10136 | "\\bigwedge": {
|
10137 | font: "math",
|
10138 | group: "op",
|
10139 | replace: "\u22c0"
|
10140 | },
|
10141 | "\\biguplus": {
|
10142 | font: "math",
|
10143 | group: "op",
|
10144 | replace: "\u2a04"
|
10145 | },
|
10146 | "\\bigcap": {
|
10147 | font: "math",
|
10148 | group: "op",
|
10149 | replace: "\u22c2"
|
10150 | },
|
10151 | "\\bigcup": {
|
10152 | font: "math",
|
10153 | group: "op",
|
10154 | replace: "\u22c3"
|
10155 | },
|
10156 | "\\int": {
|
10157 | font: "math",
|
10158 | group: "op",
|
10159 | replace: "\u222b"
|
10160 | },
|
10161 | "\\intop": {
|
10162 | font: "math",
|
10163 | group: "op",
|
10164 | replace: "\u222b"
|
10165 | },
|
10166 | "\\iint": {
|
10167 | font: "math",
|
10168 | group: "op",
|
10169 | replace: "\u222c"
|
10170 | },
|
10171 | "\\iiint": {
|
10172 | font: "math",
|
10173 | group: "op",
|
10174 | replace: "\u222d"
|
10175 | },
|
10176 | "\\prod": {
|
10177 | font: "math",
|
10178 | group: "op",
|
10179 | replace: "\u220f"
|
10180 | },
|
10181 | "\\sum": {
|
10182 | font: "math",
|
10183 | group: "op",
|
10184 | replace: "\u2211"
|
10185 | },
|
10186 | "\\bigotimes": {
|
10187 | font: "math",
|
10188 | group: "op",
|
10189 | replace: "\u2a02"
|
10190 | },
|
10191 | "\\bigoplus": {
|
10192 | font: "math",
|
10193 | group: "op",
|
10194 | replace: "\u2a01"
|
10195 | },
|
10196 | "\\bigodot": {
|
10197 | font: "math",
|
10198 | group: "op",
|
10199 | replace: "\u2a00"
|
10200 | },
|
10201 | "\\oint": {
|
10202 | font: "math",
|
10203 | group: "op",
|
10204 | replace: "\u222e"
|
10205 | },
|
10206 | "\\bigsqcup": {
|
10207 | font: "math",
|
10208 | group: "op",
|
10209 | replace: "\u2a06"
|
10210 | },
|
10211 | "\\smallint": {
|
10212 | font: "math",
|
10213 | group: "op",
|
10214 | replace: "\u222b"
|
10215 | },
|
10216 | "\\ldots": {
|
10217 | font: "main",
|
10218 | group: "inner",
|
10219 | replace: "\u2026"
|
10220 | },
|
10221 | "\\cdots": {
|
10222 | font: "main",
|
10223 | group: "inner",
|
10224 | replace: "\u22ef"
|
10225 | },
|
10226 | "\\ddots": {
|
10227 | font: "main",
|
10228 | group: "inner",
|
10229 | replace: "\u22f1"
|
10230 | },
|
10231 | "\\vdots": {
|
10232 | font: "main",
|
10233 | group: "textord",
|
10234 | replace: "\u22ee"
|
10235 | },
|
10236 | "\\acute": {
|
10237 | font: "main",
|
10238 | group: "accent",
|
10239 | replace: "\u00b4"
|
10240 | },
|
10241 | "\\grave": {
|
10242 | font: "main",
|
10243 | group: "accent",
|
10244 | replace: "\u0060"
|
10245 | },
|
10246 | "\\ddot": {
|
10247 | font: "main",
|
10248 | group: "accent",
|
10249 | replace: "\u00a8"
|
10250 | },
|
10251 | "\\tilde": {
|
10252 | font: "main",
|
10253 | group: "accent",
|
10254 | replace: "\u007e"
|
10255 | },
|
10256 | "\\bar": {
|
10257 | font: "main",
|
10258 | group: "accent",
|
10259 | replace: "\u00af"
|
10260 | },
|
10261 | "\\breve": {
|
10262 | font: "main",
|
10263 | group: "accent",
|
10264 | replace: "\u02d8"
|
10265 | },
|
10266 | "\\check": {
|
10267 | font: "main",
|
10268 | group: "accent",
|
10269 | replace: "\u02c7"
|
10270 | },
|
10271 | "\\hat": {
|
10272 | font: "main",
|
10273 | group: "accent",
|
10274 | replace: "\u005e"
|
10275 | },
|
10276 | "\\vec": {
|
10277 | font: "main",
|
10278 | group: "accent",
|
10279 | replace: "\u20d7"
|
10280 | },
|
10281 | "\\dot": {
|
10282 | font: "main",
|
10283 | group: "accent",
|
10284 | replace: "\u02d9"
|
10285 | },
|
10286 |
|
10287 | "\\imath": {
|
10288 | font: "main",
|
10289 | group: "mathord",
|
10290 | replace: "\u0131"
|
10291 | },
|
10292 | "\\jmath": {
|
10293 | font: "main",
|
10294 | group: "mathord",
|
10295 | replace: "\u0237"
|
10296 | }
|
10297 | },
|
10298 | "text": {
|
10299 | "\\ ": {
|
10300 | font: "main",
|
10301 | group: "spacing",
|
10302 | replace: "\u00a0"
|
10303 | },
|
10304 | " ": {
|
10305 | font: "main",
|
10306 | group: "spacing",
|
10307 | replace: "\u00a0"
|
10308 | },
|
10309 | "~": {
|
10310 | font: "main",
|
10311 | group: "spacing",
|
10312 | replace: "\u00a0"
|
10313 | }
|
10314 | }
|
10315 | };
|
10316 |
|
10317 | // There are lots of symbols which are the same, so we add them in afterwards.
|
10318 |
|
10319 | // All of these are textords in math mode
|
10320 | var mathTextSymbols = "0123456789/@.\"";
|
10321 | for (var i = 0; i < mathTextSymbols.length; i++) {
|
10322 | var ch = mathTextSymbols.charAt(i);
|
10323 | symbols.math[ch] = {
|
10324 | font: "main",
|
10325 | group: "textord"
|
10326 | };
|
10327 | }
|
10328 |
|
10329 | // All of these are textords in text mode
|
10330 | var textSymbols = "0123456789`!@*()-=+[]'\";:?/.,";
|
10331 | for (var i = 0; i < textSymbols.length; i++) {
|
10332 | var ch = textSymbols.charAt(i);
|
10333 | symbols.text[ch] = {
|
10334 | font: "main",
|
10335 | group: "textord"
|
10336 | };
|
10337 | }
|
10338 |
|
10339 | // All of these are textords in text mode, and mathords in math mode
|
10340 | var letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
10341 | for (var i = 0; i < letters.length; i++) {
|
10342 | var ch = letters.charAt(i);
|
10343 | symbols.math[ch] = {
|
10344 | font: "main",
|
10345 | group: "mathord"
|
10346 | };
|
10347 | symbols.text[ch] = {
|
10348 | font: "main",
|
10349 | group: "textord"
|
10350 | };
|
10351 | }
|
10352 |
|
10353 | module.exports = symbols;
|
10354 |
|
10355 | },{}],25:[function(require,module,exports){
|
10356 | /**
|
10357 | * This file contains a list of utility functions which are useful in other
|
10358 | * files.
|
10359 | */
|
10360 |
|
10361 | /**
|
10362 | * Provide an `indexOf` function which works in IE8, but defers to native if
|
10363 | * possible.
|
10364 | */
|
10365 | var nativeIndexOf = Array.prototype.indexOf;
|
10366 | var indexOf = function(list, elem) {
|
10367 | if (list == null) {
|
10368 | return -1;
|
10369 | }
|
10370 | if (nativeIndexOf && list.indexOf === nativeIndexOf) {
|
10371 | return list.indexOf(elem);
|
10372 | }
|
10373 | var i = 0, l = list.length;
|
10374 | for (; i < l; i++) {
|
10375 | if (list[i] === elem) {
|
10376 | return i;
|
10377 | }
|
10378 | }
|
10379 | return -1;
|
10380 | };
|
10381 |
|
10382 | /**
|
10383 | * Return whether an element is contained in a list
|
10384 | */
|
10385 | var contains = function(list, elem) {
|
10386 | return indexOf(list, elem) !== -1;
|
10387 | };
|
10388 |
|
10389 | /**
|
10390 | * Provide a default value if a setting is undefined
|
10391 | */
|
10392 | var deflt = function(setting, defaultIfUndefined) {
|
10393 | return setting === undefined ? defaultIfUndefined : setting;
|
10394 | };
|
10395 |
|
10396 | // hyphenate and escape adapted from Facebook's React under Apache 2 license
|
10397 |
|
10398 | var uppercase = /([A-Z])/g;
|
10399 | var hyphenate = function(str) {
|
10400 | return str.replace(uppercase, "-$1").toLowerCase();
|
10401 | };
|
10402 |
|
10403 | var ESCAPE_LOOKUP = {
|
10404 | "&": "&",
|
10405 | ">": ">",
|
10406 | "<": "<",
|
10407 | "\"": """,
|
10408 | "'": "'"
|
10409 | };
|
10410 |
|
10411 | var ESCAPE_REGEX = /[&><"']/g;
|
10412 |
|
10413 | function escaper(match) {
|
10414 | return ESCAPE_LOOKUP[match];
|
10415 | }
|
10416 |
|
10417 | /**
|
10418 | * Escapes text to prevent scripting attacks.
|
10419 | *
|
10420 | * @param {*} text Text value to escape.
|
10421 | * @return {string} An escaped string.
|
10422 | */
|
10423 | function escape(text) {
|
10424 | return ("" + text).replace(ESCAPE_REGEX, escaper);
|
10425 | }
|
10426 |
|
10427 | /**
|
10428 | * A function to set the text content of a DOM element in all supported
|
10429 | * browsers. Note that we don't define this if there is no document.
|
10430 | */
|
10431 | var setTextContent;
|
10432 | if (typeof document !== "undefined") {
|
10433 | var testNode = document.createElement("span");
|
10434 | if ("textContent" in testNode) {
|
10435 | setTextContent = function(node, text) {
|
10436 | node.textContent = text;
|
10437 | };
|
10438 | } else {
|
10439 | setTextContent = function(node, text) {
|
10440 | node.innerText = text;
|
10441 | };
|
10442 | }
|
10443 | }
|
10444 |
|
10445 | /**
|
10446 | * A function to clear a node.
|
10447 | */
|
10448 | function clearNode(node) {
|
10449 | setTextContent(node, "");
|
10450 | }
|
10451 |
|
10452 | module.exports = {
|
10453 | contains: contains,
|
10454 | deflt: deflt,
|
10455 | escape: escape,
|
10456 | hyphenate: hyphenate,
|
10457 | indexOf: indexOf,
|
10458 | setTextContent: setTextContent,
|
10459 | clearNode: clearNode
|
10460 | };
|
10461 |
|
10462 | },{}],26:[function(require,module,exports){
|
10463 | 'use strict';
|
10464 |
|
10465 |
|
10466 | ////////////////////////////////////////////////////////////////////////////////
|
10467 | // Helpers
|
10468 |
|
10469 | // Merge objects
|
10470 | //
|
10471 | function assign(obj /*from1, from2, from3, ...*/) {
|
10472 | var sources = Array.prototype.slice.call(arguments, 1);
|
10473 |
|
10474 | sources.forEach(function (source) {
|
10475 | if (!source) { return; }
|
10476 |
|
10477 | Object.keys(source).forEach(function (key) {
|
10478 | obj[key] = source[key];
|
10479 | });
|
10480 | });
|
10481 |
|
10482 | return obj;
|
10483 | }
|
10484 |
|
10485 | function _class(obj) { return Object.prototype.toString.call(obj); }
|
10486 | function isString(obj) { return _class(obj) === '[object String]'; }
|
10487 | function isObject(obj) { return _class(obj) === '[object Object]'; }
|
10488 | function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
|
10489 | function isFunction(obj) { return _class(obj) === '[object Function]'; }
|
10490 |
|
10491 |
|
10492 | function escapeRE (str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
|
10493 |
|
10494 | ////////////////////////////////////////////////////////////////////////////////
|
10495 |
|
10496 |
|
10497 | var defaultOptions = {
|
10498 | fuzzyLink: true,
|
10499 | fuzzyEmail: true,
|
10500 | fuzzyIP: false
|
10501 | };
|
10502 |
|
10503 |
|
10504 | function isOptionsObj(obj) {
|
10505 | return Object.keys(obj || {}).reduce(function (acc, k) {
|
10506 | return acc || defaultOptions.hasOwnProperty(k);
|
10507 | }, false);
|
10508 | }
|
10509 |
|
10510 |
|
10511 | var defaultSchemas = {
|
10512 | 'http:': {
|
10513 | validate: function (text, pos, self) {
|
10514 | var tail = text.slice(pos);
|
10515 |
|
10516 | if (!self.re.http) {
|
10517 | // compile lazily, because "host"-containing variables can change on tlds update.
|
10518 | self.re.http = new RegExp(
|
10519 | '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
|
10520 | );
|
10521 | }
|
10522 | if (self.re.http.test(tail)) {
|
10523 | return tail.match(self.re.http)[0].length;
|
10524 | }
|
10525 | return 0;
|
10526 | }
|
10527 | },
|
10528 | 'https:': 'http:',
|
10529 | 'ftp:': 'http:',
|
10530 | '//': {
|
10531 | validate: function (text, pos, self) {
|
10532 | var tail = text.slice(pos);
|
10533 |
|
10534 | if (!self.re.no_http) {
|
10535 | // compile lazily, becayse "host"-containing variables can change on tlds update.
|
10536 | self.re.no_http = new RegExp(
|
10537 | '^' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
|
10538 | );
|
10539 | }
|
10540 |
|
10541 | if (self.re.no_http.test(tail)) {
|
10542 | // should not be `://`, that protects from errors in protocol name
|
10543 | if (pos >= 3 && text[pos - 3] === ':') { return 0; }
|
10544 | return tail.match(self.re.no_http)[0].length;
|
10545 | }
|
10546 | return 0;
|
10547 | }
|
10548 | },
|
10549 | 'mailto:': {
|
10550 | validate: function (text, pos, self) {
|
10551 | var tail = text.slice(pos);
|
10552 |
|
10553 | if (!self.re.mailto) {
|
10554 | self.re.mailto = new RegExp(
|
10555 | '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
|
10556 | );
|
10557 | }
|
10558 | if (self.re.mailto.test(tail)) {
|
10559 | return tail.match(self.re.mailto)[0].length;
|
10560 | }
|
10561 | return 0;
|
10562 | }
|
10563 | }
|
10564 | };
|
10565 |
|
10566 | /*eslint-disable max-len*/
|
10567 |
|
10568 | // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
|
10569 | var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
|
10570 |
|
10571 | // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
|
10572 | var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
|
10573 |
|
10574 | /*eslint-enable max-len*/
|
10575 |
|
10576 | ////////////////////////////////////////////////////////////////////////////////
|
10577 |
|
10578 | function resetScanCache(self) {
|
10579 | self.__index__ = -1;
|
10580 | self.__text_cache__ = '';
|
10581 | }
|
10582 |
|
10583 | function createValidator(re) {
|
10584 | return function (text, pos) {
|
10585 | var tail = text.slice(pos);
|
10586 |
|
10587 | if (re.test(tail)) {
|
10588 | return tail.match(re)[0].length;
|
10589 | }
|
10590 | return 0;
|
10591 | };
|
10592 | }
|
10593 |
|
10594 | function createNormalizer() {
|
10595 | return function (match, self) {
|
10596 | self.normalize(match);
|
10597 | };
|
10598 | }
|
10599 |
|
10600 | // Schemas compiler. Build regexps.
|
10601 | //
|
10602 | function compile(self) {
|
10603 |
|
10604 | // Load & clone RE patterns.
|
10605 | var re = self.re = assign({}, require('./lib/re'));
|
10606 |
|
10607 | // Define dynamic patterns
|
10608 | var tlds = self.__tlds__.slice();
|
10609 |
|
10610 | if (!self.__tlds_replaced__) {
|
10611 | tlds.push(tlds_2ch_src_re);
|
10612 | }
|
10613 | tlds.push(re.src_xn);
|
10614 |
|
10615 | re.src_tlds = tlds.join('|');
|
10616 |
|
10617 | function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
|
10618 |
|
10619 | re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
|
10620 | re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
|
10621 | re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
|
10622 | re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
|
10623 |
|
10624 | //
|
10625 | // Compile each schema
|
10626 | //
|
10627 |
|
10628 | var aliases = [];
|
10629 |
|
10630 | self.__compiled__ = {}; // Reset compiled data
|
10631 |
|
10632 | function schemaError(name, val) {
|
10633 | throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
|
10634 | }
|
10635 |
|
10636 | Object.keys(self.__schemas__).forEach(function (name) {
|
10637 | var val = self.__schemas__[name];
|
10638 |
|
10639 | // skip disabled methods
|
10640 | if (val === null) { return; }
|
10641 |
|
10642 | var compiled = { validate: null, link: null };
|
10643 |
|
10644 | self.__compiled__[name] = compiled;
|
10645 |
|
10646 | if (isObject(val)) {
|
10647 | if (isRegExp(val.validate)) {
|
10648 | compiled.validate = createValidator(val.validate);
|
10649 | } else if (isFunction(val.validate)) {
|
10650 | compiled.validate = val.validate;
|
10651 | } else {
|
10652 | schemaError(name, val);
|
10653 | }
|
10654 |
|
10655 | if (isFunction(val.normalize)) {
|
10656 | compiled.normalize = val.normalize;
|
10657 | } else if (!val.normalize) {
|
10658 | compiled.normalize = createNormalizer();
|
10659 | } else {
|
10660 | schemaError(name, val);
|
10661 | }
|
10662 |
|
10663 | return;
|
10664 | }
|
10665 |
|
10666 | if (isString(val)) {
|
10667 | aliases.push(name);
|
10668 | return;
|
10669 | }
|
10670 |
|
10671 | schemaError(name, val);
|
10672 | });
|
10673 |
|
10674 | //
|
10675 | // Compile postponed aliases
|
10676 | //
|
10677 |
|
10678 | aliases.forEach(function (alias) {
|
10679 | if (!self.__compiled__[self.__schemas__[alias]]) {
|
10680 | // Silently fail on missed schemas to avoid errons on disable.
|
10681 | // schemaError(alias, self.__schemas__[alias]);
|
10682 | return;
|
10683 | }
|
10684 |
|
10685 | self.__compiled__[alias].validate =
|
10686 | self.__compiled__[self.__schemas__[alias]].validate;
|
10687 | self.__compiled__[alias].normalize =
|
10688 | self.__compiled__[self.__schemas__[alias]].normalize;
|
10689 | });
|
10690 |
|
10691 | //
|
10692 | // Fake record for guessed links
|
10693 | //
|
10694 | self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
|
10695 |
|
10696 | //
|
10697 | // Build schema condition
|
10698 | //
|
10699 | var slist = Object.keys(self.__compiled__)
|
10700 | .filter(function(name) {
|
10701 | // Filter disabled & fake schemas
|
10702 | return name.length > 0 && self.__compiled__[name];
|
10703 | })
|
10704 | .map(escapeRE)
|
10705 | .join('|');
|
10706 | // (?!_) cause 1.5x slowdown
|
10707 | self.re.schema_test = RegExp('(^|(?!_)(?:>|' + re.src_ZPCc + '))(' + slist + ')', 'i');
|
10708 | self.re.schema_search = RegExp('(^|(?!_)(?:>|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
|
10709 |
|
10710 | self.re.pretest = RegExp(
|
10711 | '(' + self.re.schema_test.source + ')|' +
|
10712 | '(' + self.re.host_fuzzy_test.source + ')|' +
|
10713 | '@',
|
10714 | 'i');
|
10715 |
|
10716 | //
|
10717 | // Cleanup
|
10718 | //
|
10719 |
|
10720 | resetScanCache(self);
|
10721 | }
|
10722 |
|
10723 | /**
|
10724 | * class Match
|
10725 | *
|
10726 | * Match result. Single element of array, returned by [[LinkifyIt#match]]
|
10727 | **/
|
10728 | function Match(self, shift) {
|
10729 | var start = self.__index__,
|
10730 | end = self.__last_index__,
|
10731 | text = self.__text_cache__.slice(start, end);
|
10732 |
|
10733 | /**
|
10734 | * Match#schema -> String
|
10735 | *
|
10736 | * Prefix (protocol) for matched string.
|
10737 | **/
|
10738 | this.schema = self.__schema__.toLowerCase();
|
10739 | /**
|
10740 | * Match#index -> Number
|
10741 | *
|
10742 | * First position of matched string.
|
10743 | **/
|
10744 | this.index = start + shift;
|
10745 | /**
|
10746 | * Match#lastIndex -> Number
|
10747 | *
|
10748 | * Next position after matched string.
|
10749 | **/
|
10750 | this.lastIndex = end + shift;
|
10751 | /**
|
10752 | * Match#raw -> String
|
10753 | *
|
10754 | * Matched string.
|
10755 | **/
|
10756 | this.raw = text;
|
10757 | /**
|
10758 | * Match#text -> String
|
10759 | *
|
10760 | * Notmalized text of matched string.
|
10761 | **/
|
10762 | this.text = text;
|
10763 | /**
|
10764 | * Match#url -> String
|
10765 | *
|
10766 | * Normalized url of matched string.
|
10767 | **/
|
10768 | this.url = text;
|
10769 | }
|
10770 |
|
10771 | function createMatch(self, shift) {
|
10772 | var match = new Match(self, shift);
|
10773 |
|
10774 | self.__compiled__[match.schema].normalize(match, self);
|
10775 |
|
10776 | return match;
|
10777 | }
|
10778 |
|
10779 |
|
10780 | /**
|
10781 | * class LinkifyIt
|
10782 | **/
|
10783 |
|
10784 | /**
|
10785 | * new LinkifyIt(schemas, options)
|
10786 | * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
|
10787 | * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
|
10788 | *
|
10789 | * Creates new linkifier instance with optional additional schemas.
|
10790 | * Can be called without `new` keyword for convenience.
|
10791 | *
|
10792 | * By default understands:
|
10793 | *
|
10794 | * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
|
10795 | * - "fuzzy" links and emails (example.com, foo@bar.com).
|
10796 | *
|
10797 | * `schemas` is an object, where each key/value describes protocol/rule:
|
10798 | *
|
10799 | * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
|
10800 | * for example). `linkify-it` makes shure that prefix is not preceeded with
|
10801 | * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
|
10802 | * - __value__ - rule to check tail after link prefix
|
10803 | * - _String_ - just alias to existing rule
|
10804 | * - _Object_
|
10805 | * - _validate_ - validator function (should return matched length on success),
|
10806 | * or `RegExp`.
|
10807 | * - _normalize_ - optional function to normalize text & url of matched result
|
10808 | * (for example, for @twitter mentions).
|
10809 | *
|
10810 | * `options`:
|
10811 | *
|
10812 | * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
|
10813 | * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
|
10814 | * like version numbers. Default `false`.
|
10815 | * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
|
10816 | *
|
10817 | **/
|
10818 | function LinkifyIt(schemas, options) {
|
10819 | if (!(this instanceof LinkifyIt)) {
|
10820 | return new LinkifyIt(schemas, options);
|
10821 | }
|
10822 |
|
10823 | if (!options) {
|
10824 | if (isOptionsObj(schemas)) {
|
10825 | options = schemas;
|
10826 | schemas = {};
|
10827 | }
|
10828 | }
|
10829 |
|
10830 | this.__opts__ = assign({}, defaultOptions, options);
|
10831 |
|
10832 | // Cache last tested result. Used to skip repeating steps on next `match` call.
|
10833 | this.__index__ = -1;
|
10834 | this.__last_index__ = -1; // Next scan position
|
10835 | this.__schema__ = '';
|
10836 | this.__text_cache__ = '';
|
10837 |
|
10838 | this.__schemas__ = assign({}, defaultSchemas, schemas);
|
10839 | this.__compiled__ = {};
|
10840 |
|
10841 | this.__tlds__ = tlds_default;
|
10842 | this.__tlds_replaced__ = false;
|
10843 |
|
10844 | this.re = {};
|
10845 |
|
10846 | compile(this);
|
10847 | }
|
10848 |
|
10849 |
|
10850 | /** chainable
|
10851 | * LinkifyIt#add(schema, definition)
|
10852 | * - schema (String): rule name (fixed pattern prefix)
|
10853 | * - definition (String|RegExp|Object): schema definition
|
10854 | *
|
10855 | * Add new rule definition. See constructor description for details.
|
10856 | **/
|
10857 | LinkifyIt.prototype.add = function add(schema, definition) {
|
10858 | this.__schemas__[schema] = definition;
|
10859 | compile(this);
|
10860 | return this;
|
10861 | };
|
10862 |
|
10863 |
|
10864 | /** chainable
|
10865 | * LinkifyIt#set(options)
|
10866 | * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
|
10867 | *
|
10868 | * Set recognition options for links without schema.
|
10869 | **/
|
10870 | LinkifyIt.prototype.set = function set(options) {
|
10871 | this.__opts__ = assign(this.__opts__, options);
|
10872 | return this;
|
10873 | };
|
10874 |
|
10875 |
|
10876 | /**
|
10877 | * LinkifyIt#test(text) -> Boolean
|
10878 | *
|
10879 | * Searches linkifiable pattern and returns `true` on success or `false` on fail.
|
10880 | **/
|
10881 | LinkifyIt.prototype.test = function test(text) {
|
10882 | // Reset scan cache
|
10883 | this.__text_cache__ = text;
|
10884 | this.__index__ = -1;
|
10885 |
|
10886 | if (!text.length) { return false; }
|
10887 |
|
10888 | var m, ml, me, len, shift, next, re, tld_pos, at_pos;
|
10889 |
|
10890 | // try to scan for link with schema - that's the most simple rule
|
10891 | if (this.re.schema_test.test(text)) {
|
10892 | re = this.re.schema_search;
|
10893 | re.lastIndex = 0;
|
10894 | while ((m = re.exec(text)) !== null) {
|
10895 | len = this.testSchemaAt(text, m[2], re.lastIndex);
|
10896 | if (len) {
|
10897 | this.__schema__ = m[2];
|
10898 | this.__index__ = m.index + m[1].length;
|
10899 | this.__last_index__ = m.index + m[0].length + len;
|
10900 | break;
|
10901 | }
|
10902 | }
|
10903 | }
|
10904 |
|
10905 | if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
|
10906 | // guess schemaless links
|
10907 | tld_pos = text.search(this.re.host_fuzzy_test);
|
10908 | if (tld_pos >= 0) {
|
10909 | // if tld is located after found link - no need to check fuzzy pattern
|
10910 | if (this.__index__ < 0 || tld_pos < this.__index__) {
|
10911 | if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
|
10912 |
|
10913 | shift = ml.index + ml[1].length;
|
10914 |
|
10915 | if (this.__index__ < 0 || shift < this.__index__) {
|
10916 | this.__schema__ = '';
|
10917 | this.__index__ = shift;
|
10918 | this.__last_index__ = ml.index + ml[0].length;
|
10919 | }
|
10920 | }
|
10921 | }
|
10922 | }
|
10923 | }
|
10924 |
|
10925 | if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
|
10926 | // guess schemaless emails
|
10927 | at_pos = text.indexOf('@');
|
10928 | if (at_pos >= 0) {
|
10929 | // We can't skip this check, because this cases are possible:
|
10930 | // 192.168.1.1@gmail.com, my.in@example.com
|
10931 | if ((me = text.match(this.re.email_fuzzy)) !== null) {
|
10932 |
|
10933 | shift = me.index + me[1].length;
|
10934 | next = me.index + me[0].length;
|
10935 |
|
10936 | if (this.__index__ < 0 || shift < this.__index__ ||
|
10937 | (shift === this.__index__ && next > this.__last_index__)) {
|
10938 | this.__schema__ = 'mailto:';
|
10939 | this.__index__ = shift;
|
10940 | this.__last_index__ = next;
|
10941 | }
|
10942 | }
|
10943 | }
|
10944 | }
|
10945 |
|
10946 | return this.__index__ >= 0;
|
10947 | };
|
10948 |
|
10949 |
|
10950 | /**
|
10951 | * LinkifyIt#pretest(text) -> Boolean
|
10952 | *
|
10953 | * Very quick check, that can give false positives. Returns true if link MAY BE
|
10954 | * can exists. Can be used for speed optimization, when you need to check that
|
10955 | * link NOT exists.
|
10956 | **/
|
10957 | LinkifyIt.prototype.pretest = function pretest(text) {
|
10958 | return this.re.pretest.test(text);
|
10959 | };
|
10960 |
|
10961 |
|
10962 | /**
|
10963 | * LinkifyIt#testSchemaAt(text, name, position) -> Number
|
10964 | * - text (String): text to scan
|
10965 | * - name (String): rule (schema) name
|
10966 | * - position (Number): text offset to check from
|
10967 | *
|
10968 | * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
|
10969 | * at given position. Returns length of found pattern (0 on fail).
|
10970 | **/
|
10971 | LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
|
10972 | // If not supported schema check requested - terminate
|
10973 | if (!this.__compiled__[schema.toLowerCase()]) {
|
10974 | return 0;
|
10975 | }
|
10976 | return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
|
10977 | };
|
10978 |
|
10979 |
|
10980 | /**
|
10981 | * LinkifyIt#match(text) -> Array|null
|
10982 | *
|
10983 | * Returns array of found link descriptions or `null` on fail. We strongly
|
10984 | * to use [[LinkifyIt#test]] first, for best speed.
|
10985 | *
|
10986 | * ##### Result match description
|
10987 | *
|
10988 | * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
|
10989 | * protocol-neutral links.
|
10990 | * - __index__ - offset of matched text
|
10991 | * - __lastIndex__ - index of next char after mathch end
|
10992 | * - __raw__ - matched text
|
10993 | * - __text__ - normalized text
|
10994 | * - __url__ - link, generated from matched text
|
10995 | **/
|
10996 | LinkifyIt.prototype.match = function match(text) {
|
10997 | var shift = 0, result = [];
|
10998 |
|
10999 | // Try to take previous element from cache, if .test() called before
|
11000 | if (this.__index__ >= 0 && this.__text_cache__ === text) {
|
11001 | result.push(createMatch(this, shift));
|
11002 | shift = this.__last_index__;
|
11003 | }
|
11004 |
|
11005 | // Cut head if cache was used
|
11006 | var tail = shift ? text.slice(shift) : text;
|
11007 |
|
11008 | // Scan string until end reached
|
11009 | while (this.test(tail)) {
|
11010 | result.push(createMatch(this, shift));
|
11011 |
|
11012 | tail = tail.slice(this.__last_index__);
|
11013 | shift += this.__last_index__;
|
11014 | }
|
11015 |
|
11016 | if (result.length) {
|
11017 | return result;
|
11018 | }
|
11019 |
|
11020 | return null;
|
11021 | };
|
11022 |
|
11023 |
|
11024 | /** chainable
|
11025 | * LinkifyIt#tlds(list [, keepOld]) -> this
|
11026 | * - list (Array): list of tlds
|
11027 | * - keepOld (Boolean): merge with current list if `true` (`false` by default)
|
11028 | *
|
11029 | * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
|
11030 | * to avoid false positives. By default this algorythm used:
|
11031 | *
|
11032 | * - hostname with any 2-letter root zones are ok.
|
11033 | * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
|
11034 | * are ok.
|
11035 | * - encoded (`xn--...`) root zones are ok.
|
11036 | *
|
11037 | * If list is replaced, then exact match for 2-chars root zones will be checked.
|
11038 | **/
|
11039 | LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
|
11040 | list = Array.isArray(list) ? list : [ list ];
|
11041 |
|
11042 | if (!keepOld) {
|
11043 | this.__tlds__ = list.slice();
|
11044 | this.__tlds_replaced__ = true;
|
11045 | compile(this);
|
11046 | return this;
|
11047 | }
|
11048 |
|
11049 | this.__tlds__ = this.__tlds__.concat(list)
|
11050 | .sort()
|
11051 | .filter(function(el, idx, arr) {
|
11052 | return el !== arr[idx - 1];
|
11053 | })
|
11054 | .reverse();
|
11055 |
|
11056 | compile(this);
|
11057 | return this;
|
11058 | };
|
11059 |
|
11060 | /**
|
11061 | * LinkifyIt#normalize(match)
|
11062 | *
|
11063 | * Default normalizer (if schema does not define it's own).
|
11064 | **/
|
11065 | LinkifyIt.prototype.normalize = function normalize(match) {
|
11066 |
|
11067 | // Do minimal possible changes by default. Need to collect feedback prior
|
11068 | // to move forward https://github.com/markdown-it/linkify-it/issues/1
|
11069 |
|
11070 | if (!match.schema) { match.url = 'http://' + match.url; }
|
11071 |
|
11072 | if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
|
11073 | match.url = 'mailto:' + match.url;
|
11074 | }
|
11075 | };
|
11076 |
|
11077 |
|
11078 | module.exports = LinkifyIt;
|
11079 |
|
11080 | },{"./lib/re":27}],27:[function(require,module,exports){
|
11081 | 'use strict';
|
11082 |
|
11083 | // Use direct extract instead of `regenerate` to reduse browserified size
|
11084 | var src_Any = exports.src_Any = require('uc.micro/properties/Any/regex').source;
|
11085 | var src_Cc = exports.src_Cc = require('uc.micro/categories/Cc/regex').source;
|
11086 | var src_Z = exports.src_Z = require('uc.micro/categories/Z/regex').source;
|
11087 | var src_P = exports.src_P = require('uc.micro/categories/P/regex').source;
|
11088 |
|
11089 | // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
|
11090 | var src_ZPCc = exports.src_ZPCc = [ src_Z, src_P, src_Cc ].join('|');
|
11091 |
|
11092 | // \p{\Z\Cc} (white spaces + control)
|
11093 | var src_ZCc = exports.src_ZCc = [ src_Z, src_Cc ].join('|');
|
11094 |
|
11095 | // All possible word characters (everything without punctuation, spaces & controls)
|
11096 | // Defined via punctuation & spaces to save space
|
11097 | // Should be something like \p{\L\N\S\M} (\w but without `_`)
|
11098 | var src_pseudo_letter = '(?:(?!' + src_ZPCc + ')' + src_Any + ')';
|
11099 | // The same as abothe but without [0-9]
|
11100 | var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
|
11101 |
|
11102 | ////////////////////////////////////////////////////////////////////////////////
|
11103 |
|
11104 | var src_ip4 = exports.src_ip4 =
|
11105 |
|
11106 | '(?:(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]?)';
|
11107 |
|
11108 | exports.src_auth = '(?:(?:(?!' + src_ZCc + ').)+@)?';
|
11109 |
|
11110 | var src_port = exports.src_port =
|
11111 |
|
11112 | '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
|
11113 |
|
11114 | var src_host_terminator = exports.src_host_terminator =
|
11115 |
|
11116 | '(?=$|' + src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + src_ZPCc + '))';
|
11117 |
|
11118 | var src_path = exports.src_path =
|
11119 |
|
11120 | '(?:' +
|
11121 | '[/?#]' +
|
11122 | '(?:' +
|
11123 | '(?!' + src_ZCc + '|[()[\\]{}.,"\'?!\\-]).|' +
|
11124 | '\\[(?:(?!' + src_ZCc + '|\\]).)*\\]|' +
|
11125 | '\\((?:(?!' + src_ZCc + '|[)]).)*\\)|' +
|
11126 | '\\{(?:(?!' + src_ZCc + '|[}]).)*\\}|' +
|
11127 | '\\"(?:(?!' + src_ZCc + '|["]).)+\\"|' +
|
11128 | "\\'(?:(?!" + src_ZCc + "|[']).)+\\'|" +
|
11129 | "\\'(?=" + src_pseudo_letter + ').|' + // allow `I'm_king` if no pair found
|
11130 | '\\.{2,3}[a-zA-Z0-9%/]|' + // github has ... in commit range links. Restrict to
|
11131 | // - english
|
11132 | // - percent-encoded
|
11133 | // - parts of file path
|
11134 | // until more examples found.
|
11135 | '\\.(?!' + src_ZCc + '|[.]).|' +
|
11136 | '\\-(?!--(?:[^-]|$))(?:-*)|' + // `---` => long dash, terminate
|
11137 | '\\,(?!' + src_ZCc + ').|' + // allow `,,,` in paths
|
11138 | '\\!(?!' + src_ZCc + '|[!]).|' +
|
11139 | '\\?(?!' + src_ZCc + '|[?]).' +
|
11140 | ')+' +
|
11141 | '|\\/' +
|
11142 | ')?';
|
11143 |
|
11144 | var src_email_name = exports.src_email_name =
|
11145 |
|
11146 | '[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+';
|
11147 |
|
11148 | var src_xn = exports.src_xn =
|
11149 |
|
11150 | 'xn--[a-z0-9\\-]{1,59}';
|
11151 |
|
11152 | // More to read about domain names
|
11153 | // http://serverfault.com/questions/638260/
|
11154 |
|
11155 | var src_domain_root = exports.src_domain_root =
|
11156 |
|
11157 | // Can't have digits and dashes
|
11158 | '(?:' +
|
11159 | src_xn +
|
11160 | '|' +
|
11161 | src_pseudo_letter_non_d + '{1,63}' +
|
11162 | ')';
|
11163 |
|
11164 | var src_domain = exports.src_domain =
|
11165 |
|
11166 | '(?:' +
|
11167 | src_xn +
|
11168 | '|' +
|
11169 | '(?:' + src_pseudo_letter + ')' +
|
11170 | '|' +
|
11171 | // don't allow `--` in domain names, because:
|
11172 | // - that can conflict with markdown — / –
|
11173 | // - nobody use those anyway
|
11174 | '(?:' + src_pseudo_letter + '(?:-(?!-)|' + src_pseudo_letter + '){0,61}' + src_pseudo_letter + ')' +
|
11175 | ')';
|
11176 |
|
11177 | var src_host = exports.src_host =
|
11178 |
|
11179 | '(?:' +
|
11180 | src_ip4 +
|
11181 | '|' +
|
11182 | '(?:(?:(?:' + src_domain + ')\\.)*' + src_domain_root + ')' +
|
11183 | ')';
|
11184 |
|
11185 | var tpl_host_fuzzy = exports.tpl_host_fuzzy =
|
11186 |
|
11187 | '(?:' +
|
11188 | src_ip4 +
|
11189 | '|' +
|
11190 | '(?:(?:(?:' + src_domain + ')\\.)+(?:%TLDS%))' +
|
11191 | ')';
|
11192 |
|
11193 | var tpl_host_no_ip_fuzzy = exports.tpl_host_no_ip_fuzzy =
|
11194 |
|
11195 | '(?:(?:(?:' + src_domain + ')\\.)+(?:%TLDS%))';
|
11196 |
|
11197 | exports.src_host_strict =
|
11198 |
|
11199 | src_host + src_host_terminator;
|
11200 |
|
11201 | var tpl_host_fuzzy_strict = exports.tpl_host_fuzzy_strict =
|
11202 |
|
11203 | tpl_host_fuzzy + src_host_terminator;
|
11204 |
|
11205 | exports.src_host_port_strict =
|
11206 |
|
11207 | src_host + src_port + src_host_terminator;
|
11208 |
|
11209 | var tpl_host_port_fuzzy_strict = exports.tpl_host_port_fuzzy_strict =
|
11210 |
|
11211 | tpl_host_fuzzy + src_port + src_host_terminator;
|
11212 |
|
11213 | var tpl_host_port_no_ip_fuzzy_strict = exports.tpl_host_port_no_ip_fuzzy_strict =
|
11214 |
|
11215 | tpl_host_no_ip_fuzzy + src_port + src_host_terminator;
|
11216 |
|
11217 |
|
11218 | ////////////////////////////////////////////////////////////////////////////////
|
11219 | // Main rules
|
11220 |
|
11221 | // Rude test fuzzy links by host, for quick deny
|
11222 | exports.tpl_host_fuzzy_test =
|
11223 |
|
11224 | 'localhost|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + src_ZPCc + '|$))';
|
11225 |
|
11226 | exports.tpl_email_fuzzy =
|
11227 |
|
11228 | '(^|>|' + src_ZCc + ')(' + src_email_name + '@' + tpl_host_fuzzy_strict + ')';
|
11229 |
|
11230 | exports.tpl_link_fuzzy =
|
11231 | // Fuzzy link can't be prepended with .:/\- and non punctuation.
|
11232 | // but can start with > (markdown blockquote)
|
11233 | '(^|(?![.:/\\-_@])(?:[$+<=>^`|]|' + src_ZPCc + '))' +
|
11234 | '((?![$+<=>^`|])' + tpl_host_port_fuzzy_strict + src_path + ')';
|
11235 |
|
11236 | exports.tpl_link_no_ip_fuzzy =
|
11237 | // Fuzzy link can't be prepended with .:/\- and non punctuation.
|
11238 | // but can start with > (markdown blockquote)
|
11239 | '(^|(?![.:/\\-_@])(?:[$+<=>^`|]|' + src_ZPCc + '))' +
|
11240 | '((?![$+<=>^`|])' + tpl_host_port_no_ip_fuzzy_strict + src_path + ')';
|
11241 |
|
11242 | },{"uc.micro/categories/Cc/regex":86,"uc.micro/categories/P/regex":88,"uc.micro/categories/Z/regex":89,"uc.micro/properties/Any/regex":91}],28:[function(require,module,exports){
|
11243 | 'use strict';
|
11244 |
|
11245 |
|
11246 | module.exports = require('./lib/');
|
11247 |
|
11248 | },{"./lib/":37}],29:[function(require,module,exports){
|
11249 | // HTML5 entities map: { name -> utf16string }
|
11250 | //
|
11251 | 'use strict';
|
11252 |
|
11253 | /*eslint quotes:0*/
|
11254 | module.exports = require('entities/maps/entities.json');
|
11255 |
|
11256 | },{"entities/maps/entities.json":3}],30:[function(require,module,exports){
|
11257 | // List of valid html blocks names, accorting to commonmark spec
|
11258 | // http://jgm.github.io/CommonMark/spec.html#html-blocks
|
11259 |
|
11260 | 'use strict';
|
11261 |
|
11262 |
|
11263 | module.exports = [
|
11264 | 'address',
|
11265 | 'article',
|
11266 | 'aside',
|
11267 | 'base',
|
11268 | 'basefont',
|
11269 | 'blockquote',
|
11270 | 'body',
|
11271 | 'caption',
|
11272 | 'center',
|
11273 | 'col',
|
11274 | 'colgroup',
|
11275 | 'dd',
|
11276 | 'details',
|
11277 | 'dialog',
|
11278 | 'dir',
|
11279 | 'div',
|
11280 | 'dl',
|
11281 | 'dt',
|
11282 | 'fieldset',
|
11283 | 'figcaption',
|
11284 | 'figure',
|
11285 | 'footer',
|
11286 | 'form',
|
11287 | 'frame',
|
11288 | 'frameset',
|
11289 | 'h1',
|
11290 | 'head',
|
11291 | 'header',
|
11292 | 'hr',
|
11293 | 'html',
|
11294 | 'iframe',
|
11295 | 'legend',
|
11296 | 'li',
|
11297 | 'link',
|
11298 | 'main',
|
11299 | 'menu',
|
11300 | 'menuitem',
|
11301 | 'meta',
|
11302 | 'nav',
|
11303 | 'noframes',
|
11304 | 'ol',
|
11305 | 'optgroup',
|
11306 | 'option',
|
11307 | 'p',
|
11308 | 'param',
|
11309 | 'pre',
|
11310 | 'section',
|
11311 | 'source',
|
11312 | 'title',
|
11313 | 'summary',
|
11314 | 'table',
|
11315 | 'tbody',
|
11316 | 'td',
|
11317 | 'tfoot',
|
11318 | 'th',
|
11319 | 'thead',
|
11320 | 'title',
|
11321 | 'tr',
|
11322 | 'track',
|
11323 | 'ul'
|
11324 | ];
|
11325 |
|
11326 | },{}],31:[function(require,module,exports){
|
11327 | // Regexps to match html elements
|
11328 |
|
11329 | 'use strict';
|
11330 |
|
11331 | var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
|
11332 |
|
11333 | var unquoted = '[^"\'=<>`\\x00-\\x20]+';
|
11334 | var single_quoted = "'[^']*'";
|
11335 | var double_quoted = '"[^"]*"';
|
11336 |
|
11337 | var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';
|
11338 |
|
11339 | var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)';
|
11340 |
|
11341 | var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
|
11342 |
|
11343 | var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
|
11344 | var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
|
11345 | var processing = '<[?].*?[?]>';
|
11346 | var declaration = '<![A-Z]+\\s+[^>]*>';
|
11347 | var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
|
11348 |
|
11349 | var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +
|
11350 | '|' + processing + '|' + declaration + '|' + cdata + ')');
|
11351 | var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');
|
11352 |
|
11353 | module.exports.HTML_TAG_RE = HTML_TAG_RE;
|
11354 | module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
|
11355 |
|
11356 | },{}],32:[function(require,module,exports){
|
11357 | // Utilities
|
11358 | //
|
11359 | 'use strict';
|
11360 |
|
11361 |
|
11362 | function _class(obj) { return Object.prototype.toString.call(obj); }
|
11363 |
|
11364 | function isString(obj) { return _class(obj) === '[object String]'; }
|
11365 |
|
11366 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
11367 |
|
11368 | function has(object, key) {
|
11369 | return _hasOwnProperty.call(object, key);
|
11370 | }
|
11371 |
|
11372 | // Merge objects
|
11373 | //
|
11374 | function assign(obj /*from1, from2, from3, ...*/) {
|
11375 | var sources = Array.prototype.slice.call(arguments, 1);
|
11376 |
|
11377 | sources.forEach(function (source) {
|
11378 | if (!source) { return; }
|
11379 |
|
11380 | if (typeof source !== 'object') {
|
11381 | throw new TypeError(source + 'must be object');
|
11382 | }
|
11383 |
|
11384 | Object.keys(source).forEach(function (key) {
|
11385 | obj[key] = source[key];
|
11386 | });
|
11387 | });
|
11388 |
|
11389 | return obj;
|
11390 | }
|
11391 |
|
11392 | // Remove element from array and put another array at those position.
|
11393 | // Useful for some operations with tokens
|
11394 | function arrayReplaceAt(src, pos, newElements) {
|
11395 | return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
|
11396 | }
|
11397 |
|
11398 | ////////////////////////////////////////////////////////////////////////////////
|
11399 |
|
11400 | function isValidEntityCode(c) {
|
11401 | /*eslint no-bitwise:0*/
|
11402 | // broken sequence
|
11403 | if (c >= 0xD800 && c <= 0xDFFF) { return false; }
|
11404 | // never used
|
11405 | if (c >= 0xFDD0 && c <= 0xFDEF) { return false; }
|
11406 | if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; }
|
11407 | // control codes
|
11408 | if (c >= 0x00 && c <= 0x08) { return false; }
|
11409 | if (c === 0x0B) { return false; }
|
11410 | if (c >= 0x0E && c <= 0x1F) { return false; }
|
11411 | if (c >= 0x7F && c <= 0x9F) { return false; }
|
11412 | // out of range
|
11413 | if (c > 0x10FFFF) { return false; }
|
11414 | return true;
|
11415 | }
|
11416 |
|
11417 | function fromCodePoint(c) {
|
11418 | /*eslint no-bitwise:0*/
|
11419 | if (c > 0xffff) {
|
11420 | c -= 0x10000;
|
11421 | var surrogate1 = 0xd800 + (c >> 10),
|
11422 | surrogate2 = 0xdc00 + (c & 0x3ff);
|
11423 |
|
11424 | return String.fromCharCode(surrogate1, surrogate2);
|
11425 | }
|
11426 | return String.fromCharCode(c);
|
11427 | }
|
11428 |
|
11429 |
|
11430 | var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
|
11431 | var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
|
11432 | var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi');
|
11433 |
|
11434 | var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
|
11435 |
|
11436 | var entities = require('./entities');
|
11437 |
|
11438 | function replaceEntityPattern(match, name) {
|
11439 | var code = 0;
|
11440 |
|
11441 | if (has(entities, name)) {
|
11442 | return entities[name];
|
11443 | }
|
11444 |
|
11445 | if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {
|
11446 | code = name[1].toLowerCase() === 'x' ?
|
11447 | parseInt(name.slice(2), 16)
|
11448 | :
|
11449 | parseInt(name.slice(1), 10);
|
11450 | if (isValidEntityCode(code)) {
|
11451 | return fromCodePoint(code);
|
11452 | }
|
11453 | }
|
11454 |
|
11455 | return match;
|
11456 | }
|
11457 |
|
11458 | /*function replaceEntities(str) {
|
11459 | if (str.indexOf('&') < 0) { return str; }
|
11460 |
|
11461 | return str.replace(ENTITY_RE, replaceEntityPattern);
|
11462 | }*/
|
11463 |
|
11464 | function unescapeMd(str) {
|
11465 | if (str.indexOf('\\') < 0) { return str; }
|
11466 | return str.replace(UNESCAPE_MD_RE, '$1');
|
11467 | }
|
11468 |
|
11469 | function unescapeAll(str) {
|
11470 | if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; }
|
11471 |
|
11472 | return str.replace(UNESCAPE_ALL_RE, function(match, escaped, entity) {
|
11473 | if (escaped) { return escaped; }
|
11474 | return replaceEntityPattern(match, entity);
|
11475 | });
|
11476 | }
|
11477 |
|
11478 | ////////////////////////////////////////////////////////////////////////////////
|
11479 |
|
11480 | var HTML_ESCAPE_TEST_RE = /[&<>"]/;
|
11481 | var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
|
11482 | var HTML_REPLACEMENTS = {
|
11483 | '&': '&',
|
11484 | '<': '<',
|
11485 | '>': '>',
|
11486 | '"': '"'
|
11487 | };
|
11488 |
|
11489 | function replaceUnsafeChar(ch) {
|
11490 | return HTML_REPLACEMENTS[ch];
|
11491 | }
|
11492 |
|
11493 | function escapeHtml(str) {
|
11494 | if (HTML_ESCAPE_TEST_RE.test(str)) {
|
11495 | return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
|
11496 | }
|
11497 | return str;
|
11498 | }
|
11499 |
|
11500 | ////////////////////////////////////////////////////////////////////////////////
|
11501 |
|
11502 | var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
|
11503 |
|
11504 | function escapeRE (str) {
|
11505 | return str.replace(REGEXP_ESCAPE_RE, '\\$&');
|
11506 | }
|
11507 |
|
11508 | ////////////////////////////////////////////////////////////////////////////////
|
11509 |
|
11510 | function isSpace(code) {
|
11511 | switch (code) {
|
11512 | case 0x09:
|
11513 | case 0x20:
|
11514 | return true;
|
11515 | }
|
11516 | return false;
|
11517 | }
|
11518 |
|
11519 | // Zs (unicode class) || [\t\f\v\r\n]
|
11520 | function isWhiteSpace(code) {
|
11521 | if (code >= 0x2000 && code <= 0x200A) { return true; }
|
11522 | switch (code) {
|
11523 | case 0x09: // \t
|
11524 | case 0x0A: // \n
|
11525 | case 0x0B: // \v
|
11526 | case 0x0C: // \f
|
11527 | case 0x0D: // \r
|
11528 | case 0x20:
|
11529 | case 0xA0:
|
11530 | case 0x1680:
|
11531 | case 0x202F:
|
11532 | case 0x205F:
|
11533 | case 0x3000:
|
11534 | return true;
|
11535 | }
|
11536 | return false;
|
11537 | }
|
11538 |
|
11539 | ////////////////////////////////////////////////////////////////////////////////
|
11540 |
|
11541 | /*eslint-disable max-len*/
|
11542 | var UNICODE_PUNCT_RE = require('uc.micro/categories/P/regex');
|
11543 |
|
11544 | // Currently without astral characters support.
|
11545 | function isPunctChar(ch) {
|
11546 | return UNICODE_PUNCT_RE.test(ch);
|
11547 | }
|
11548 |
|
11549 |
|
11550 | // Markdown ASCII punctuation characters.
|
11551 | //
|
11552 | // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
|
11553 | // http://spec.commonmark.org/0.15/#ascii-punctuation-character
|
11554 | //
|
11555 | // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
|
11556 | //
|
11557 | function isMdAsciiPunct(ch) {
|
11558 | switch (ch) {
|
11559 | case 0x21/* ! */:
|
11560 | case 0x22/* " */:
|
11561 | case 0x23/* # */:
|
11562 | case 0x24/* $ */:
|
11563 | case 0x25/* % */:
|
11564 | case 0x26/* & */:
|
11565 | case 0x27/* ' */:
|
11566 | case 0x28/* ( */:
|
11567 | case 0x29/* ) */:
|
11568 | case 0x2A/* * */:
|
11569 | case 0x2B/* + */:
|
11570 | case 0x2C/* , */:
|
11571 | case 0x2D/* - */:
|
11572 | case 0x2E/* . */:
|
11573 | case 0x2F/* / */:
|
11574 | case 0x3A/* : */:
|
11575 | case 0x3B/* ; */:
|
11576 | case 0x3C/* < */:
|
11577 | case 0x3D/* = */:
|
11578 | case 0x3E/* > */:
|
11579 | case 0x3F/* ? */:
|
11580 | case 0x40/* @ */:
|
11581 | case 0x5B/* [ */:
|
11582 | case 0x5C/* \ */:
|
11583 | case 0x5D/* ] */:
|
11584 | case 0x5E/* ^ */:
|
11585 | case 0x5F/* _ */:
|
11586 | case 0x60/* ` */:
|
11587 | case 0x7B/* { */:
|
11588 | case 0x7C/* | */:
|
11589 | case 0x7D/* } */:
|
11590 | case 0x7E/* ~ */:
|
11591 | return true;
|
11592 | default:
|
11593 | return false;
|
11594 | }
|
11595 | }
|
11596 |
|
11597 | // Hepler to unify [reference labels].
|
11598 | //
|
11599 | function normalizeReference(str) {
|
11600 | // use .toUpperCase() instead of .toLowerCase()
|
11601 | // here to avoid a conflict with Object.prototype
|
11602 | // members (most notably, `__proto__`)
|
11603 | return str.trim().replace(/\s+/g, ' ').toUpperCase();
|
11604 | }
|
11605 |
|
11606 | ////////////////////////////////////////////////////////////////////////////////
|
11607 |
|
11608 | // Re-export libraries commonly used in both markdown-it and its plugins,
|
11609 | // so plugins won't have to depend on them explicitly, which reduces their
|
11610 | // bundled size (e.g. a browser build).
|
11611 | //
|
11612 | exports.lib = {};
|
11613 | exports.lib.mdurl = require('mdurl');
|
11614 | exports.lib.ucmicro = require('uc.micro');
|
11615 |
|
11616 | exports.assign = assign;
|
11617 | exports.isString = isString;
|
11618 | exports.has = has;
|
11619 | exports.unescapeMd = unescapeMd;
|
11620 | exports.unescapeAll = unescapeAll;
|
11621 | exports.isValidEntityCode = isValidEntityCode;
|
11622 | exports.fromCodePoint = fromCodePoint;
|
11623 | // exports.replaceEntities = replaceEntities;
|
11624 | exports.escapeHtml = escapeHtml;
|
11625 | exports.arrayReplaceAt = arrayReplaceAt;
|
11626 | exports.isSpace = isSpace;
|
11627 | exports.isWhiteSpace = isWhiteSpace;
|
11628 | exports.isMdAsciiPunct = isMdAsciiPunct;
|
11629 | exports.isPunctChar = isPunctChar;
|
11630 | exports.escapeRE = escapeRE;
|
11631 | exports.normalizeReference = normalizeReference;
|
11632 |
|
11633 | },{"./entities":29,"mdurl":84,"uc.micro":90,"uc.micro/categories/P/regex":88}],33:[function(require,module,exports){
|
11634 | // Just a shortcut for bulk export
|
11635 | 'use strict';
|
11636 |
|
11637 |
|
11638 | exports.parseLinkLabel = require('./parse_link_label');
|
11639 | exports.parseLinkDestination = require('./parse_link_destination');
|
11640 | exports.parseLinkTitle = require('./parse_link_title');
|
11641 |
|
11642 | },{"./parse_link_destination":34,"./parse_link_label":35,"./parse_link_title":36}],34:[function(require,module,exports){
|
11643 | // Parse link destination
|
11644 | //
|
11645 | 'use strict';
|
11646 |
|
11647 |
|
11648 | var isSpace = require('../common/utils').isSpace;
|
11649 | var unescapeAll = require('../common/utils').unescapeAll;
|
11650 |
|
11651 |
|
11652 | module.exports = function parseLinkDestination(str, pos, max) {
|
11653 | var code, level,
|
11654 | lines = 0,
|
11655 | start = pos,
|
11656 | result = {
|
11657 | ok: false,
|
11658 | pos: 0,
|
11659 | lines: 0,
|
11660 | str: ''
|
11661 | };
|
11662 |
|
11663 | if (str.charCodeAt(pos) === 0x3C /* < */) {
|
11664 | pos++;
|
11665 | while (pos < max) {
|
11666 | code = str.charCodeAt(pos);
|
11667 | if (code === 0x0A /* \n */ || isSpace(code)) { return result; }
|
11668 | if (code === 0x3E /* > */) {
|
11669 | result.pos = pos + 1;
|
11670 | result.str = unescapeAll(str.slice(start + 1, pos));
|
11671 | result.ok = true;
|
11672 | return result;
|
11673 | }
|
11674 | if (code === 0x5C /* \ */ && pos + 1 < max) {
|
11675 | pos += 2;
|
11676 | continue;
|
11677 | }
|
11678 |
|
11679 | pos++;
|
11680 | }
|
11681 |
|
11682 | // no closing '>'
|
11683 | return result;
|
11684 | }
|
11685 |
|
11686 | // this should be ... } else { ... branch
|
11687 |
|
11688 | level = 0;
|
11689 | while (pos < max) {
|
11690 | code = str.charCodeAt(pos);
|
11691 |
|
11692 | if (code === 0x20) { break; }
|
11693 |
|
11694 | // ascii control characters
|
11695 | if (code < 0x20 || code === 0x7F) { break; }
|
11696 |
|
11697 | if (code === 0x5C /* \ */ && pos + 1 < max) {
|
11698 | pos += 2;
|
11699 | continue;
|
11700 | }
|
11701 |
|
11702 | if (code === 0x28 /* ( */) {
|
11703 | level++;
|
11704 | if (level > 1) { break; }
|
11705 | }
|
11706 |
|
11707 | if (code === 0x29 /* ) */) {
|
11708 | level--;
|
11709 | if (level < 0) { break; }
|
11710 | }
|
11711 |
|
11712 | pos++;
|
11713 | }
|
11714 |
|
11715 | if (start === pos) { return result; }
|
11716 |
|
11717 | result.str = unescapeAll(str.slice(start, pos));
|
11718 | result.lines = lines;
|
11719 | result.pos = pos;
|
11720 | result.ok = true;
|
11721 | return result;
|
11722 | };
|
11723 |
|
11724 | },{"../common/utils":32}],35:[function(require,module,exports){
|
11725 | // Parse link label
|
11726 | //
|
11727 | // this function assumes that first character ("[") already matches;
|
11728 | // returns the end of the label
|
11729 | //
|
11730 | 'use strict';
|
11731 |
|
11732 | module.exports = function parseLinkLabel(state, start, disableNested) {
|
11733 | var level, found, marker, prevPos,
|
11734 | labelEnd = -1,
|
11735 | max = state.posMax,
|
11736 | oldPos = state.pos;
|
11737 |
|
11738 | state.pos = start + 1;
|
11739 | level = 1;
|
11740 |
|
11741 | while (state.pos < max) {
|
11742 | marker = state.src.charCodeAt(state.pos);
|
11743 | if (marker === 0x5D /* ] */) {
|
11744 | level--;
|
11745 | if (level === 0) {
|
11746 | found = true;
|
11747 | break;
|
11748 | }
|
11749 | }
|
11750 |
|
11751 | prevPos = state.pos;
|
11752 | state.md.inline.skipToken(state);
|
11753 | if (marker === 0x5B /* [ */) {
|
11754 | if (prevPos === state.pos - 1) {
|
11755 | // increase level if we find text `[`, which is not a part of any token
|
11756 | level++;
|
11757 | } else if (disableNested) {
|
11758 | state.pos = oldPos;
|
11759 | return -1;
|
11760 | }
|
11761 | }
|
11762 | }
|
11763 |
|
11764 | if (found) {
|
11765 | labelEnd = state.pos;
|
11766 | }
|
11767 |
|
11768 | // restore old state
|
11769 | state.pos = oldPos;
|
11770 |
|
11771 | return labelEnd;
|
11772 | };
|
11773 |
|
11774 | },{}],36:[function(require,module,exports){
|
11775 | // Parse link title
|
11776 | //
|
11777 | 'use strict';
|
11778 |
|
11779 |
|
11780 | var unescapeAll = require('../common/utils').unescapeAll;
|
11781 |
|
11782 |
|
11783 | module.exports = function parseLinkTitle(str, pos, max) {
|
11784 | var code,
|
11785 | marker,
|
11786 | lines = 0,
|
11787 | start = pos,
|
11788 | result = {
|
11789 | ok: false,
|
11790 | pos: 0,
|
11791 | lines: 0,
|
11792 | str: ''
|
11793 | };
|
11794 |
|
11795 | if (pos >= max) { return result; }
|
11796 |
|
11797 | marker = str.charCodeAt(pos);
|
11798 |
|
11799 | if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
|
11800 |
|
11801 | pos++;
|
11802 |
|
11803 | // if opening marker is "(", switch it to closing marker ")"
|
11804 | if (marker === 0x28) { marker = 0x29; }
|
11805 |
|
11806 | while (pos < max) {
|
11807 | code = str.charCodeAt(pos);
|
11808 | if (code === marker) {
|
11809 | result.pos = pos + 1;
|
11810 | result.lines = lines;
|
11811 | result.str = unescapeAll(str.slice(start + 1, pos));
|
11812 | result.ok = true;
|
11813 | return result;
|
11814 | } else if (code === 0x0A) {
|
11815 | lines++;
|
11816 | } else if (code === 0x5C /* \ */ && pos + 1 < max) {
|
11817 | pos++;
|
11818 | if (str.charCodeAt(pos) === 0x0A) {
|
11819 | lines++;
|
11820 | }
|
11821 | }
|
11822 |
|
11823 | pos++;
|
11824 | }
|
11825 |
|
11826 | return result;
|
11827 | };
|
11828 |
|
11829 | },{"../common/utils":32}],37:[function(require,module,exports){
|
11830 | // Main perser class
|
11831 |
|
11832 | 'use strict';
|
11833 |
|
11834 |
|
11835 | var utils = require('./common/utils');
|
11836 | var helpers = require('./helpers');
|
11837 | var Renderer = require('./renderer');
|
11838 | var ParserCore = require('./parser_core');
|
11839 | var ParserBlock = require('./parser_block');
|
11840 | var ParserInline = require('./parser_inline');
|
11841 | var LinkifyIt = require('linkify-it');
|
11842 | var mdurl = require('mdurl');
|
11843 | var punycode = require('punycode');
|
11844 |
|
11845 |
|
11846 | var config = {
|
11847 | 'default': require('./presets/default'),
|
11848 | zero: require('./presets/zero'),
|
11849 | commonmark: require('./presets/commonmark')
|
11850 | };
|
11851 |
|
11852 | ////////////////////////////////////////////////////////////////////////////////
|
11853 | //
|
11854 | // This validator can prohibit more than really needed to prevent XSS. It's a
|
11855 | // tradeoff to keep code simple and to be secure by default.
|
11856 | //
|
11857 | // If you need different setup - override validator method as you wish. Or
|
11858 | // replace it with dummy function and use external sanitizer.
|
11859 | //
|
11860 |
|
11861 | var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
|
11862 | var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
|
11863 |
|
11864 | function validateLink(url) {
|
11865 | // url should be normalized at this point, and existing entities are decoded
|
11866 | var str = url.trim().toLowerCase();
|
11867 |
|
11868 | return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
|
11869 | }
|
11870 |
|
11871 | ////////////////////////////////////////////////////////////////////////////////
|
11872 |
|
11873 |
|
11874 | var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
|
11875 |
|
11876 | function normalizeLink(url) {
|
11877 | var parsed = mdurl.parse(url, true);
|
11878 |
|
11879 | if (parsed.hostname) {
|
11880 | // Encode hostnames in urls like:
|
11881 | // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
|
11882 | //
|
11883 | // We don't encode unknown schemas, because it's likely that we encode
|
11884 | // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
|
11885 | //
|
11886 | if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
|
11887 | try {
|
11888 | parsed.hostname = punycode.toASCII(parsed.hostname);
|
11889 | } catch (er) { /**/ }
|
11890 | }
|
11891 | }
|
11892 |
|
11893 | return mdurl.encode(mdurl.format(parsed));
|
11894 | }
|
11895 |
|
11896 | function normalizeLinkText(url) {
|
11897 | var parsed = mdurl.parse(url, true);
|
11898 |
|
11899 | if (parsed.hostname) {
|
11900 | // Encode hostnames in urls like:
|
11901 | // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
|
11902 | //
|
11903 | // We don't encode unknown schemas, because it's likely that we encode
|
11904 | // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
|
11905 | //
|
11906 | if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
|
11907 | try {
|
11908 | parsed.hostname = punycode.toUnicode(parsed.hostname);
|
11909 | } catch (er) { /**/ }
|
11910 | }
|
11911 | }
|
11912 |
|
11913 | return mdurl.decode(mdurl.format(parsed));
|
11914 | }
|
11915 |
|
11916 |
|
11917 | /**
|
11918 | * class MarkdownIt
|
11919 | *
|
11920 | * Main parser/renderer class.
|
11921 | *
|
11922 | * ##### Usage
|
11923 | *
|
11924 | * ```javascript
|
11925 | * // node.js, "classic" way:
|
11926 | * var MarkdownIt = require('markdown-it'),
|
11927 | * md = new MarkdownIt();
|
11928 | * var result = md.render('# markdown-it rulezz!');
|
11929 | *
|
11930 | * // node.js, the same, but with sugar:
|
11931 | * var md = require('markdown-it')();
|
11932 | * var result = md.render('# markdown-it rulezz!');
|
11933 | *
|
11934 | * // browser without AMD, added to "window" on script load
|
11935 | * // Note, there are no dash.
|
11936 | * var md = window.markdownit();
|
11937 | * var result = md.render('# markdown-it rulezz!');
|
11938 | * ```
|
11939 | *
|
11940 | * Single line rendering, without paragraph wrap:
|
11941 | *
|
11942 | * ```javascript
|
11943 | * var md = require('markdown-it')();
|
11944 | * var result = md.renderInline('__markdown-it__ rulezz!');
|
11945 | * ```
|
11946 | **/
|
11947 |
|
11948 | /**
|
11949 | * new MarkdownIt([presetName, options])
|
11950 | * - presetName (String): optional, `commonmark` / `zero`
|
11951 | * - options (Object)
|
11952 | *
|
11953 | * Creates parser instanse with given config. Can be called without `new`.
|
11954 | *
|
11955 | * ##### presetName
|
11956 | *
|
11957 | * MarkdownIt provides named presets as a convenience to quickly
|
11958 | * enable/disable active syntax rules and options for common use cases.
|
11959 | *
|
11960 | * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
|
11961 | * configures parser to strict [CommonMark](http://commonmark.org/) mode.
|
11962 | * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
|
11963 | * similar to GFM, used when no preset name given. Enables all available rules,
|
11964 | * but still without html, typographer & autolinker.
|
11965 | * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
|
11966 | * all rules disabled. Useful to quickly setup your config via `.enable()`.
|
11967 | * For example, when you need only `bold` and `italic` markup and nothing else.
|
11968 | *
|
11969 | * ##### options:
|
11970 | *
|
11971 | * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
|
11972 | * That's not safe! You may need external sanitizer to protect output from XSS.
|
11973 | * It's better to extend features via plugins, instead of enabling HTML.
|
11974 | * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
|
11975 | * (`<br />`). This is needed only for full CommonMark compatibility. In real
|
11976 | * world you will need HTML output.
|
11977 | * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
|
11978 | * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
|
11979 | * Can be useful for external highlighters.
|
11980 | * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
|
11981 | * - __typographer__ - `false`. Set `true` to enable [some language-neutral
|
11982 | * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
|
11983 | * quotes beautification (smartquotes).
|
11984 | * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
|
11985 | * pairs, when typographer enabled and smartquotes on. For example, you can
|
11986 | * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
|
11987 | * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
|
11988 | * - __highlight__ - `null`. Highlighter function for fenced code blocks.
|
11989 | * Highlighter `function (str, lang)` should return escaped HTML. It can also
|
11990 | * return empty string if the source was not changed and should be escaped
|
11991 | * externaly. If result starts with <pre... internal wrapper is skipped.
|
11992 | *
|
11993 | * ##### Example
|
11994 | *
|
11995 | * ```javascript
|
11996 | * // commonmark mode
|
11997 | * var md = require('markdown-it')('commonmark');
|
11998 | *
|
11999 | * // default mode
|
12000 | * var md = require('markdown-it')();
|
12001 | *
|
12002 | * // enable everything
|
12003 | * var md = require('markdown-it')({
|
12004 | * html: true,
|
12005 | * linkify: true,
|
12006 | * typographer: true
|
12007 | * });
|
12008 | * ```
|
12009 | *
|
12010 | * ##### Syntax highlighting
|
12011 | *
|
12012 | * ```js
|
12013 | * var hljs = require('highlight.js') // https://highlightjs.org/
|
12014 | *
|
12015 | * var md = require('markdown-it')({
|
12016 | * highlight: function (str, lang) {
|
12017 | * if (lang && hljs.getLanguage(lang)) {
|
12018 | * try {
|
12019 | * return hljs.highlight(lang, str, true).value;
|
12020 | * } catch (__) {}
|
12021 | * }
|
12022 | *
|
12023 | * return ''; // use external default escaping
|
12024 | * }
|
12025 | * });
|
12026 | * ```
|
12027 | *
|
12028 | * Or with full wrapper override (if you need assign class to `<pre>`):
|
12029 | *
|
12030 | * ```javascript
|
12031 | * var hljs = require('highlight.js') // https://highlightjs.org/
|
12032 | *
|
12033 | * // Actual default values
|
12034 | * var md = require('markdown-it')({
|
12035 | * highlight: function (str, lang) {
|
12036 | * if (lang && hljs.getLanguage(lang)) {
|
12037 | * try {
|
12038 | * return '<pre class="hljs"><code>' +
|
12039 | * hljs.highlight(lang, str, true).value +
|
12040 | * '</code></pre>';
|
12041 | * } catch (__) {}
|
12042 | * }
|
12043 | *
|
12044 | * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
|
12045 | * }
|
12046 | * });
|
12047 | * ```
|
12048 | *
|
12049 | **/
|
12050 | function MarkdownIt(presetName, options) {
|
12051 | if (!(this instanceof MarkdownIt)) {
|
12052 | return new MarkdownIt(presetName, options);
|
12053 | }
|
12054 |
|
12055 | if (!options) {
|
12056 | if (!utils.isString(presetName)) {
|
12057 | options = presetName || {};
|
12058 | presetName = 'default';
|
12059 | }
|
12060 | }
|
12061 |
|
12062 | /**
|
12063 | * MarkdownIt#inline -> ParserInline
|
12064 | *
|
12065 | * Instance of [[ParserInline]]. You may need it to add new rules when
|
12066 | * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
|
12067 | * [[MarkdownIt.enable]].
|
12068 | **/
|
12069 | this.inline = new ParserInline();
|
12070 |
|
12071 | /**
|
12072 | * MarkdownIt#block -> ParserBlock
|
12073 | *
|
12074 | * Instance of [[ParserBlock]]. You may need it to add new rules when
|
12075 | * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
|
12076 | * [[MarkdownIt.enable]].
|
12077 | **/
|
12078 | this.block = new ParserBlock();
|
12079 |
|
12080 | /**
|
12081 | * MarkdownIt#core -> Core
|
12082 | *
|
12083 | * Instance of [[Core]] chain executor. You may need it to add new rules when
|
12084 | * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
|
12085 | * [[MarkdownIt.enable]].
|
12086 | **/
|
12087 | this.core = new ParserCore();
|
12088 |
|
12089 | /**
|
12090 | * MarkdownIt#renderer -> Renderer
|
12091 | *
|
12092 | * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
|
12093 | * rules for new token types, generated by plugins.
|
12094 | *
|
12095 | * ##### Example
|
12096 | *
|
12097 | * ```javascript
|
12098 | * var md = require('markdown-it')();
|
12099 | *
|
12100 | * function myToken(tokens, idx, options, env, self) {
|
12101 | * //...
|
12102 | * return result;
|
12103 | * };
|
12104 | *
|
12105 | * md.renderer.rules['my_token'] = myToken
|
12106 | * ```
|
12107 | *
|
12108 | * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
|
12109 | **/
|
12110 | this.renderer = new Renderer();
|
12111 |
|
12112 | /**
|
12113 | * MarkdownIt#linkify -> LinkifyIt
|
12114 | *
|
12115 | * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
|
12116 | * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
|
12117 | * rule.
|
12118 | **/
|
12119 | this.linkify = new LinkifyIt();
|
12120 |
|
12121 | /**
|
12122 | * MarkdownIt#validateLink(url) -> Boolean
|
12123 | *
|
12124 | * Link validation function. CommonMark allows too much in links. By default
|
12125 | * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
|
12126 | * except some embedded image types.
|
12127 | *
|
12128 | * You can change this behaviour:
|
12129 | *
|
12130 | * ```javascript
|
12131 | * var md = require('markdown-it')();
|
12132 | * // enable everything
|
12133 | * md.validateLink = function () { return true; }
|
12134 | * ```
|
12135 | **/
|
12136 | this.validateLink = validateLink;
|
12137 |
|
12138 | /**
|
12139 | * MarkdownIt#normalizeLink(url) -> String
|
12140 | *
|
12141 | * Function used to encode link url to a machine-readable format,
|
12142 | * which includes url-encoding, punycode, etc.
|
12143 | **/
|
12144 | this.normalizeLink = normalizeLink;
|
12145 |
|
12146 | /**
|
12147 | * MarkdownIt#normalizeLinkText(url) -> String
|
12148 | *
|
12149 | * Function used to decode link url to a human-readable format`
|
12150 | **/
|
12151 | this.normalizeLinkText = normalizeLinkText;
|
12152 |
|
12153 |
|
12154 | // Expose utils & helpers for easy acces from plugins
|
12155 |
|
12156 | /**
|
12157 | * MarkdownIt#utils -> utils
|
12158 | *
|
12159 | * Assorted utility functions, useful to write plugins. See details
|
12160 | * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
|
12161 | **/
|
12162 | this.utils = utils;
|
12163 |
|
12164 | /**
|
12165 | * MarkdownIt#helpers -> helpers
|
12166 | *
|
12167 | * Link components parser functions, useful to write plugins. See details
|
12168 | * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
|
12169 | **/
|
12170 | this.helpers = helpers;
|
12171 |
|
12172 |
|
12173 | this.options = {};
|
12174 | this.configure(presetName);
|
12175 |
|
12176 | if (options) { this.set(options); }
|
12177 | }
|
12178 |
|
12179 |
|
12180 | /** chainable
|
12181 | * MarkdownIt.set(options)
|
12182 | *
|
12183 | * Set parser options (in the same format as in constructor). Probably, you
|
12184 | * will never need it, but you can change options after constructor call.
|
12185 | *
|
12186 | * ##### Example
|
12187 | *
|
12188 | * ```javascript
|
12189 | * var md = require('markdown-it')()
|
12190 | * .set({ html: true, breaks: true })
|
12191 | * .set({ typographer, true });
|
12192 | * ```
|
12193 | *
|
12194 | * __Note:__ To achieve the best possible performance, don't modify a
|
12195 | * `markdown-it` instance options on the fly. If you need multiple configurations
|
12196 | * it's best to create multiple instances and initialize each with separate
|
12197 | * config.
|
12198 | **/
|
12199 | MarkdownIt.prototype.set = function (options) {
|
12200 | utils.assign(this.options, options);
|
12201 | return this;
|
12202 | };
|
12203 |
|
12204 |
|
12205 | /** chainable, internal
|
12206 | * MarkdownIt.configure(presets)
|
12207 | *
|
12208 | * Batch load of all options and compenent settings. This is internal method,
|
12209 | * and you probably will not need it. But if you with - see available presets
|
12210 | * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
|
12211 | *
|
12212 | * We strongly recommend to use presets instead of direct config loads. That
|
12213 | * will give better compatibility with next versions.
|
12214 | **/
|
12215 | MarkdownIt.prototype.configure = function (presets) {
|
12216 | var self = this, presetName;
|
12217 |
|
12218 | if (utils.isString(presets)) {
|
12219 | presetName = presets;
|
12220 | presets = config[presetName];
|
12221 | if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
|
12222 | }
|
12223 |
|
12224 | if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
|
12225 |
|
12226 | if (presets.options) { self.set(presets.options); }
|
12227 |
|
12228 | if (presets.components) {
|
12229 | Object.keys(presets.components).forEach(function (name) {
|
12230 | if (presets.components[name].rules) {
|
12231 | self[name].ruler.enableOnly(presets.components[name].rules);
|
12232 | }
|
12233 | if (presets.components[name].rules2) {
|
12234 | self[name].ruler2.enableOnly(presets.components[name].rules2);
|
12235 | }
|
12236 | });
|
12237 | }
|
12238 | return this;
|
12239 | };
|
12240 |
|
12241 |
|
12242 | /** chainable
|
12243 | * MarkdownIt.enable(list, ignoreInvalid)
|
12244 | * - list (String|Array): rule name or list of rule names to enable
|
12245 | * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
|
12246 | *
|
12247 | * Enable list or rules. It will automatically find appropriate components,
|
12248 | * containing rules with given names. If rule not found, and `ignoreInvalid`
|
12249 | * not set - throws exception.
|
12250 | *
|
12251 | * ##### Example
|
12252 | *
|
12253 | * ```javascript
|
12254 | * var md = require('markdown-it')()
|
12255 | * .enable(['sub', 'sup'])
|
12256 | * .disable('smartquotes');
|
12257 | * ```
|
12258 | **/
|
12259 | MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
|
12260 | var result = [];
|
12261 |
|
12262 | if (!Array.isArray(list)) { list = [ list ]; }
|
12263 |
|
12264 | [ 'core', 'block', 'inline' ].forEach(function (chain) {
|
12265 | result = result.concat(this[chain].ruler.enable(list, true));
|
12266 | }, this);
|
12267 |
|
12268 | result = result.concat(this.inline.ruler2.enable(list, true));
|
12269 |
|
12270 | var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
|
12271 |
|
12272 | if (missed.length && !ignoreInvalid) {
|
12273 | throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
|
12274 | }
|
12275 |
|
12276 | return this;
|
12277 | };
|
12278 |
|
12279 |
|
12280 | /** chainable
|
12281 | * MarkdownIt.disable(list, ignoreInvalid)
|
12282 | * - list (String|Array): rule name or list of rule names to disable.
|
12283 | * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
|
12284 | *
|
12285 | * The same as [[MarkdownIt.enable]], but turn specified rules off.
|
12286 | **/
|
12287 | MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
|
12288 | var result = [];
|
12289 |
|
12290 | if (!Array.isArray(list)) { list = [ list ]; }
|
12291 |
|
12292 | [ 'core', 'block', 'inline' ].forEach(function (chain) {
|
12293 | result = result.concat(this[chain].ruler.disable(list, true));
|
12294 | }, this);
|
12295 |
|
12296 | result = result.concat(this.inline.ruler2.disable(list, true));
|
12297 |
|
12298 | var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
|
12299 |
|
12300 | if (missed.length && !ignoreInvalid) {
|
12301 | throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
|
12302 | }
|
12303 | return this;
|
12304 | };
|
12305 |
|
12306 |
|
12307 | /** chainable
|
12308 | * MarkdownIt.use(plugin, params)
|
12309 | *
|
12310 | * Load specified plugin with given params into current parser instance.
|
12311 | * It's just a sugar to call `plugin(md, params)` with curring.
|
12312 | *
|
12313 | * ##### Example
|
12314 | *
|
12315 | * ```javascript
|
12316 | * var iterator = require('markdown-it-for-inline');
|
12317 | * var md = require('markdown-it')()
|
12318 | * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
|
12319 | * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
|
12320 | * });
|
12321 | * ```
|
12322 | **/
|
12323 | MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
|
12324 | var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
|
12325 | plugin.apply(plugin, args);
|
12326 | return this;
|
12327 | };
|
12328 |
|
12329 |
|
12330 | /** internal
|
12331 | * MarkdownIt.parse(src, env) -> Array
|
12332 | * - src (String): source string
|
12333 | * - env (Object): environment sandbox
|
12334 | *
|
12335 | * Parse input string and returns list of block tokens (special token type
|
12336 | * "inline" will contain list of inline tokens). You should not call this
|
12337 | * method directly, until you write custom renderer (for example, to produce
|
12338 | * AST).
|
12339 | *
|
12340 | * `env` is used to pass data between "distributed" rules and return additional
|
12341 | * metadata like reference info, needed for the renderer. It also can be used to
|
12342 | * inject data in specific cases. Usually, you will be ok to pass `{}`,
|
12343 | * and then pass updated object to renderer.
|
12344 | **/
|
12345 | MarkdownIt.prototype.parse = function (src, env) {
|
12346 | var state = new this.core.State(src, this, env);
|
12347 |
|
12348 | this.core.process(state);
|
12349 |
|
12350 | return state.tokens;
|
12351 | };
|
12352 |
|
12353 |
|
12354 | /**
|
12355 | * MarkdownIt.render(src [, env]) -> String
|
12356 | * - src (String): source string
|
12357 | * - env (Object): environment sandbox
|
12358 | *
|
12359 | * Render markdown string into html. It does all magic for you :).
|
12360 | *
|
12361 | * `env` can be used to inject additional metadata (`{}` by default).
|
12362 | * But you will not need it with high probability. See also comment
|
12363 | * in [[MarkdownIt.parse]].
|
12364 | **/
|
12365 | MarkdownIt.prototype.render = function (src, env) {
|
12366 | env = env || {};
|
12367 |
|
12368 | return this.renderer.render(this.parse(src, env), this.options, env);
|
12369 | };
|
12370 |
|
12371 |
|
12372 | /** internal
|
12373 | * MarkdownIt.parseInline(src, env) -> Array
|
12374 | * - src (String): source string
|
12375 | * - env (Object): environment sandbox
|
12376 | *
|
12377 | * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
|
12378 | * block tokens list with the single `inline` element, containing parsed inline
|
12379 | * tokens in `children` property. Also updates `env` object.
|
12380 | **/
|
12381 | MarkdownIt.prototype.parseInline = function (src, env) {
|
12382 | var state = new this.core.State(src, this, env);
|
12383 |
|
12384 | state.inlineMode = true;
|
12385 | this.core.process(state);
|
12386 |
|
12387 | return state.tokens;
|
12388 | };
|
12389 |
|
12390 |
|
12391 | /**
|
12392 | * MarkdownIt.renderInline(src [, env]) -> String
|
12393 | * - src (String): source string
|
12394 | * - env (Object): environment sandbox
|
12395 | *
|
12396 | * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
|
12397 | * will NOT be wrapped into `<p>` tags.
|
12398 | **/
|
12399 | MarkdownIt.prototype.renderInline = function (src, env) {
|
12400 | env = env || {};
|
12401 |
|
12402 | return this.renderer.render(this.parseInline(src, env), this.options, env);
|
12403 | };
|
12404 |
|
12405 |
|
12406 | module.exports = MarkdownIt;
|
12407 |
|
12408 | },{"./common/utils":32,"./helpers":33,"./parser_block":38,"./parser_core":39,"./parser_inline":40,"./presets/commonmark":41,"./presets/default":42,"./presets/zero":43,"./renderer":44,"linkify-it":26,"mdurl":84,"punycode":92}],38:[function(require,module,exports){
|
12409 | /** internal
|
12410 | * class ParserBlock
|
12411 | *
|
12412 | * Block-level tokenizer.
|
12413 | **/
|
12414 | 'use strict';
|
12415 |
|
12416 |
|
12417 | var Ruler = require('./ruler');
|
12418 |
|
12419 |
|
12420 | var _rules = [
|
12421 | // First 2 params - rule name & source. Secondary array - list of rules,
|
12422 | // which can be terminated by this one.
|
12423 | [ 'table', require('./rules_block/table'), [ 'paragraph', 'reference' ] ],
|
12424 | [ 'code', require('./rules_block/code') ],
|
12425 | [ 'fence', require('./rules_block/fence'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
|
12426 | [ 'blockquote', require('./rules_block/blockquote'), [ 'paragraph', 'reference', 'list' ] ],
|
12427 | [ 'hr', require('./rules_block/hr'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
|
12428 | [ 'list', require('./rules_block/list'), [ 'paragraph', 'reference', 'blockquote' ] ],
|
12429 | [ 'reference', require('./rules_block/reference') ],
|
12430 | [ 'heading', require('./rules_block/heading'), [ 'paragraph', 'reference', 'blockquote' ] ],
|
12431 | [ 'lheading', require('./rules_block/lheading') ],
|
12432 | [ 'html_block', require('./rules_block/html_block'), [ 'paragraph', 'reference', 'blockquote' ] ],
|
12433 | [ 'paragraph', require('./rules_block/paragraph') ]
|
12434 | ];
|
12435 |
|
12436 |
|
12437 | /**
|
12438 | * new ParserBlock()
|
12439 | **/
|
12440 | function ParserBlock() {
|
12441 | /**
|
12442 | * ParserBlock#ruler -> Ruler
|
12443 | *
|
12444 | * [[Ruler]] instance. Keep configuration of block rules.
|
12445 | **/
|
12446 | this.ruler = new Ruler();
|
12447 |
|
12448 | for (var i = 0; i < _rules.length; i++) {
|
12449 | this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
|
12450 | }
|
12451 | }
|
12452 |
|
12453 |
|
12454 | // Generate tokens for input range
|
12455 | //
|
12456 | ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
|
12457 | var ok, i,
|
12458 | rules = this.ruler.getRules(''),
|
12459 | len = rules.length,
|
12460 | line = startLine,
|
12461 | hasEmptyLines = false,
|
12462 | maxNesting = state.md.options.maxNesting;
|
12463 |
|
12464 | while (line < endLine) {
|
12465 | state.line = line = state.skipEmptyLines(line);
|
12466 | if (line >= endLine) { break; }
|
12467 |
|
12468 | // Termination condition for nested calls.
|
12469 | // Nested calls currently used for blockquotes & lists
|
12470 | if (state.sCount[line] < state.blkIndent) { break; }
|
12471 |
|
12472 | // If nesting level exceeded - skip tail to the end. That's not ordinary
|
12473 | // situation and we should not care about content.
|
12474 | if (state.level >= maxNesting) {
|
12475 | state.line = endLine;
|
12476 | break;
|
12477 | }
|
12478 |
|
12479 | // Try all possible rules.
|
12480 | // On success, rule should:
|
12481 | //
|
12482 | // - update `state.line`
|
12483 | // - update `state.tokens`
|
12484 | // - return true
|
12485 |
|
12486 | for (i = 0; i < len; i++) {
|
12487 | ok = rules[i](state, line, endLine, false);
|
12488 | if (ok) { break; }
|
12489 | }
|
12490 |
|
12491 | // set state.tight iff we had an empty line before current tag
|
12492 | // i.e. latest empty line should not count
|
12493 | state.tight = !hasEmptyLines;
|
12494 |
|
12495 | // paragraph might "eat" one newline after it in nested lists
|
12496 | if (state.isEmpty(state.line - 1)) {
|
12497 | hasEmptyLines = true;
|
12498 | }
|
12499 |
|
12500 | line = state.line;
|
12501 |
|
12502 | if (line < endLine && state.isEmpty(line)) {
|
12503 | hasEmptyLines = true;
|
12504 | line++;
|
12505 |
|
12506 | // two empty lines should stop the parser in list mode
|
12507 | if (line < endLine && state.parentType === 'list' && state.isEmpty(line)) { break; }
|
12508 | state.line = line;
|
12509 | }
|
12510 | }
|
12511 | };
|
12512 |
|
12513 |
|
12514 | /**
|
12515 | * ParserBlock.parse(str, md, env, outTokens)
|
12516 | *
|
12517 | * Process input string and push block tokens into `outTokens`
|
12518 | **/
|
12519 | ParserBlock.prototype.parse = function (src, md, env, outTokens) {
|
12520 | var state;
|
12521 |
|
12522 | if (!src) { return []; }
|
12523 |
|
12524 | state = new this.State(src, md, env, outTokens);
|
12525 |
|
12526 | this.tokenize(state, state.line, state.lineMax);
|
12527 | };
|
12528 |
|
12529 |
|
12530 | ParserBlock.prototype.State = require('./rules_block/state_block');
|
12531 |
|
12532 |
|
12533 | module.exports = ParserBlock;
|
12534 |
|
12535 | },{"./ruler":45,"./rules_block/blockquote":46,"./rules_block/code":47,"./rules_block/fence":48,"./rules_block/heading":49,"./rules_block/hr":50,"./rules_block/html_block":51,"./rules_block/lheading":52,"./rules_block/list":53,"./rules_block/paragraph":54,"./rules_block/reference":55,"./rules_block/state_block":56,"./rules_block/table":57}],39:[function(require,module,exports){
|
12536 | /** internal
|
12537 | * class Core
|
12538 | *
|
12539 | * Top-level rules executor. Glues block/inline parsers and does intermediate
|
12540 | * transformations.
|
12541 | **/
|
12542 | 'use strict';
|
12543 |
|
12544 |
|
12545 | var Ruler = require('./ruler');
|
12546 |
|
12547 |
|
12548 | var _rules = [
|
12549 | [ 'normalize', require('./rules_core/normalize') ],
|
12550 | [ 'block', require('./rules_core/block') ],
|
12551 | [ 'inline', require('./rules_core/inline') ],
|
12552 | [ 'linkify', require('./rules_core/linkify') ],
|
12553 | [ 'replacements', require('./rules_core/replacements') ],
|
12554 | [ 'smartquotes', require('./rules_core/smartquotes') ]
|
12555 | ];
|
12556 |
|
12557 |
|
12558 | /**
|
12559 | * new Core()
|
12560 | **/
|
12561 | function Core() {
|
12562 | /**
|
12563 | * Core#ruler -> Ruler
|
12564 | *
|
12565 | * [[Ruler]] instance. Keep configuration of core rules.
|
12566 | **/
|
12567 | this.ruler = new Ruler();
|
12568 |
|
12569 | for (var i = 0; i < _rules.length; i++) {
|
12570 | this.ruler.push(_rules[i][0], _rules[i][1]);
|
12571 | }
|
12572 | }
|
12573 |
|
12574 |
|
12575 | /**
|
12576 | * Core.process(state)
|
12577 | *
|
12578 | * Executes core chain rules.
|
12579 | **/
|
12580 | Core.prototype.process = function (state) {
|
12581 | var i, l, rules;
|
12582 |
|
12583 | rules = this.ruler.getRules('');
|
12584 |
|
12585 | for (i = 0, l = rules.length; i < l; i++) {
|
12586 | rules[i](state);
|
12587 | }
|
12588 | };
|
12589 |
|
12590 | Core.prototype.State = require('./rules_core/state_core');
|
12591 |
|
12592 |
|
12593 | module.exports = Core;
|
12594 |
|
12595 | },{"./ruler":45,"./rules_core/block":58,"./rules_core/inline":59,"./rules_core/linkify":60,"./rules_core/normalize":61,"./rules_core/replacements":62,"./rules_core/smartquotes":63,"./rules_core/state_core":64}],40:[function(require,module,exports){
|
12596 | /** internal
|
12597 | * class ParserInline
|
12598 | *
|
12599 | * Tokenizes paragraph content.
|
12600 | **/
|
12601 | 'use strict';
|
12602 |
|
12603 |
|
12604 | var Ruler = require('./ruler');
|
12605 |
|
12606 |
|
12607 | ////////////////////////////////////////////////////////////////////////////////
|
12608 | // Parser rules
|
12609 |
|
12610 | var _rules = [
|
12611 | [ 'text', require('./rules_inline/text') ],
|
12612 | [ 'newline', require('./rules_inline/newline') ],
|
12613 | [ 'escape', require('./rules_inline/escape') ],
|
12614 | [ 'backticks', require('./rules_inline/backticks') ],
|
12615 | [ 'strikethrough', require('./rules_inline/strikethrough').tokenize ],
|
12616 | [ 'emphasis', require('./rules_inline/emphasis').tokenize ],
|
12617 | [ 'link', require('./rules_inline/link') ],
|
12618 | [ 'image', require('./rules_inline/image') ],
|
12619 | [ 'autolink', require('./rules_inline/autolink') ],
|
12620 | [ 'html_inline', require('./rules_inline/html_inline') ],
|
12621 | [ 'entity', require('./rules_inline/entity') ]
|
12622 | ];
|
12623 |
|
12624 | var _rules2 = [
|
12625 | [ 'balance_pairs', require('./rules_inline/balance_pairs') ],
|
12626 | [ 'strikethrough', require('./rules_inline/strikethrough').postProcess ],
|
12627 | [ 'emphasis', require('./rules_inline/emphasis').postProcess ],
|
12628 | [ 'text_collapse', require('./rules_inline/text_collapse') ]
|
12629 | ];
|
12630 |
|
12631 |
|
12632 | /**
|
12633 | * new ParserInline()
|
12634 | **/
|
12635 | function ParserInline() {
|
12636 | var i;
|
12637 |
|
12638 | /**
|
12639 | * ParserInline#ruler -> Ruler
|
12640 | *
|
12641 | * [[Ruler]] instance. Keep configuration of inline rules.
|
12642 | **/
|
12643 | this.ruler = new Ruler();
|
12644 |
|
12645 | for (i = 0; i < _rules.length; i++) {
|
12646 | this.ruler.push(_rules[i][0], _rules[i][1]);
|
12647 | }
|
12648 |
|
12649 | /**
|
12650 | * ParserInline#ruler2 -> Ruler
|
12651 | *
|
12652 | * [[Ruler]] instance. Second ruler used for post-processing
|
12653 | * (e.g. in emphasis-like rules).
|
12654 | **/
|
12655 | this.ruler2 = new Ruler();
|
12656 |
|
12657 | for (i = 0; i < _rules2.length; i++) {
|
12658 | this.ruler2.push(_rules2[i][0], _rules2[i][1]);
|
12659 | }
|
12660 | }
|
12661 |
|
12662 |
|
12663 | // Skip single token by running all rules in validation mode;
|
12664 | // returns `true` if any rule reported success
|
12665 | //
|
12666 | ParserInline.prototype.skipToken = function (state) {
|
12667 | var ok, i, pos = state.pos,
|
12668 | rules = this.ruler.getRules(''),
|
12669 | len = rules.length,
|
12670 | maxNesting = state.md.options.maxNesting,
|
12671 | cache = state.cache;
|
12672 |
|
12673 |
|
12674 | if (typeof cache[pos] !== 'undefined') {
|
12675 | state.pos = cache[pos];
|
12676 | return;
|
12677 | }
|
12678 |
|
12679 | if (state.level < maxNesting) {
|
12680 | for (i = 0; i < len; i++) {
|
12681 | // Increment state.level and decrement it later to limit recursion.
|
12682 | // It's harmless to do here, because no tokens are created. But ideally,
|
12683 | // we'd need a separate private state variable for this purpose.
|
12684 | //
|
12685 | state.level++;
|
12686 | ok = rules[i](state, true);
|
12687 | state.level--;
|
12688 |
|
12689 | if (ok) { break; }
|
12690 | }
|
12691 | } else {
|
12692 | // Too much nesting, just skip until the end of the paragraph.
|
12693 | //
|
12694 | // NOTE: this will cause links to behave incorrectly in the following case,
|
12695 | // when an amount of `[` is exactly equal to `maxNesting + 1`:
|
12696 | //
|
12697 | // [[[[[[[[[[[[[[[[[[[[[foo]()
|
12698 | //
|
12699 | // TODO: remove this workaround when CM standard will allow nested links
|
12700 | // (we can replace it by preventing links from being parsed in
|
12701 | // validation mode)
|
12702 | //
|
12703 | state.pos = state.posMax;
|
12704 | }
|
12705 |
|
12706 | if (!ok) { state.pos++; }
|
12707 | cache[pos] = state.pos;
|
12708 | };
|
12709 |
|
12710 |
|
12711 | // Generate tokens for input range
|
12712 | //
|
12713 | ParserInline.prototype.tokenize = function (state) {
|
12714 | var ok, i,
|
12715 | rules = this.ruler.getRules(''),
|
12716 | len = rules.length,
|
12717 | end = state.posMax,
|
12718 | maxNesting = state.md.options.maxNesting;
|
12719 |
|
12720 | while (state.pos < end) {
|
12721 | // Try all possible rules.
|
12722 | // On success, rule should:
|
12723 | //
|
12724 | // - update `state.pos`
|
12725 | // - update `state.tokens`
|
12726 | // - return true
|
12727 |
|
12728 | if (state.level < maxNesting) {
|
12729 | for (i = 0; i < len; i++) {
|
12730 | ok = rules[i](state, false);
|
12731 | if (ok) { break; }
|
12732 | }
|
12733 | }
|
12734 |
|
12735 | if (ok) {
|
12736 | if (state.pos >= end) { break; }
|
12737 | continue;
|
12738 | }
|
12739 |
|
12740 | state.pending += state.src[state.pos++];
|
12741 | }
|
12742 |
|
12743 | if (state.pending) {
|
12744 | state.pushPending();
|
12745 | }
|
12746 | };
|
12747 |
|
12748 |
|
12749 | /**
|
12750 | * ParserInline.parse(str, md, env, outTokens)
|
12751 | *
|
12752 | * Process input string and push inline tokens into `outTokens`
|
12753 | **/
|
12754 | ParserInline.prototype.parse = function (str, md, env, outTokens) {
|
12755 | var i, rules, len;
|
12756 | var state = new this.State(str, md, env, outTokens);
|
12757 |
|
12758 | this.tokenize(state);
|
12759 |
|
12760 | rules = this.ruler2.getRules('');
|
12761 | len = rules.length;
|
12762 |
|
12763 | for (i = 0; i < len; i++) {
|
12764 | rules[i](state);
|
12765 | }
|
12766 | };
|
12767 |
|
12768 |
|
12769 | ParserInline.prototype.State = require('./rules_inline/state_inline');
|
12770 |
|
12771 |
|
12772 | module.exports = ParserInline;
|
12773 |
|
12774 | },{"./ruler":45,"./rules_inline/autolink":65,"./rules_inline/backticks":66,"./rules_inline/balance_pairs":67,"./rules_inline/emphasis":68,"./rules_inline/entity":69,"./rules_inline/escape":70,"./rules_inline/html_inline":71,"./rules_inline/image":72,"./rules_inline/link":73,"./rules_inline/newline":74,"./rules_inline/state_inline":75,"./rules_inline/strikethrough":76,"./rules_inline/text":77,"./rules_inline/text_collapse":78}],41:[function(require,module,exports){
|
12775 | // Commonmark default options
|
12776 |
|
12777 | 'use strict';
|
12778 |
|
12779 |
|
12780 | module.exports = {
|
12781 | options: {
|
12782 | html: true, // Enable HTML tags in source
|
12783 | xhtmlOut: true, // Use '/' to close single tags (<br />)
|
12784 | breaks: false, // Convert '\n' in paragraphs into <br>
|
12785 | langPrefix: 'language-', // CSS language prefix for fenced blocks
|
12786 | linkify: false, // autoconvert URL-like texts to links
|
12787 |
|
12788 | // Enable some language-neutral replacements + quotes beautification
|
12789 | typographer: false,
|
12790 |
|
12791 | // Double + single quotes replacement pairs, when typographer enabled,
|
12792 | // and smartquotes on. Could be either a String or an Array.
|
12793 | //
|
12794 | // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
|
12795 | // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
|
12796 | quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
|
12797 |
|
12798 | // Highlighter function. Should return escaped HTML,
|
12799 | // or '' if the source string is not changed and should be escaped externaly.
|
12800 | // If result starts with <pre... internal wrapper is skipped.
|
12801 | //
|
12802 | // function (/*str, lang*/) { return ''; }
|
12803 | //
|
12804 | highlight: null,
|
12805 |
|
12806 | maxNesting: 20 // Internal protection, recursion limit
|
12807 | },
|
12808 |
|
12809 | components: {
|
12810 |
|
12811 | core: {
|
12812 | rules: [
|
12813 | 'normalize',
|
12814 | 'block',
|
12815 | 'inline'
|
12816 | ]
|
12817 | },
|
12818 |
|
12819 | block: {
|
12820 | rules: [
|
12821 | 'blockquote',
|
12822 | 'code',
|
12823 | 'fence',
|
12824 | 'heading',
|
12825 | 'hr',
|
12826 | 'html_block',
|
12827 | 'lheading',
|
12828 | 'list',
|
12829 | 'reference',
|
12830 | 'paragraph'
|
12831 | ]
|
12832 | },
|
12833 |
|
12834 | inline: {
|
12835 | rules: [
|
12836 | 'autolink',
|
12837 | 'backticks',
|
12838 | 'emphasis',
|
12839 | 'entity',
|
12840 | 'escape',
|
12841 | 'html_inline',
|
12842 | 'image',
|
12843 | 'link',
|
12844 | 'newline',
|
12845 | 'text'
|
12846 | ],
|
12847 | rules2: [
|
12848 | 'balance_pairs',
|
12849 | 'emphasis',
|
12850 | 'text_collapse'
|
12851 | ]
|
12852 | }
|
12853 | }
|
12854 | };
|
12855 |
|
12856 | },{}],42:[function(require,module,exports){
|
12857 | // markdown-it default options
|
12858 |
|
12859 | 'use strict';
|
12860 |
|
12861 |
|
12862 | module.exports = {
|
12863 | options: {
|
12864 | html: false, // Enable HTML tags in source
|
12865 | xhtmlOut: false, // Use '/' to close single tags (<br />)
|
12866 | breaks: false, // Convert '\n' in paragraphs into <br>
|
12867 | langPrefix: 'language-', // CSS language prefix for fenced blocks
|
12868 | linkify: false, // autoconvert URL-like texts to links
|
12869 |
|
12870 | // Enable some language-neutral replacements + quotes beautification
|
12871 | typographer: false,
|
12872 |
|
12873 | // Double + single quotes replacement pairs, when typographer enabled,
|
12874 | // and smartquotes on. Could be either a String or an Array.
|
12875 | //
|
12876 | // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
|
12877 | // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
|
12878 | quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
|
12879 |
|
12880 | // Highlighter function. Should return escaped HTML,
|
12881 | // or '' if the source string is not changed and should be escaped externaly.
|
12882 | // If result starts with <pre... internal wrapper is skipped.
|
12883 | //
|
12884 | // function (/*str, lang*/) { return ''; }
|
12885 | //
|
12886 | highlight: null,
|
12887 |
|
12888 | maxNesting: 100 // Internal protection, recursion limit
|
12889 | },
|
12890 |
|
12891 | components: {
|
12892 |
|
12893 | core: {},
|
12894 | block: {},
|
12895 | inline: {}
|
12896 | }
|
12897 | };
|
12898 |
|
12899 | },{}],43:[function(require,module,exports){
|
12900 | // "Zero" preset, with nothing enabled. Useful for manual configuring of simple
|
12901 | // modes. For example, to parse bold/italic only.
|
12902 |
|
12903 | 'use strict';
|
12904 |
|
12905 |
|
12906 | module.exports = {
|
12907 | options: {
|
12908 | html: false, // Enable HTML tags in source
|
12909 | xhtmlOut: false, // Use '/' to close single tags (<br />)
|
12910 | breaks: false, // Convert '\n' in paragraphs into <br>
|
12911 | langPrefix: 'language-', // CSS language prefix for fenced blocks
|
12912 | linkify: false, // autoconvert URL-like texts to links
|
12913 |
|
12914 | // Enable some language-neutral replacements + quotes beautification
|
12915 | typographer: false,
|
12916 |
|
12917 | // Double + single quotes replacement pairs, when typographer enabled,
|
12918 | // and smartquotes on. Could be either a String or an Array.
|
12919 | //
|
12920 | // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
|
12921 | // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
|
12922 | quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
|
12923 |
|
12924 | // Highlighter function. Should return escaped HTML,
|
12925 | // or '' if the source string is not changed and should be escaped externaly.
|
12926 | // If result starts with <pre... internal wrapper is skipped.
|
12927 | //
|
12928 | // function (/*str, lang*/) { return ''; }
|
12929 | //
|
12930 | highlight: null,
|
12931 |
|
12932 | maxNesting: 20 // Internal protection, recursion limit
|
12933 | },
|
12934 |
|
12935 | components: {
|
12936 |
|
12937 | core: {
|
12938 | rules: [
|
12939 | 'normalize',
|
12940 | 'block',
|
12941 | 'inline'
|
12942 | ]
|
12943 | },
|
12944 |
|
12945 | block: {
|
12946 | rules: [
|
12947 | 'paragraph'
|
12948 | ]
|
12949 | },
|
12950 |
|
12951 | inline: {
|
12952 | rules: [
|
12953 | 'text'
|
12954 | ],
|
12955 | rules2: [
|
12956 | 'balance_pairs',
|
12957 | 'text_collapse'
|
12958 | ]
|
12959 | }
|
12960 | }
|
12961 | };
|
12962 |
|
12963 | },{}],44:[function(require,module,exports){
|
12964 | /**
|
12965 | * class Renderer
|
12966 | *
|
12967 | * Generates HTML from parsed token stream. Each instance has independent
|
12968 | * copy of rules. Those can be rewritten with ease. Also, you can add new
|
12969 | * rules if you create plugin and adds new token types.
|
12970 | **/
|
12971 | 'use strict';
|
12972 |
|
12973 |
|
12974 | var assign = require('./common/utils').assign;
|
12975 | var unescapeAll = require('./common/utils').unescapeAll;
|
12976 | var escapeHtml = require('./common/utils').escapeHtml;
|
12977 |
|
12978 |
|
12979 | ////////////////////////////////////////////////////////////////////////////////
|
12980 |
|
12981 | var default_rules = {};
|
12982 |
|
12983 |
|
12984 | default_rules.code_inline = function (tokens, idx /*, options, env */) {
|
12985 | return '<code>' + escapeHtml(tokens[idx].content) + '</code>';
|
12986 | };
|
12987 |
|
12988 |
|
12989 | default_rules.code_block = function (tokens, idx /*, options, env */) {
|
12990 | return '<pre><code>' + escapeHtml(tokens[idx].content) + '</code></pre>\n';
|
12991 | };
|
12992 |
|
12993 |
|
12994 | default_rules.fence = function (tokens, idx, options, env, slf) {
|
12995 | var token = tokens[idx],
|
12996 | info = token.info ? unescapeAll(token.info).trim() : '',
|
12997 | langName = '',
|
12998 | highlighted;
|
12999 |
|
13000 | if (info) {
|
13001 | langName = info.split(/\s+/g)[0];
|
13002 | token.attrJoin('class', options.langPrefix + langName);
|
13003 | }
|
13004 |
|
13005 | if (options.highlight) {
|
13006 | highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
|
13007 | } else {
|
13008 | highlighted = escapeHtml(token.content);
|
13009 | }
|
13010 |
|
13011 | if (highlighted.indexOf('<pre') === 0) {
|
13012 | return highlighted + '\n';
|
13013 | }
|
13014 |
|
13015 | return '<pre><code' + slf.renderAttrs(token) + '>'
|
13016 | + highlighted
|
13017 | + '</code></pre>\n';
|
13018 | };
|
13019 |
|
13020 |
|
13021 | default_rules.image = function (tokens, idx, options, env, slf) {
|
13022 | var token = tokens[idx];
|
13023 |
|
13024 | // "alt" attr MUST be set, even if empty. Because it's mandatory and
|
13025 | // should be placed on proper position for tests.
|
13026 | //
|
13027 | // Replace content with actual value
|
13028 |
|
13029 | token.attrs[token.attrIndex('alt')][1] =
|
13030 | slf.renderInlineAsText(token.children, options, env);
|
13031 |
|
13032 | return slf.renderToken(tokens, idx, options);
|
13033 | };
|
13034 |
|
13035 |
|
13036 | default_rules.hardbreak = function (tokens, idx, options /*, env */) {
|
13037 | return options.xhtmlOut ? '<br />\n' : '<br>\n';
|
13038 | };
|
13039 | default_rules.softbreak = function (tokens, idx, options /*, env */) {
|
13040 | return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
|
13041 | };
|
13042 |
|
13043 |
|
13044 | default_rules.text = function (tokens, idx /*, options, env */) {
|
13045 | return escapeHtml(tokens[idx].content);
|
13046 | };
|
13047 |
|
13048 |
|
13049 | default_rules.html_block = function (tokens, idx /*, options, env */) {
|
13050 | return tokens[idx].content;
|
13051 | };
|
13052 | default_rules.html_inline = function (tokens, idx /*, options, env */) {
|
13053 | return tokens[idx].content;
|
13054 | };
|
13055 |
|
13056 |
|
13057 | /**
|
13058 | * new Renderer()
|
13059 | *
|
13060 | * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
|
13061 | **/
|
13062 | function Renderer() {
|
13063 |
|
13064 | /**
|
13065 | * Renderer#rules -> Object
|
13066 | *
|
13067 | * Contains render rules for tokens. Can be updated and extended.
|
13068 | *
|
13069 | * ##### Example
|
13070 | *
|
13071 | * ```javascript
|
13072 | * var md = require('markdown-it')();
|
13073 | *
|
13074 | * md.renderer.rules.strong_open = function () { return '<b>'; };
|
13075 | * md.renderer.rules.strong_close = function () { return '</b>'; };
|
13076 | *
|
13077 | * var result = md.renderInline(...);
|
13078 | * ```
|
13079 | *
|
13080 | * Each rule is called as independed static function with fixed signature:
|
13081 | *
|
13082 | * ```javascript
|
13083 | * function my_token_render(tokens, idx, options, env, renderer) {
|
13084 | * // ...
|
13085 | * return renderedHTML;
|
13086 | * }
|
13087 | * ```
|
13088 | *
|
13089 | * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
|
13090 | * for more details and examples.
|
13091 | **/
|
13092 | this.rules = assign({}, default_rules);
|
13093 | }
|
13094 |
|
13095 |
|
13096 | /**
|
13097 | * Renderer.renderAttrs(token) -> String
|
13098 | *
|
13099 | * Render token attributes to string.
|
13100 | **/
|
13101 | Renderer.prototype.renderAttrs = function renderAttrs(token) {
|
13102 | var i, l, result;
|
13103 |
|
13104 | if (!token.attrs) { return ''; }
|
13105 |
|
13106 | result = '';
|
13107 |
|
13108 | for (i = 0, l = token.attrs.length; i < l; i++) {
|
13109 | result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
|
13110 | }
|
13111 |
|
13112 | return result;
|
13113 | };
|
13114 |
|
13115 |
|
13116 | /**
|
13117 | * Renderer.renderToken(tokens, idx, options) -> String
|
13118 | * - tokens (Array): list of tokens
|
13119 | * - idx (Numbed): token index to render
|
13120 | * - options (Object): params of parser instance
|
13121 | *
|
13122 | * Default token renderer. Can be overriden by custom function
|
13123 | * in [[Renderer#rules]].
|
13124 | **/
|
13125 | Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
|
13126 | var nextToken,
|
13127 | result = '',
|
13128 | needLf = false,
|
13129 | token = tokens[idx];
|
13130 |
|
13131 | // Tight list paragraphs
|
13132 | if (token.hidden) {
|
13133 | return '';
|
13134 | }
|
13135 |
|
13136 | // Insert a newline between hidden paragraph and subsequent opening
|
13137 | // block-level tag.
|
13138 | //
|
13139 | // For example, here we should insert a newline before blockquote:
|
13140 | // - a
|
13141 | // >
|
13142 | //
|
13143 | if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
|
13144 | result += '\n';
|
13145 | }
|
13146 |
|
13147 | // Add token name, e.g. `<img`
|
13148 | result += (token.nesting === -1 ? '</' : '<') + token.tag;
|
13149 |
|
13150 | // Encode attributes, e.g. `<img src="foo"`
|
13151 | result += this.renderAttrs(token);
|
13152 |
|
13153 | // Add a slash for self-closing tags, e.g. `<img src="foo" /`
|
13154 | if (token.nesting === 0 && options.xhtmlOut) {
|
13155 | result += ' /';
|
13156 | }
|
13157 |
|
13158 | // Check if we need to add a newline after this tag
|
13159 | if (token.block) {
|
13160 | needLf = true;
|
13161 |
|
13162 | if (token.nesting === 1) {
|
13163 | if (idx + 1 < tokens.length) {
|
13164 | nextToken = tokens[idx + 1];
|
13165 |
|
13166 | if (nextToken.type === 'inline' || nextToken.hidden) {
|
13167 | // Block-level tag containing an inline tag.
|
13168 | //
|
13169 | needLf = false;
|
13170 |
|
13171 | } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
|
13172 | // Opening tag + closing tag of the same type. E.g. `<li></li>`.
|
13173 | //
|
13174 | needLf = false;
|
13175 | }
|
13176 | }
|
13177 | }
|
13178 | }
|
13179 |
|
13180 | result += needLf ? '>\n' : '>';
|
13181 |
|
13182 | return result;
|
13183 | };
|
13184 |
|
13185 |
|
13186 | /**
|
13187 | * Renderer.renderInline(tokens, options, env) -> String
|
13188 | * - tokens (Array): list on block tokens to renter
|
13189 | * - options (Object): params of parser instance
|
13190 | * - env (Object): additional data from parsed input (references, for example)
|
13191 | *
|
13192 | * The same as [[Renderer.render]], but for single token of `inline` type.
|
13193 | **/
|
13194 | Renderer.prototype.renderInline = function (tokens, options, env) {
|
13195 | var type,
|
13196 | result = '',
|
13197 | rules = this.rules;
|
13198 |
|
13199 | for (var i = 0, len = tokens.length; i < len; i++) {
|
13200 | type = tokens[i].type;
|
13201 |
|
13202 | if (typeof rules[type] !== 'undefined') {
|
13203 | result += rules[type](tokens, i, options, env, this);
|
13204 | } else {
|
13205 | result += this.renderToken(tokens, i, options);
|
13206 | }
|
13207 | }
|
13208 |
|
13209 | return result;
|
13210 | };
|
13211 |
|
13212 |
|
13213 | /** internal
|
13214 | * Renderer.renderInlineAsText(tokens, options, env) -> String
|
13215 | * - tokens (Array): list on block tokens to renter
|
13216 | * - options (Object): params of parser instance
|
13217 | * - env (Object): additional data from parsed input (references, for example)
|
13218 | *
|
13219 | * Special kludge for image `alt` attributes to conform CommonMark spec.
|
13220 | * Don't try to use it! Spec requires to show `alt` content with stripped markup,
|
13221 | * instead of simple escaping.
|
13222 | **/
|
13223 | Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
|
13224 | var result = '',
|
13225 | rules = this.rules;
|
13226 |
|
13227 | for (var i = 0, len = tokens.length; i < len; i++) {
|
13228 | if (tokens[i].type === 'text') {
|
13229 | result += rules.text(tokens, i, options, env, this);
|
13230 | } else if (tokens[i].type === 'image') {
|
13231 | result += this.renderInlineAsText(tokens[i].children, options, env);
|
13232 | }
|
13233 | }
|
13234 |
|
13235 | return result;
|
13236 | };
|
13237 |
|
13238 |
|
13239 | /**
|
13240 | * Renderer.render(tokens, options, env) -> String
|
13241 | * - tokens (Array): list on block tokens to renter
|
13242 | * - options (Object): params of parser instance
|
13243 | * - env (Object): additional data from parsed input (references, for example)
|
13244 | *
|
13245 | * Takes token stream and generates HTML. Probably, you will never need to call
|
13246 | * this method directly.
|
13247 | **/
|
13248 | Renderer.prototype.render = function (tokens, options, env) {
|
13249 | var i, len, type,
|
13250 | result = '',
|
13251 | rules = this.rules;
|
13252 |
|
13253 | for (i = 0, len = tokens.length; i < len; i++) {
|
13254 | type = tokens[i].type;
|
13255 |
|
13256 | if (type === 'inline') {
|
13257 | result += this.renderInline(tokens[i].children, options, env);
|
13258 | } else if (typeof rules[type] !== 'undefined') {
|
13259 | result += rules[tokens[i].type](tokens, i, options, env, this);
|
13260 | } else {
|
13261 | result += this.renderToken(tokens, i, options, env);
|
13262 | }
|
13263 | }
|
13264 |
|
13265 | return result;
|
13266 | };
|
13267 |
|
13268 | module.exports = Renderer;
|
13269 |
|
13270 | },{"./common/utils":32}],45:[function(require,module,exports){
|
13271 | /**
|
13272 | * class Ruler
|
13273 | *
|
13274 | * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
|
13275 | * [[MarkdownIt#inline]] to manage sequences of functions (rules):
|
13276 | *
|
13277 | * - keep rules in defined order
|
13278 | * - assign the name to each rule
|
13279 | * - enable/disable rules
|
13280 | * - add/replace rules
|
13281 | * - allow assign rules to additional named chains (in the same)
|
13282 | * - cacheing lists of active rules
|
13283 | *
|
13284 | * You will not need use this class directly until write plugins. For simple
|
13285 | * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
|
13286 | * [[MarkdownIt.use]].
|
13287 | **/
|
13288 | 'use strict';
|
13289 |
|
13290 |
|
13291 | /**
|
13292 | * new Ruler()
|
13293 | **/
|
13294 | function Ruler() {
|
13295 | // List of added rules. Each element is:
|
13296 | //
|
13297 | // {
|
13298 | // name: XXX,
|
13299 | // enabled: Boolean,
|
13300 | // fn: Function(),
|
13301 | // alt: [ name2, name3 ]
|
13302 | // }
|
13303 | //
|
13304 | this.__rules__ = [];
|
13305 |
|
13306 | // Cached rule chains.
|
13307 | //
|
13308 | // First level - chain name, '' for default.
|
13309 | // Second level - diginal anchor for fast filtering by charcodes.
|
13310 | //
|
13311 | this.__cache__ = null;
|
13312 | }
|
13313 |
|
13314 | ////////////////////////////////////////////////////////////////////////////////
|
13315 | // Helper methods, should not be used directly
|
13316 |
|
13317 |
|
13318 | // Find rule index by name
|
13319 | //
|
13320 | Ruler.prototype.__find__ = function (name) {
|
13321 | for (var i = 0; i < this.__rules__.length; i++) {
|
13322 | if (this.__rules__[i].name === name) {
|
13323 | return i;
|
13324 | }
|
13325 | }
|
13326 | return -1;
|
13327 | };
|
13328 |
|
13329 |
|
13330 | // Build rules lookup cache
|
13331 | //
|
13332 | Ruler.prototype.__compile__ = function () {
|
13333 | var self = this;
|
13334 | var chains = [ '' ];
|
13335 |
|
13336 | // collect unique names
|
13337 | self.__rules__.forEach(function (rule) {
|
13338 | if (!rule.enabled) { return; }
|
13339 |
|
13340 | rule.alt.forEach(function (altName) {
|
13341 | if (chains.indexOf(altName) < 0) {
|
13342 | chains.push(altName);
|
13343 | }
|
13344 | });
|
13345 | });
|
13346 |
|
13347 | self.__cache__ = {};
|
13348 |
|
13349 | chains.forEach(function (chain) {
|
13350 | self.__cache__[chain] = [];
|
13351 | self.__rules__.forEach(function (rule) {
|
13352 | if (!rule.enabled) { return; }
|
13353 |
|
13354 | if (chain && rule.alt.indexOf(chain) < 0) { return; }
|
13355 |
|
13356 | self.__cache__[chain].push(rule.fn);
|
13357 | });
|
13358 | });
|
13359 | };
|
13360 |
|
13361 |
|
13362 | /**
|
13363 | * Ruler.at(name, fn [, options])
|
13364 | * - name (String): rule name to replace.
|
13365 | * - fn (Function): new rule function.
|
13366 | * - options (Object): new rule options (not mandatory).
|
13367 | *
|
13368 | * Replace rule by name with new function & options. Throws error if name not
|
13369 | * found.
|
13370 | *
|
13371 | * ##### Options:
|
13372 | *
|
13373 | * - __alt__ - array with names of "alternate" chains.
|
13374 | *
|
13375 | * ##### Example
|
13376 | *
|
13377 | * Replace existing typorgapher replacement rule with new one:
|
13378 | *
|
13379 | * ```javascript
|
13380 | * var md = require('markdown-it')();
|
13381 | *
|
13382 | * md.core.ruler.at('replacements', function replace(state) {
|
13383 | * //...
|
13384 | * });
|
13385 | * ```
|
13386 | **/
|
13387 | Ruler.prototype.at = function (name, fn, options) {
|
13388 | var index = this.__find__(name);
|
13389 | var opt = options || {};
|
13390 |
|
13391 | if (index === -1) { throw new Error('Parser rule not found: ' + name); }
|
13392 |
|
13393 | this.__rules__[index].fn = fn;
|
13394 | this.__rules__[index].alt = opt.alt || [];
|
13395 | this.__cache__ = null;
|
13396 | };
|
13397 |
|
13398 |
|
13399 | /**
|
13400 | * Ruler.before(beforeName, ruleName, fn [, options])
|
13401 | * - beforeName (String): new rule will be added before this one.
|
13402 | * - ruleName (String): name of added rule.
|
13403 | * - fn (Function): rule function.
|
13404 | * - options (Object): rule options (not mandatory).
|
13405 | *
|
13406 | * Add new rule to chain before one with given name. See also
|
13407 | * [[Ruler.after]], [[Ruler.push]].
|
13408 | *
|
13409 | * ##### Options:
|
13410 | *
|
13411 | * - __alt__ - array with names of "alternate" chains.
|
13412 | *
|
13413 | * ##### Example
|
13414 | *
|
13415 | * ```javascript
|
13416 | * var md = require('markdown-it')();
|
13417 | *
|
13418 | * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
|
13419 | * //...
|
13420 | * });
|
13421 | * ```
|
13422 | **/
|
13423 | Ruler.prototype.before = function (beforeName, ruleName, fn, options) {
|
13424 | var index = this.__find__(beforeName);
|
13425 | var opt = options || {};
|
13426 |
|
13427 | if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }
|
13428 |
|
13429 | this.__rules__.splice(index, 0, {
|
13430 | name: ruleName,
|
13431 | enabled: true,
|
13432 | fn: fn,
|
13433 | alt: opt.alt || []
|
13434 | });
|
13435 |
|
13436 | this.__cache__ = null;
|
13437 | };
|
13438 |
|
13439 |
|
13440 | /**
|
13441 | * Ruler.after(afterName, ruleName, fn [, options])
|
13442 | * - afterName (String): new rule will be added after this one.
|
13443 | * - ruleName (String): name of added rule.
|
13444 | * - fn (Function): rule function.
|
13445 | * - options (Object): rule options (not mandatory).
|
13446 | *
|
13447 | * Add new rule to chain after one with given name. See also
|
13448 | * [[Ruler.before]], [[Ruler.push]].
|
13449 | *
|
13450 | * ##### Options:
|
13451 | *
|
13452 | * - __alt__ - array with names of "alternate" chains.
|
13453 | *
|
13454 | * ##### Example
|
13455 | *
|
13456 | * ```javascript
|
13457 | * var md = require('markdown-it')();
|
13458 | *
|
13459 | * md.inline.ruler.after('text', 'my_rule', function replace(state) {
|
13460 | * //...
|
13461 | * });
|
13462 | * ```
|
13463 | **/
|
13464 | Ruler.prototype.after = function (afterName, ruleName, fn, options) {
|
13465 | var index = this.__find__(afterName);
|
13466 | var opt = options || {};
|
13467 |
|
13468 | if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }
|
13469 |
|
13470 | this.__rules__.splice(index + 1, 0, {
|
13471 | name: ruleName,
|
13472 | enabled: true,
|
13473 | fn: fn,
|
13474 | alt: opt.alt || []
|
13475 | });
|
13476 |
|
13477 | this.__cache__ = null;
|
13478 | };
|
13479 |
|
13480 | /**
|
13481 | * Ruler.push(ruleName, fn [, options])
|
13482 | * - ruleName (String): name of added rule.
|
13483 | * - fn (Function): rule function.
|
13484 | * - options (Object): rule options (not mandatory).
|
13485 | *
|
13486 | * Push new rule to the end of chain. See also
|
13487 | * [[Ruler.before]], [[Ruler.after]].
|
13488 | *
|
13489 | * ##### Options:
|
13490 | *
|
13491 | * - __alt__ - array with names of "alternate" chains.
|
13492 | *
|
13493 | * ##### Example
|
13494 | *
|
13495 | * ```javascript
|
13496 | * var md = require('markdown-it')();
|
13497 | *
|
13498 | * md.core.ruler.push('my_rule', function replace(state) {
|
13499 | * //...
|
13500 | * });
|
13501 | * ```
|
13502 | **/
|
13503 | Ruler.prototype.push = function (ruleName, fn, options) {
|
13504 | var opt = options || {};
|
13505 |
|
13506 | this.__rules__.push({
|
13507 | name: ruleName,
|
13508 | enabled: true,
|
13509 | fn: fn,
|
13510 | alt: opt.alt || []
|
13511 | });
|
13512 |
|
13513 | this.__cache__ = null;
|
13514 | };
|
13515 |
|
13516 |
|
13517 | /**
|
13518 | * Ruler.enable(list [, ignoreInvalid]) -> Array
|
13519 | * - list (String|Array): list of rule names to enable.
|
13520 | * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
|
13521 | *
|
13522 | * Enable rules with given names. If any rule name not found - throw Error.
|
13523 | * Errors can be disabled by second param.
|
13524 | *
|
13525 | * Returns list of found rule names (if no exception happened).
|
13526 | *
|
13527 | * See also [[Ruler.disable]], [[Ruler.enableOnly]].
|
13528 | **/
|
13529 | Ruler.prototype.enable = function (list, ignoreInvalid) {
|
13530 | if (!Array.isArray(list)) { list = [ list ]; }
|
13531 |
|
13532 | var result = [];
|
13533 |
|
13534 | // Search by name and enable
|
13535 | list.forEach(function (name) {
|
13536 | var idx = this.__find__(name);
|
13537 |
|
13538 | if (idx < 0) {
|
13539 | if (ignoreInvalid) { return; }
|
13540 | throw new Error('Rules manager: invalid rule name ' + name);
|
13541 | }
|
13542 | this.__rules__[idx].enabled = true;
|
13543 | result.push(name);
|
13544 | }, this);
|
13545 |
|
13546 | this.__cache__ = null;
|
13547 | return result;
|
13548 | };
|
13549 |
|
13550 |
|
13551 | /**
|
13552 | * Ruler.enableOnly(list [, ignoreInvalid])
|
13553 | * - list (String|Array): list of rule names to enable (whitelist).
|
13554 | * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
|
13555 | *
|
13556 | * Enable rules with given names, and disable everything else. If any rule name
|
13557 | * not found - throw Error. Errors can be disabled by second param.
|
13558 | *
|
13559 | * See also [[Ruler.disable]], [[Ruler.enable]].
|
13560 | **/
|
13561 | Ruler.prototype.enableOnly = function (list, ignoreInvalid) {
|
13562 | if (!Array.isArray(list)) { list = [ list ]; }
|
13563 |
|
13564 | this.__rules__.forEach(function (rule) { rule.enabled = false; });
|
13565 |
|
13566 | this.enable(list, ignoreInvalid);
|
13567 | };
|
13568 |
|
13569 |
|
13570 | /**
|
13571 | * Ruler.disable(list [, ignoreInvalid]) -> Array
|
13572 | * - list (String|Array): list of rule names to disable.
|
13573 | * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
|
13574 | *
|
13575 | * Disable rules with given names. If any rule name not found - throw Error.
|
13576 | * Errors can be disabled by second param.
|
13577 | *
|
13578 | * Returns list of found rule names (if no exception happened).
|
13579 | *
|
13580 | * See also [[Ruler.enable]], [[Ruler.enableOnly]].
|
13581 | **/
|
13582 | Ruler.prototype.disable = function (list, ignoreInvalid) {
|
13583 | if (!Array.isArray(list)) { list = [ list ]; }
|
13584 |
|
13585 | var result = [];
|
13586 |
|
13587 | // Search by name and disable
|
13588 | list.forEach(function (name) {
|
13589 | var idx = this.__find__(name);
|
13590 |
|
13591 | if (idx < 0) {
|
13592 | if (ignoreInvalid) { return; }
|
13593 | throw new Error('Rules manager: invalid rule name ' + name);
|
13594 | }
|
13595 | this.__rules__[idx].enabled = false;
|
13596 | result.push(name);
|
13597 | }, this);
|
13598 |
|
13599 | this.__cache__ = null;
|
13600 | return result;
|
13601 | };
|
13602 |
|
13603 |
|
13604 | /**
|
13605 | * Ruler.getRules(chainName) -> Array
|
13606 | *
|
13607 | * Return array of active functions (rules) for given chain name. It analyzes
|
13608 | * rules configuration, compiles caches if not exists and returns result.
|
13609 | *
|
13610 | * Default chain name is `''` (empty string). It can't be skipped. That's
|
13611 | * done intentionally, to keep signature monomorphic for high speed.
|
13612 | **/
|
13613 | Ruler.prototype.getRules = function (chainName) {
|
13614 | if (this.__cache__ === null) {
|
13615 | this.__compile__();
|
13616 | }
|
13617 |
|
13618 | // Chain can be empty, if rules disabled. But we still have to return Array.
|
13619 | return this.__cache__[chainName] || [];
|
13620 | };
|
13621 |
|
13622 | module.exports = Ruler;
|
13623 |
|
13624 | },{}],46:[function(require,module,exports){
|
13625 | // Block quotes
|
13626 |
|
13627 | 'use strict';
|
13628 |
|
13629 | var isSpace = require('../common/utils').isSpace;
|
13630 |
|
13631 |
|
13632 | module.exports = function blockquote(state, startLine, endLine, silent) {
|
13633 | var nextLine, lastLineEmpty, oldTShift, oldSCount, oldBMarks, oldIndent, oldParentType, lines, initial, offset, ch,
|
13634 | terminatorRules, token,
|
13635 | i, l, terminate,
|
13636 | pos = state.bMarks[startLine] + state.tShift[startLine],
|
13637 | max = state.eMarks[startLine];
|
13638 |
|
13639 | // check the block quote marker
|
13640 | if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
|
13641 |
|
13642 | // we know that it's going to be a valid blockquote,
|
13643 | // so no point trying to find the end of it in silent mode
|
13644 | if (silent) { return true; }
|
13645 |
|
13646 | // skip one optional space (but not tab, check cmark impl) after '>'
|
13647 | if (state.src.charCodeAt(pos) === 0x20) { pos++; }
|
13648 |
|
13649 | oldIndent = state.blkIndent;
|
13650 | state.blkIndent = 0;
|
13651 |
|
13652 | // skip spaces after ">" and re-calculate offset
|
13653 | initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
|
13654 |
|
13655 | oldBMarks = [ state.bMarks[startLine] ];
|
13656 | state.bMarks[startLine] = pos;
|
13657 |
|
13658 | while (pos < max) {
|
13659 | ch = state.src.charCodeAt(pos);
|
13660 |
|
13661 | if (isSpace(ch)) {
|
13662 | if (ch === 0x09) {
|
13663 | offset += 4 - offset % 4;
|
13664 | } else {
|
13665 | offset++;
|
13666 | }
|
13667 | } else {
|
13668 | break;
|
13669 | }
|
13670 |
|
13671 | pos++;
|
13672 | }
|
13673 |
|
13674 | lastLineEmpty = pos >= max;
|
13675 |
|
13676 | oldSCount = [ state.sCount[startLine] ];
|
13677 | state.sCount[startLine] = offset - initial;
|
13678 |
|
13679 | oldTShift = [ state.tShift[startLine] ];
|
13680 | state.tShift[startLine] = pos - state.bMarks[startLine];
|
13681 |
|
13682 | terminatorRules = state.md.block.ruler.getRules('blockquote');
|
13683 |
|
13684 | // Search the end of the block
|
13685 | //
|
13686 | // Block ends with either:
|
13687 | // 1. an empty line outside:
|
13688 | // ```
|
13689 | // > test
|
13690 | //
|
13691 | // ```
|
13692 | // 2. an empty line inside:
|
13693 | // ```
|
13694 | // >
|
13695 | // test
|
13696 | // ```
|
13697 | // 3. another tag
|
13698 | // ```
|
13699 | // > test
|
13700 | // - - -
|
13701 | // ```
|
13702 | for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
|
13703 | if (state.sCount[nextLine] < oldIndent) { break; }
|
13704 |
|
13705 | pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
13706 | max = state.eMarks[nextLine];
|
13707 |
|
13708 | if (pos >= max) {
|
13709 | // Case 1: line is not inside the blockquote, and this line is empty.
|
13710 | break;
|
13711 | }
|
13712 |
|
13713 | if (state.src.charCodeAt(pos++) === 0x3E/* > */) {
|
13714 | // This line is inside the blockquote.
|
13715 |
|
13716 | // skip one optional space (but not tab, check cmark impl) after '>'
|
13717 | if (state.src.charCodeAt(pos) === 0x20) { pos++; }
|
13718 |
|
13719 | // skip spaces after ">" and re-calculate offset
|
13720 | initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
|
13721 |
|
13722 | oldBMarks.push(state.bMarks[nextLine]);
|
13723 | state.bMarks[nextLine] = pos;
|
13724 |
|
13725 | while (pos < max) {
|
13726 | ch = state.src.charCodeAt(pos);
|
13727 |
|
13728 | if (isSpace(ch)) {
|
13729 | if (ch === 0x09) {
|
13730 | offset += 4 - offset % 4;
|
13731 | } else {
|
13732 | offset++;
|
13733 | }
|
13734 | } else {
|
13735 | break;
|
13736 | }
|
13737 |
|
13738 | pos++;
|
13739 | }
|
13740 |
|
13741 | lastLineEmpty = pos >= max;
|
13742 |
|
13743 | oldSCount.push(state.sCount[nextLine]);
|
13744 | state.sCount[nextLine] = offset - initial;
|
13745 |
|
13746 | oldTShift.push(state.tShift[nextLine]);
|
13747 | state.tShift[nextLine] = pos - state.bMarks[nextLine];
|
13748 | continue;
|
13749 | }
|
13750 |
|
13751 | // Case 2: line is not inside the blockquote, and the last line was empty.
|
13752 | if (lastLineEmpty) { break; }
|
13753 |
|
13754 | // Case 3: another tag found.
|
13755 | terminate = false;
|
13756 | for (i = 0, l = terminatorRules.length; i < l; i++) {
|
13757 | if (terminatorRules[i](state, nextLine, endLine, true)) {
|
13758 | terminate = true;
|
13759 | break;
|
13760 | }
|
13761 | }
|
13762 | if (terminate) { break; }
|
13763 |
|
13764 | oldBMarks.push(state.bMarks[nextLine]);
|
13765 | oldTShift.push(state.tShift[nextLine]);
|
13766 | oldSCount.push(state.sCount[nextLine]);
|
13767 |
|
13768 | // A negative indentation means that this is a paragraph continuation
|
13769 | //
|
13770 | state.sCount[nextLine] = -1;
|
13771 | }
|
13772 |
|
13773 | oldParentType = state.parentType;
|
13774 | state.parentType = 'blockquote';
|
13775 |
|
13776 | token = state.push('blockquote_open', 'blockquote', 1);
|
13777 | token.markup = '>';
|
13778 | token.map = lines = [ startLine, 0 ];
|
13779 |
|
13780 | state.md.block.tokenize(state, startLine, nextLine);
|
13781 |
|
13782 | token = state.push('blockquote_close', 'blockquote', -1);
|
13783 | token.markup = '>';
|
13784 |
|
13785 | state.parentType = oldParentType;
|
13786 | lines[1] = state.line;
|
13787 |
|
13788 | // Restore original tShift; this might not be necessary since the parser
|
13789 | // has already been here, but just to make sure we can do that.
|
13790 | for (i = 0; i < oldTShift.length; i++) {
|
13791 | state.bMarks[i + startLine] = oldBMarks[i];
|
13792 | state.tShift[i + startLine] = oldTShift[i];
|
13793 | state.sCount[i + startLine] = oldSCount[i];
|
13794 | }
|
13795 | state.blkIndent = oldIndent;
|
13796 |
|
13797 | return true;
|
13798 | };
|
13799 |
|
13800 | },{"../common/utils":32}],47:[function(require,module,exports){
|
13801 | // Code block (4 spaces padded)
|
13802 |
|
13803 | 'use strict';
|
13804 |
|
13805 |
|
13806 | module.exports = function code(state, startLine, endLine/*, silent*/) {
|
13807 | var nextLine, last, token, emptyLines = 0;
|
13808 |
|
13809 | if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
|
13810 |
|
13811 | last = nextLine = startLine + 1;
|
13812 |
|
13813 | while (nextLine < endLine) {
|
13814 | if (state.isEmpty(nextLine)) {
|
13815 | emptyLines++;
|
13816 |
|
13817 | // workaround for lists: 2 blank lines should terminate indented
|
13818 | // code block, but not fenced code block
|
13819 | if (emptyLines >= 2 && state.parentType === 'list') {
|
13820 | break;
|
13821 | }
|
13822 |
|
13823 | nextLine++;
|
13824 | continue;
|
13825 | }
|
13826 |
|
13827 | emptyLines = 0;
|
13828 |
|
13829 | if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
13830 | nextLine++;
|
13831 | last = nextLine;
|
13832 | continue;
|
13833 | }
|
13834 | break;
|
13835 | }
|
13836 |
|
13837 | state.line = last;
|
13838 |
|
13839 | token = state.push('code_block', 'code', 0);
|
13840 | token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
|
13841 | token.map = [ startLine, state.line ];
|
13842 |
|
13843 | return true;
|
13844 | };
|
13845 |
|
13846 | },{}],48:[function(require,module,exports){
|
13847 | // fences (``` lang, ~~~ lang)
|
13848 |
|
13849 | 'use strict';
|
13850 |
|
13851 |
|
13852 | module.exports = function fence(state, startLine, endLine, silent) {
|
13853 | var marker, len, params, nextLine, mem, token, markup,
|
13854 | haveEndMarker = false,
|
13855 | pos = state.bMarks[startLine] + state.tShift[startLine],
|
13856 | max = state.eMarks[startLine];
|
13857 |
|
13858 | if (pos + 3 > max) { return false; }
|
13859 |
|
13860 | marker = state.src.charCodeAt(pos);
|
13861 |
|
13862 | if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
|
13863 | return false;
|
13864 | }
|
13865 |
|
13866 | // scan marker length
|
13867 | mem = pos;
|
13868 | pos = state.skipChars(pos, marker);
|
13869 |
|
13870 | len = pos - mem;
|
13871 |
|
13872 | if (len < 3) { return false; }
|
13873 |
|
13874 | markup = state.src.slice(mem, pos);
|
13875 | params = state.src.slice(pos, max);
|
13876 |
|
13877 | if (params.indexOf('`') >= 0) { return false; }
|
13878 |
|
13879 | // Since start is found, we can report success here in validation mode
|
13880 | if (silent) { return true; }
|
13881 |
|
13882 | // search end of block
|
13883 | nextLine = startLine;
|
13884 |
|
13885 | for (;;) {
|
13886 | nextLine++;
|
13887 | if (nextLine >= endLine) {
|
13888 | // unclosed block should be autoclosed by end of document.
|
13889 | // also block seems to be autoclosed by end of parent
|
13890 | break;
|
13891 | }
|
13892 |
|
13893 | pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
|
13894 | max = state.eMarks[nextLine];
|
13895 |
|
13896 | if (pos < max && state.sCount[nextLine] < state.blkIndent) {
|
13897 | // non-empty line with negative indent should stop the list:
|
13898 | // - ```
|
13899 | // test
|
13900 | break;
|
13901 | }
|
13902 |
|
13903 | if (state.src.charCodeAt(pos) !== marker) { continue; }
|
13904 |
|
13905 | if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
13906 | // closing fence should be indented less than 4 spaces
|
13907 | continue;
|
13908 | }
|
13909 |
|
13910 | pos = state.skipChars(pos, marker);
|
13911 |
|
13912 | // closing code fence must be at least as long as the opening one
|
13913 | if (pos - mem < len) { continue; }
|
13914 |
|
13915 | // make sure tail has spaces only
|
13916 | pos = state.skipSpaces(pos);
|
13917 |
|
13918 | if (pos < max) { continue; }
|
13919 |
|
13920 | haveEndMarker = true;
|
13921 | // found!
|
13922 | break;
|
13923 | }
|
13924 |
|
13925 | // If a fence has heading spaces, they should be removed from its inner block
|
13926 | len = state.sCount[startLine];
|
13927 |
|
13928 | state.line = nextLine + (haveEndMarker ? 1 : 0);
|
13929 |
|
13930 | token = state.push('fence', 'code', 0);
|
13931 | token.info = params;
|
13932 | token.content = state.getLines(startLine + 1, nextLine, len, true);
|
13933 | token.markup = markup;
|
13934 | token.map = [ startLine, state.line ];
|
13935 |
|
13936 | return true;
|
13937 | };
|
13938 |
|
13939 | },{}],49:[function(require,module,exports){
|
13940 | // heading (#, ##, ...)
|
13941 |
|
13942 | 'use strict';
|
13943 |
|
13944 | var isSpace = require('../common/utils').isSpace;
|
13945 |
|
13946 |
|
13947 | module.exports = function heading(state, startLine, endLine, silent) {
|
13948 | var ch, level, tmp, token,
|
13949 | pos = state.bMarks[startLine] + state.tShift[startLine],
|
13950 | max = state.eMarks[startLine];
|
13951 |
|
13952 | ch = state.src.charCodeAt(pos);
|
13953 |
|
13954 | if (ch !== 0x23/* # */ || pos >= max) { return false; }
|
13955 |
|
13956 | // count heading level
|
13957 | level = 1;
|
13958 | ch = state.src.charCodeAt(++pos);
|
13959 | while (ch === 0x23/* # */ && pos < max && level <= 6) {
|
13960 | level++;
|
13961 | ch = state.src.charCodeAt(++pos);
|
13962 | }
|
13963 |
|
13964 | if (level > 6 || (pos < max && ch !== 0x20/* space */)) { return false; }
|
13965 |
|
13966 | if (silent) { return true; }
|
13967 |
|
13968 | // Let's cut tails like ' ### ' from the end of string
|
13969 |
|
13970 | max = state.skipSpacesBack(max, pos);
|
13971 | tmp = state.skipCharsBack(max, 0x23, pos); // #
|
13972 | if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
|
13973 | max = tmp;
|
13974 | }
|
13975 |
|
13976 | state.line = startLine + 1;
|
13977 |
|
13978 | token = state.push('heading_open', 'h' + String(level), 1);
|
13979 | token.markup = '########'.slice(0, level);
|
13980 | token.map = [ startLine, state.line ];
|
13981 |
|
13982 | token = state.push('inline', '', 0);
|
13983 | token.content = state.src.slice(pos, max).trim();
|
13984 | token.map = [ startLine, state.line ];
|
13985 | token.children = [];
|
13986 |
|
13987 | token = state.push('heading_close', 'h' + String(level), -1);
|
13988 | token.markup = '########'.slice(0, level);
|
13989 |
|
13990 | return true;
|
13991 | };
|
13992 |
|
13993 | },{"../common/utils":32}],50:[function(require,module,exports){
|
13994 | // Horizontal rule
|
13995 |
|
13996 | 'use strict';
|
13997 |
|
13998 | var isSpace = require('../common/utils').isSpace;
|
13999 |
|
14000 |
|
14001 | module.exports = function hr(state, startLine, endLine, silent) {
|
14002 | var marker, cnt, ch, token,
|
14003 | pos = state.bMarks[startLine] + state.tShift[startLine],
|
14004 | max = state.eMarks[startLine];
|
14005 |
|
14006 | marker = state.src.charCodeAt(pos++);
|
14007 |
|
14008 | // Check hr marker
|
14009 | if (marker !== 0x2A/* * */ &&
|
14010 | marker !== 0x2D/* - */ &&
|
14011 | marker !== 0x5F/* _ */) {
|
14012 | return false;
|
14013 | }
|
14014 |
|
14015 | // markers can be mixed with spaces, but there should be at least 3 of them
|
14016 |
|
14017 | cnt = 1;
|
14018 | while (pos < max) {
|
14019 | ch = state.src.charCodeAt(pos++);
|
14020 | if (ch !== marker && !isSpace(ch)) { return false; }
|
14021 | if (ch === marker) { cnt++; }
|
14022 | }
|
14023 |
|
14024 | if (cnt < 3) { return false; }
|
14025 |
|
14026 | if (silent) { return true; }
|
14027 |
|
14028 | state.line = startLine + 1;
|
14029 |
|
14030 | token = state.push('hr', 'hr', 0);
|
14031 | token.map = [ startLine, state.line ];
|
14032 | token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
|
14033 |
|
14034 | return true;
|
14035 | };
|
14036 |
|
14037 | },{"../common/utils":32}],51:[function(require,module,exports){
|
14038 | // HTML block
|
14039 |
|
14040 | 'use strict';
|
14041 |
|
14042 |
|
14043 | var block_names = require('../common/html_blocks');
|
14044 | var HTML_OPEN_CLOSE_TAG_RE = require('../common/html_re').HTML_OPEN_CLOSE_TAG_RE;
|
14045 |
|
14046 | // An array of opening and corresponding closing sequences for html tags,
|
14047 | // last argument defines whether it can terminate a paragraph or not
|
14048 | //
|
14049 | var HTML_SEQUENCES = [
|
14050 | [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
|
14051 | [ /^<!--/, /-->/, true ],
|
14052 | [ /^<\?/, /\?>/, true ],
|
14053 | [ /^<![A-Z]/, />/, true ],
|
14054 | [ /^<!\[CDATA\[/, /\]\]>/, true ],
|
14055 | [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
|
14056 | [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
|
14057 | ];
|
14058 |
|
14059 |
|
14060 | module.exports = function html_block(state, startLine, endLine, silent) {
|
14061 | var i, nextLine, token, lineText,
|
14062 | pos = state.bMarks[startLine] + state.tShift[startLine],
|
14063 | max = state.eMarks[startLine];
|
14064 |
|
14065 | if (!state.md.options.html) { return false; }
|
14066 |
|
14067 | if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
|
14068 |
|
14069 | lineText = state.src.slice(pos, max);
|
14070 |
|
14071 | for (i = 0; i < HTML_SEQUENCES.length; i++) {
|
14072 | if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
|
14073 | }
|
14074 |
|
14075 | if (i === HTML_SEQUENCES.length) { return false; }
|
14076 |
|
14077 | if (silent) {
|
14078 | // true if this sequence can be a terminator, false otherwise
|
14079 | return HTML_SEQUENCES[i][2];
|
14080 | }
|
14081 |
|
14082 | nextLine = startLine + 1;
|
14083 |
|
14084 | // If we are here - we detected HTML block.
|
14085 | // Let's roll down till block end.
|
14086 | if (!HTML_SEQUENCES[i][1].test(lineText)) {
|
14087 | for (; nextLine < endLine; nextLine++) {
|
14088 | if (state.sCount[nextLine] < state.blkIndent) { break; }
|
14089 |
|
14090 | pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
14091 | max = state.eMarks[nextLine];
|
14092 | lineText = state.src.slice(pos, max);
|
14093 |
|
14094 | if (HTML_SEQUENCES[i][1].test(lineText)) {
|
14095 | if (lineText.length !== 0) { nextLine++; }
|
14096 | break;
|
14097 | }
|
14098 | }
|
14099 | }
|
14100 |
|
14101 | state.line = nextLine;
|
14102 |
|
14103 | token = state.push('html_block', '', 0);
|
14104 | token.map = [ startLine, nextLine ];
|
14105 | token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
|
14106 |
|
14107 | return true;
|
14108 | };
|
14109 |
|
14110 | },{"../common/html_blocks":30,"../common/html_re":31}],52:[function(require,module,exports){
|
14111 | // lheading (---, ===)
|
14112 |
|
14113 | 'use strict';
|
14114 |
|
14115 |
|
14116 | module.exports = function lheading(state, startLine, endLine/*, silent*/) {
|
14117 | var content, terminate, i, l, token, pos, max, level, marker,
|
14118 | nextLine = startLine + 1,
|
14119 | terminatorRules = state.md.block.ruler.getRules('paragraph');
|
14120 |
|
14121 | // jump line-by-line until empty one or EOF
|
14122 | for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
14123 | // this would be a code block normally, but after paragraph
|
14124 | // it's considered a lazy continuation regardless of what's there
|
14125 | if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
|
14126 |
|
14127 | //
|
14128 | // Check for underline in setext header
|
14129 | //
|
14130 | if (state.sCount[nextLine] >= state.blkIndent) {
|
14131 | pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
14132 | max = state.eMarks[nextLine];
|
14133 |
|
14134 | if (pos < max) {
|
14135 | marker = state.src.charCodeAt(pos);
|
14136 |
|
14137 | if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
|
14138 | pos = state.skipChars(pos, marker);
|
14139 | pos = state.skipSpaces(pos);
|
14140 |
|
14141 | if (pos >= max) {
|
14142 | level = (marker === 0x3D/* = */ ? 1 : 2);
|
14143 | break;
|
14144 | }
|
14145 | }
|
14146 | }
|
14147 | }
|
14148 |
|
14149 | // quirk for blockquotes, this line should already be checked by that rule
|
14150 | if (state.sCount[nextLine] < 0) { continue; }
|
14151 |
|
14152 | // Some tags can terminate paragraph without empty line.
|
14153 | terminate = false;
|
14154 | for (i = 0, l = terminatorRules.length; i < l; i++) {
|
14155 | if (terminatorRules[i](state, nextLine, endLine, true)) {
|
14156 | terminate = true;
|
14157 | break;
|
14158 | }
|
14159 | }
|
14160 | if (terminate) { break; }
|
14161 | }
|
14162 |
|
14163 | if (!level) {
|
14164 | // Didn't find valid underline
|
14165 | return false;
|
14166 | }
|
14167 |
|
14168 | content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
|
14169 |
|
14170 | state.line = nextLine + 1;
|
14171 |
|
14172 | token = state.push('heading_open', 'h' + String(level), 1);
|
14173 | token.markup = String.fromCharCode(marker);
|
14174 | token.map = [ startLine, state.line ];
|
14175 |
|
14176 | token = state.push('inline', '', 0);
|
14177 | token.content = content;
|
14178 | token.map = [ startLine, state.line - 1 ];
|
14179 | token.children = [];
|
14180 |
|
14181 | token = state.push('heading_close', 'h' + String(level), -1);
|
14182 | token.markup = String.fromCharCode(marker);
|
14183 |
|
14184 | return true;
|
14185 | };
|
14186 |
|
14187 | },{}],53:[function(require,module,exports){
|
14188 | // Lists
|
14189 |
|
14190 | 'use strict';
|
14191 |
|
14192 | var isSpace = require('../common/utils').isSpace;
|
14193 |
|
14194 |
|
14195 | // Search `[-+*][\n ]`, returns next pos arter marker on success
|
14196 | // or -1 on fail.
|
14197 | function skipBulletListMarker(state, startLine) {
|
14198 | var marker, pos, max, ch;
|
14199 |
|
14200 | pos = state.bMarks[startLine] + state.tShift[startLine];
|
14201 | max = state.eMarks[startLine];
|
14202 |
|
14203 | marker = state.src.charCodeAt(pos++);
|
14204 | // Check bullet
|
14205 | if (marker !== 0x2A/* * */ &&
|
14206 | marker !== 0x2D/* - */ &&
|
14207 | marker !== 0x2B/* + */) {
|
14208 | return -1;
|
14209 | }
|
14210 |
|
14211 | if (pos < max) {
|
14212 | ch = state.src.charCodeAt(pos);
|
14213 |
|
14214 | if (!isSpace(ch)) {
|
14215 | // " -test " - is not a list item
|
14216 | return -1;
|
14217 | }
|
14218 | }
|
14219 |
|
14220 | return pos;
|
14221 | }
|
14222 |
|
14223 | // Search `\d+[.)][\n ]`, returns next pos arter marker on success
|
14224 | // or -1 on fail.
|
14225 | function skipOrderedListMarker(state, startLine) {
|
14226 | var ch,
|
14227 | start = state.bMarks[startLine] + state.tShift[startLine],
|
14228 | pos = start,
|
14229 | max = state.eMarks[startLine];
|
14230 |
|
14231 | // List marker should have at least 2 chars (digit + dot)
|
14232 | if (pos + 1 >= max) { return -1; }
|
14233 |
|
14234 | ch = state.src.charCodeAt(pos++);
|
14235 |
|
14236 | if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
|
14237 |
|
14238 | for (;;) {
|
14239 | // EOL -> fail
|
14240 | if (pos >= max) { return -1; }
|
14241 |
|
14242 | ch = state.src.charCodeAt(pos++);
|
14243 |
|
14244 | if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
|
14245 |
|
14246 | // List marker should have no more than 9 digits
|
14247 | // (prevents integer overflow in browsers)
|
14248 | if (pos - start >= 10) { return -1; }
|
14249 |
|
14250 | continue;
|
14251 | }
|
14252 |
|
14253 | // found valid marker
|
14254 | if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
|
14255 | break;
|
14256 | }
|
14257 |
|
14258 | return -1;
|
14259 | }
|
14260 |
|
14261 |
|
14262 | if (pos < max) {
|
14263 | ch = state.src.charCodeAt(pos);
|
14264 |
|
14265 | if (!isSpace(ch)) {
|
14266 | // " 1.test " - is not a list item
|
14267 | return -1;
|
14268 | }
|
14269 | }
|
14270 | return pos;
|
14271 | }
|
14272 |
|
14273 | function markTightParagraphs(state, idx) {
|
14274 | var i, l,
|
14275 | level = state.level + 2;
|
14276 |
|
14277 | for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
|
14278 | if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
|
14279 | state.tokens[i + 2].hidden = true;
|
14280 | state.tokens[i].hidden = true;
|
14281 | i += 2;
|
14282 | }
|
14283 | }
|
14284 | }
|
14285 |
|
14286 |
|
14287 | module.exports = function list(state, startLine, endLine, silent) {
|
14288 | var nextLine,
|
14289 | initial,
|
14290 | offset,
|
14291 | indent,
|
14292 | oldTShift,
|
14293 | oldIndent,
|
14294 | oldLIndent,
|
14295 | oldTight,
|
14296 | oldParentType,
|
14297 | start,
|
14298 | posAfterMarker,
|
14299 | ch,
|
14300 | pos,
|
14301 | max,
|
14302 | indentAfterMarker,
|
14303 | markerValue,
|
14304 | markerCharCode,
|
14305 | isOrdered,
|
14306 | contentStart,
|
14307 | listTokIdx,
|
14308 | prevEmptyEnd,
|
14309 | listLines,
|
14310 | itemLines,
|
14311 | tight = true,
|
14312 | terminatorRules,
|
14313 | token,
|
14314 | i, l, terminate;
|
14315 |
|
14316 | // Detect list type and position after marker
|
14317 | if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
|
14318 | isOrdered = true;
|
14319 | } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
|
14320 | isOrdered = false;
|
14321 | } else {
|
14322 | return false;
|
14323 | }
|
14324 |
|
14325 | // We should terminate list on style change. Remember first one to compare.
|
14326 | markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
|
14327 |
|
14328 | // For validation mode we can terminate immediately
|
14329 | if (silent) { return true; }
|
14330 |
|
14331 | // Start list
|
14332 | listTokIdx = state.tokens.length;
|
14333 |
|
14334 | if (isOrdered) {
|
14335 | start = state.bMarks[startLine] + state.tShift[startLine];
|
14336 | markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
|
14337 |
|
14338 | token = state.push('ordered_list_open', 'ol', 1);
|
14339 | if (markerValue !== 1) {
|
14340 | token.attrs = [ [ 'start', markerValue ] ];
|
14341 | }
|
14342 |
|
14343 | } else {
|
14344 | token = state.push('bullet_list_open', 'ul', 1);
|
14345 | }
|
14346 |
|
14347 | token.map = listLines = [ startLine, 0 ];
|
14348 | token.markup = String.fromCharCode(markerCharCode);
|
14349 |
|
14350 | //
|
14351 | // Iterate list items
|
14352 | //
|
14353 |
|
14354 | nextLine = startLine;
|
14355 | prevEmptyEnd = false;
|
14356 | terminatorRules = state.md.block.ruler.getRules('list');
|
14357 |
|
14358 | while (nextLine < endLine) {
|
14359 | pos = posAfterMarker;
|
14360 | max = state.eMarks[nextLine];
|
14361 |
|
14362 | initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
|
14363 |
|
14364 | while (pos < max) {
|
14365 | ch = state.src.charCodeAt(pos);
|
14366 |
|
14367 | if (isSpace(ch)) {
|
14368 | if (ch === 0x09) {
|
14369 | offset += 4 - offset % 4;
|
14370 | } else {
|
14371 | offset++;
|
14372 | }
|
14373 | } else {
|
14374 | break;
|
14375 | }
|
14376 |
|
14377 | pos++;
|
14378 | }
|
14379 |
|
14380 | contentStart = pos;
|
14381 |
|
14382 | if (contentStart >= max) {
|
14383 | // trimming space in "- \n 3" case, indent is 1 here
|
14384 | indentAfterMarker = 1;
|
14385 | } else {
|
14386 | indentAfterMarker = offset - initial;
|
14387 | }
|
14388 |
|
14389 | // If we have more than 4 spaces, the indent is 1
|
14390 | // (the rest is just indented code block)
|
14391 | if (indentAfterMarker > 4) { indentAfterMarker = 1; }
|
14392 |
|
14393 | // " - test"
|
14394 | // ^^^^^ - calculating total length of this thing
|
14395 | indent = initial + indentAfterMarker;
|
14396 |
|
14397 | // Run subparser & write tokens
|
14398 | token = state.push('list_item_open', 'li', 1);
|
14399 | token.markup = String.fromCharCode(markerCharCode);
|
14400 | token.map = itemLines = [ startLine, 0 ];
|
14401 |
|
14402 | oldIndent = state.blkIndent;
|
14403 | oldTight = state.tight;
|
14404 | oldTShift = state.tShift[startLine];
|
14405 | oldLIndent = state.sCount[startLine];
|
14406 | oldParentType = state.parentType;
|
14407 | state.blkIndent = indent;
|
14408 | state.tight = true;
|
14409 | state.parentType = 'list';
|
14410 | state.tShift[startLine] = contentStart - state.bMarks[startLine];
|
14411 | state.sCount[startLine] = offset;
|
14412 |
|
14413 | if (contentStart >= max && state.isEmpty(startLine + 1)) {
|
14414 | // workaround for this case
|
14415 | // (list item is empty, list terminates before "foo"):
|
14416 | // ~~~~~~~~
|
14417 | // -
|
14418 | //
|
14419 | // foo
|
14420 | // ~~~~~~~~
|
14421 | state.line = Math.min(state.line + 2, endLine);
|
14422 | } else {
|
14423 | state.md.block.tokenize(state, startLine, endLine, true);
|
14424 | }
|
14425 |
|
14426 | // If any of list item is tight, mark list as tight
|
14427 | if (!state.tight || prevEmptyEnd) {
|
14428 | tight = false;
|
14429 | }
|
14430 | // Item become loose if finish with empty line,
|
14431 | // but we should filter last element, because it means list finish
|
14432 | prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
|
14433 |
|
14434 | state.blkIndent = oldIndent;
|
14435 | state.tShift[startLine] = oldTShift;
|
14436 | state.sCount[startLine] = oldLIndent;
|
14437 | state.tight = oldTight;
|
14438 | state.parentType = oldParentType;
|
14439 |
|
14440 | token = state.push('list_item_close', 'li', -1);
|
14441 | token.markup = String.fromCharCode(markerCharCode);
|
14442 |
|
14443 | nextLine = startLine = state.line;
|
14444 | itemLines[1] = nextLine;
|
14445 | contentStart = state.bMarks[startLine];
|
14446 |
|
14447 | if (nextLine >= endLine) { break; }
|
14448 |
|
14449 | if (state.isEmpty(nextLine)) {
|
14450 | break;
|
14451 | }
|
14452 |
|
14453 | //
|
14454 | // Try to check if list is terminated or continued.
|
14455 | //
|
14456 | if (state.sCount[nextLine] < state.blkIndent) { break; }
|
14457 |
|
14458 | // fail if terminating block found
|
14459 | terminate = false;
|
14460 | for (i = 0, l = terminatorRules.length; i < l; i++) {
|
14461 | if (terminatorRules[i](state, nextLine, endLine, true)) {
|
14462 | terminate = true;
|
14463 | break;
|
14464 | }
|
14465 | }
|
14466 | if (terminate) { break; }
|
14467 |
|
14468 | // fail if list has another type
|
14469 | if (isOrdered) {
|
14470 | posAfterMarker = skipOrderedListMarker(state, nextLine);
|
14471 | if (posAfterMarker < 0) { break; }
|
14472 | } else {
|
14473 | posAfterMarker = skipBulletListMarker(state, nextLine);
|
14474 | if (posAfterMarker < 0) { break; }
|
14475 | }
|
14476 |
|
14477 | if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
|
14478 | }
|
14479 |
|
14480 | // Finilize list
|
14481 | if (isOrdered) {
|
14482 | token = state.push('ordered_list_close', 'ol', -1);
|
14483 | } else {
|
14484 | token = state.push('bullet_list_close', 'ul', -1);
|
14485 | }
|
14486 | token.markup = String.fromCharCode(markerCharCode);
|
14487 |
|
14488 | listLines[1] = nextLine;
|
14489 | state.line = nextLine;
|
14490 |
|
14491 | // mark paragraphs tight if needed
|
14492 | if (tight) {
|
14493 | markTightParagraphs(state, listTokIdx);
|
14494 | }
|
14495 |
|
14496 | return true;
|
14497 | };
|
14498 |
|
14499 | },{"../common/utils":32}],54:[function(require,module,exports){
|
14500 | // Paragraph
|
14501 |
|
14502 | 'use strict';
|
14503 |
|
14504 |
|
14505 | module.exports = function paragraph(state, startLine/*, endLine*/) {
|
14506 | var content, terminate, i, l, token,
|
14507 | nextLine = startLine + 1,
|
14508 | terminatorRules = state.md.block.ruler.getRules('paragraph'),
|
14509 | endLine = state.lineMax;
|
14510 |
|
14511 | // jump line-by-line until empty one or EOF
|
14512 | for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
14513 | // this would be a code block normally, but after paragraph
|
14514 | // it's considered a lazy continuation regardless of what's there
|
14515 | if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
|
14516 |
|
14517 | // quirk for blockquotes, this line should already be checked by that rule
|
14518 | if (state.sCount[nextLine] < 0) { continue; }
|
14519 |
|
14520 | // Some tags can terminate paragraph without empty line.
|
14521 | terminate = false;
|
14522 | for (i = 0, l = terminatorRules.length; i < l; i++) {
|
14523 | if (terminatorRules[i](state, nextLine, endLine, true)) {
|
14524 | terminate = true;
|
14525 | break;
|
14526 | }
|
14527 | }
|
14528 | if (terminate) { break; }
|
14529 | }
|
14530 |
|
14531 | content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
|
14532 |
|
14533 | state.line = nextLine;
|
14534 |
|
14535 | token = state.push('paragraph_open', 'p', 1);
|
14536 | token.map = [ startLine, state.line ];
|
14537 |
|
14538 | token = state.push('inline', '', 0);
|
14539 | token.content = content;
|
14540 | token.map = [ startLine, state.line ];
|
14541 | token.children = [];
|
14542 |
|
14543 | token = state.push('paragraph_close', 'p', -1);
|
14544 |
|
14545 | return true;
|
14546 | };
|
14547 |
|
14548 | },{}],55:[function(require,module,exports){
|
14549 | 'use strict';
|
14550 |
|
14551 |
|
14552 | var parseLinkDestination = require('../helpers/parse_link_destination');
|
14553 | var parseLinkTitle = require('../helpers/parse_link_title');
|
14554 | var normalizeReference = require('../common/utils').normalizeReference;
|
14555 | var isSpace = require('../common/utils').isSpace;
|
14556 |
|
14557 |
|
14558 | module.exports = function reference(state, startLine, _endLine, silent) {
|
14559 | var ch,
|
14560 | destEndPos,
|
14561 | destEndLineNo,
|
14562 | endLine,
|
14563 | href,
|
14564 | i,
|
14565 | l,
|
14566 | label,
|
14567 | labelEnd,
|
14568 | res,
|
14569 | start,
|
14570 | str,
|
14571 | terminate,
|
14572 | terminatorRules,
|
14573 | title,
|
14574 | lines = 0,
|
14575 | pos = state.bMarks[startLine] + state.tShift[startLine],
|
14576 | max = state.eMarks[startLine],
|
14577 | nextLine = startLine + 1;
|
14578 |
|
14579 | if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
|
14580 |
|
14581 | // Simple check to quickly interrupt scan on [link](url) at the start of line.
|
14582 | // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
|
14583 | while (++pos < max) {
|
14584 | if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
|
14585 | state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
|
14586 | if (pos + 1 === max) { return false; }
|
14587 | if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
|
14588 | break;
|
14589 | }
|
14590 | }
|
14591 |
|
14592 | endLine = state.lineMax;
|
14593 |
|
14594 | // jump line-by-line until empty one or EOF
|
14595 | terminatorRules = state.md.block.ruler.getRules('reference');
|
14596 |
|
14597 | for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
14598 | // this would be a code block normally, but after paragraph
|
14599 | // it's considered a lazy continuation regardless of what's there
|
14600 | if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
|
14601 |
|
14602 | // quirk for blockquotes, this line should already be checked by that rule
|
14603 | if (state.sCount[nextLine] < 0) { continue; }
|
14604 |
|
14605 | // Some tags can terminate paragraph without empty line.
|
14606 | terminate = false;
|
14607 | for (i = 0, l = terminatorRules.length; i < l; i++) {
|
14608 | if (terminatorRules[i](state, nextLine, endLine, true)) {
|
14609 | terminate = true;
|
14610 | break;
|
14611 | }
|
14612 | }
|
14613 | if (terminate) { break; }
|
14614 | }
|
14615 |
|
14616 | str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
|
14617 | max = str.length;
|
14618 |
|
14619 | for (pos = 1; pos < max; pos++) {
|
14620 | ch = str.charCodeAt(pos);
|
14621 | if (ch === 0x5B /* [ */) {
|
14622 | return false;
|
14623 | } else if (ch === 0x5D /* ] */) {
|
14624 | labelEnd = pos;
|
14625 | break;
|
14626 | } else if (ch === 0x0A /* \n */) {
|
14627 | lines++;
|
14628 | } else if (ch === 0x5C /* \ */) {
|
14629 | pos++;
|
14630 | if (pos < max && str.charCodeAt(pos) === 0x0A) {
|
14631 | lines++;
|
14632 | }
|
14633 | }
|
14634 | }
|
14635 |
|
14636 | if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
|
14637 |
|
14638 | // [label]: destination 'title'
|
14639 | // ^^^ skip optional whitespace here
|
14640 | for (pos = labelEnd + 2; pos < max; pos++) {
|
14641 | ch = str.charCodeAt(pos);
|
14642 | if (ch === 0x0A) {
|
14643 | lines++;
|
14644 | } else if (isSpace(ch)) {
|
14645 | /*eslint no-empty:0*/
|
14646 | } else {
|
14647 | break;
|
14648 | }
|
14649 | }
|
14650 |
|
14651 | // [label]: destination 'title'
|
14652 | // ^^^^^^^^^^^ parse this
|
14653 | res = parseLinkDestination(str, pos, max);
|
14654 | if (!res.ok) { return false; }
|
14655 |
|
14656 | href = state.md.normalizeLink(res.str);
|
14657 | if (!state.md.validateLink(href)) { return false; }
|
14658 |
|
14659 | pos = res.pos;
|
14660 | lines += res.lines;
|
14661 |
|
14662 | // save cursor state, we could require to rollback later
|
14663 | destEndPos = pos;
|
14664 | destEndLineNo = lines;
|
14665 |
|
14666 | // [label]: destination 'title'
|
14667 | // ^^^ skipping those spaces
|
14668 | start = pos;
|
14669 | for (; pos < max; pos++) {
|
14670 | ch = str.charCodeAt(pos);
|
14671 | if (ch === 0x0A) {
|
14672 | lines++;
|
14673 | } else if (isSpace(ch)) {
|
14674 | /*eslint no-empty:0*/
|
14675 | } else {
|
14676 | break;
|
14677 | }
|
14678 | }
|
14679 |
|
14680 | // [label]: destination 'title'
|
14681 | // ^^^^^^^ parse this
|
14682 | res = parseLinkTitle(str, pos, max);
|
14683 | if (pos < max && start !== pos && res.ok) {
|
14684 | title = res.str;
|
14685 | pos = res.pos;
|
14686 | lines += res.lines;
|
14687 | } else {
|
14688 | title = '';
|
14689 | pos = destEndPos;
|
14690 | lines = destEndLineNo;
|
14691 | }
|
14692 |
|
14693 | // skip trailing spaces until the rest of the line
|
14694 | while (pos < max) {
|
14695 | ch = str.charCodeAt(pos);
|
14696 | if (!isSpace(ch)) { break; }
|
14697 | pos++;
|
14698 | }
|
14699 |
|
14700 | if (pos < max && str.charCodeAt(pos) !== 0x0A) {
|
14701 | if (title) {
|
14702 | // garbage at the end of the line after title,
|
14703 | // but it could still be a valid reference if we roll back
|
14704 | title = '';
|
14705 | pos = destEndPos;
|
14706 | lines = destEndLineNo;
|
14707 | while (pos < max) {
|
14708 | ch = str.charCodeAt(pos);
|
14709 | if (!isSpace(ch)) { break; }
|
14710 | pos++;
|
14711 | }
|
14712 | }
|
14713 | }
|
14714 |
|
14715 | if (pos < max && str.charCodeAt(pos) !== 0x0A) {
|
14716 | // garbage at the end of the line
|
14717 | return false;
|
14718 | }
|
14719 |
|
14720 | label = normalizeReference(str.slice(1, labelEnd));
|
14721 | if (!label) {
|
14722 | // CommonMark 0.20 disallows empty labels
|
14723 | return false;
|
14724 | }
|
14725 |
|
14726 | // Reference can not terminate anything. This check is for safety only.
|
14727 | /*istanbul ignore if*/
|
14728 | if (silent) { return true; }
|
14729 |
|
14730 | if (typeof state.env.references === 'undefined') {
|
14731 | state.env.references = {};
|
14732 | }
|
14733 | if (typeof state.env.references[label] === 'undefined') {
|
14734 | state.env.references[label] = { title: title, href: href };
|
14735 | }
|
14736 |
|
14737 | state.line = startLine + lines + 1;
|
14738 | return true;
|
14739 | };
|
14740 |
|
14741 | },{"../common/utils":32,"../helpers/parse_link_destination":34,"../helpers/parse_link_title":36}],56:[function(require,module,exports){
|
14742 | // Parser state class
|
14743 |
|
14744 | 'use strict';
|
14745 |
|
14746 | var Token = require('../token');
|
14747 | var isSpace = require('../common/utils').isSpace;
|
14748 |
|
14749 |
|
14750 | function StateBlock(src, md, env, tokens) {
|
14751 | var ch, s, start, pos, len, indent, offset, indent_found;
|
14752 |
|
14753 | this.src = src;
|
14754 |
|
14755 | // link to parser instance
|
14756 | this.md = md;
|
14757 |
|
14758 | this.env = env;
|
14759 |
|
14760 | //
|
14761 | // Internal state vartiables
|
14762 | //
|
14763 |
|
14764 | this.tokens = tokens;
|
14765 |
|
14766 | this.bMarks = []; // line begin offsets for fast jumps
|
14767 | this.eMarks = []; // line end offsets for fast jumps
|
14768 | this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
|
14769 | this.sCount = []; // indents for each line (tabs expanded)
|
14770 |
|
14771 | // block parser variables
|
14772 | this.blkIndent = 0; // required block content indent
|
14773 | // (for example, if we are in list)
|
14774 | this.line = 0; // line index in src
|
14775 | this.lineMax = 0; // lines count
|
14776 | this.tight = false; // loose/tight mode for lists
|
14777 | this.parentType = 'root'; // if `list`, block parser stops on two newlines
|
14778 | this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
|
14779 |
|
14780 | this.level = 0;
|
14781 |
|
14782 | // renderer
|
14783 | this.result = '';
|
14784 |
|
14785 | // Create caches
|
14786 | // Generate markers.
|
14787 | s = this.src;
|
14788 | indent_found = false;
|
14789 |
|
14790 | for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
|
14791 | ch = s.charCodeAt(pos);
|
14792 |
|
14793 | if (!indent_found) {
|
14794 | if (isSpace(ch)) {
|
14795 | indent++;
|
14796 |
|
14797 | if (ch === 0x09) {
|
14798 | offset += 4 - offset % 4;
|
14799 | } else {
|
14800 | offset++;
|
14801 | }
|
14802 | continue;
|
14803 | } else {
|
14804 | indent_found = true;
|
14805 | }
|
14806 | }
|
14807 |
|
14808 | if (ch === 0x0A || pos === len - 1) {
|
14809 | if (ch !== 0x0A) { pos++; }
|
14810 | this.bMarks.push(start);
|
14811 | this.eMarks.push(pos);
|
14812 | this.tShift.push(indent);
|
14813 | this.sCount.push(offset);
|
14814 |
|
14815 | indent_found = false;
|
14816 | indent = 0;
|
14817 | offset = 0;
|
14818 | start = pos + 1;
|
14819 | }
|
14820 | }
|
14821 |
|
14822 | // Push fake entry to simplify cache bounds checks
|
14823 | this.bMarks.push(s.length);
|
14824 | this.eMarks.push(s.length);
|
14825 | this.tShift.push(0);
|
14826 | this.sCount.push(0);
|
14827 |
|
14828 | this.lineMax = this.bMarks.length - 1; // don't count last fake line
|
14829 | }
|
14830 |
|
14831 | // Push new token to "stream".
|
14832 | //
|
14833 | StateBlock.prototype.push = function (type, tag, nesting) {
|
14834 | var token = new Token(type, tag, nesting);
|
14835 | token.block = true;
|
14836 |
|
14837 | if (nesting < 0) { this.level--; }
|
14838 | token.level = this.level;
|
14839 | if (nesting > 0) { this.level++; }
|
14840 |
|
14841 | this.tokens.push(token);
|
14842 | return token;
|
14843 | };
|
14844 |
|
14845 | StateBlock.prototype.isEmpty = function isEmpty(line) {
|
14846 | return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
|
14847 | };
|
14848 |
|
14849 | StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
|
14850 | for (var max = this.lineMax; from < max; from++) {
|
14851 | if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
|
14852 | break;
|
14853 | }
|
14854 | }
|
14855 | return from;
|
14856 | };
|
14857 |
|
14858 | // Skip spaces from given position.
|
14859 | StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
|
14860 | var ch;
|
14861 |
|
14862 | for (var max = this.src.length; pos < max; pos++) {
|
14863 | ch = this.src.charCodeAt(pos);
|
14864 | if (!isSpace(ch)) { break; }
|
14865 | }
|
14866 | return pos;
|
14867 | };
|
14868 |
|
14869 | // Skip spaces from given position in reverse.
|
14870 | StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
|
14871 | if (pos <= min) { return pos; }
|
14872 |
|
14873 | while (pos > min) {
|
14874 | if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
|
14875 | }
|
14876 | return pos;
|
14877 | };
|
14878 |
|
14879 | // Skip char codes from given position
|
14880 | StateBlock.prototype.skipChars = function skipChars(pos, code) {
|
14881 | for (var max = this.src.length; pos < max; pos++) {
|
14882 | if (this.src.charCodeAt(pos) !== code) { break; }
|
14883 | }
|
14884 | return pos;
|
14885 | };
|
14886 |
|
14887 | // Skip char codes reverse from given position - 1
|
14888 | StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
|
14889 | if (pos <= min) { return pos; }
|
14890 |
|
14891 | while (pos > min) {
|
14892 | if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
|
14893 | }
|
14894 | return pos;
|
14895 | };
|
14896 |
|
14897 | // cut lines range from source.
|
14898 | StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
|
14899 | var i, lineIndent, ch, first, last, queue, lineStart,
|
14900 | line = begin;
|
14901 |
|
14902 | if (begin >= end) {
|
14903 | return '';
|
14904 | }
|
14905 |
|
14906 | queue = new Array(end - begin);
|
14907 |
|
14908 | for (i = 0; line < end; line++, i++) {
|
14909 | lineIndent = 0;
|
14910 | lineStart = first = this.bMarks[line];
|
14911 |
|
14912 | if (line + 1 < end || keepLastLF) {
|
14913 | // No need for bounds check because we have fake entry on tail.
|
14914 | last = this.eMarks[line] + 1;
|
14915 | } else {
|
14916 | last = this.eMarks[line];
|
14917 | }
|
14918 |
|
14919 | while (first < last && lineIndent < indent) {
|
14920 | ch = this.src.charCodeAt(first);
|
14921 |
|
14922 | if (isSpace(ch)) {
|
14923 | if (ch === 0x09) {
|
14924 | lineIndent += 4 - lineIndent % 4;
|
14925 | } else {
|
14926 | lineIndent++;
|
14927 | }
|
14928 | } else if (first - lineStart < this.tShift[line]) {
|
14929 | // patched tShift masked characters to look like spaces (blockquotes, list markers)
|
14930 | lineIndent++;
|
14931 | } else {
|
14932 | break;
|
14933 | }
|
14934 |
|
14935 | first++;
|
14936 | }
|
14937 |
|
14938 | queue[i] = this.src.slice(first, last);
|
14939 | }
|
14940 |
|
14941 | return queue.join('');
|
14942 | };
|
14943 |
|
14944 | // re-export Token class to use in block rules
|
14945 | StateBlock.prototype.Token = Token;
|
14946 |
|
14947 |
|
14948 | module.exports = StateBlock;
|
14949 |
|
14950 | },{"../common/utils":32,"../token":79}],57:[function(require,module,exports){
|
14951 | // GFM table, non-standard
|
14952 |
|
14953 | 'use strict';
|
14954 |
|
14955 |
|
14956 | function getLine(state, line) {
|
14957 | var pos = state.bMarks[line] + state.blkIndent,
|
14958 | max = state.eMarks[line];
|
14959 |
|
14960 | return state.src.substr(pos, max - pos);
|
14961 | }
|
14962 |
|
14963 | function escapedSplit(str) {
|
14964 | var result = [],
|
14965 | pos = 0,
|
14966 | max = str.length,
|
14967 | ch,
|
14968 | escapes = 0,
|
14969 | lastPos = 0,
|
14970 | backTicked = false,
|
14971 | lastBackTick = 0;
|
14972 |
|
14973 | ch = str.charCodeAt(pos);
|
14974 |
|
14975 | while (pos < max) {
|
14976 | if (ch === 0x60/* ` */ && (escapes % 2 === 0)) {
|
14977 | backTicked = !backTicked;
|
14978 | lastBackTick = pos;
|
14979 | } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
|
14980 | result.push(str.substring(lastPos, pos));
|
14981 | lastPos = pos + 1;
|
14982 | } else if (ch === 0x5c/* \ */) {
|
14983 | escapes++;
|
14984 | } else {
|
14985 | escapes = 0;
|
14986 | }
|
14987 |
|
14988 | pos++;
|
14989 |
|
14990 | // If there was an un-closed backtick, go back to just after
|
14991 | // the last backtick, but as if it was a normal character
|
14992 | if (pos === max && backTicked) {
|
14993 | backTicked = false;
|
14994 | pos = lastBackTick + 1;
|
14995 | }
|
14996 |
|
14997 | ch = str.charCodeAt(pos);
|
14998 | }
|
14999 |
|
15000 | result.push(str.substring(lastPos));
|
15001 |
|
15002 | return result;
|
15003 | }
|
15004 |
|
15005 |
|
15006 | module.exports = function table(state, startLine, endLine, silent) {
|
15007 | var ch, lineText, pos, i, nextLine, columns, columnCount, token,
|
15008 | aligns, t, tableLines, tbodyLines;
|
15009 |
|
15010 | // should have at least three lines
|
15011 | if (startLine + 2 > endLine) { return false; }
|
15012 |
|
15013 | nextLine = startLine + 1;
|
15014 |
|
15015 | if (state.sCount[nextLine] < state.blkIndent) { return false; }
|
15016 |
|
15017 | // first character of the second line should be '|' or '-'
|
15018 |
|
15019 | pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
15020 | if (pos >= state.eMarks[nextLine]) { return false; }
|
15021 |
|
15022 | ch = state.src.charCodeAt(pos);
|
15023 | if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
|
15024 |
|
15025 | lineText = getLine(state, startLine + 1);
|
15026 | if (!/^[-:| ]+$/.test(lineText)) { return false; }
|
15027 |
|
15028 | columns = lineText.split('|');
|
15029 | aligns = [];
|
15030 | for (i = 0; i < columns.length; i++) {
|
15031 | t = columns[i].trim();
|
15032 | if (!t) {
|
15033 | // allow empty columns before and after table, but not in between columns;
|
15034 | // e.g. allow ` |---| `, disallow ` ---||--- `
|
15035 | if (i === 0 || i === columns.length - 1) {
|
15036 | continue;
|
15037 | } else {
|
15038 | return false;
|
15039 | }
|
15040 | }
|
15041 |
|
15042 | if (!/^:?-+:?$/.test(t)) { return false; }
|
15043 | if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
|
15044 | aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
|
15045 | } else if (t.charCodeAt(0) === 0x3A/* : */) {
|
15046 | aligns.push('left');
|
15047 | } else {
|
15048 | aligns.push('');
|
15049 | }
|
15050 | }
|
15051 |
|
15052 | lineText = getLine(state, startLine).trim();
|
15053 | if (lineText.indexOf('|') === -1) { return false; }
|
15054 | columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
|
15055 |
|
15056 | // header row will define an amount of columns in the entire table,
|
15057 | // and align row shouldn't be smaller than that (the rest of the rows can)
|
15058 | columnCount = columns.length;
|
15059 | if (columnCount > aligns.length) { return false; }
|
15060 |
|
15061 | if (silent) { return true; }
|
15062 |
|
15063 | token = state.push('table_open', 'table', 1);
|
15064 | token.map = tableLines = [ startLine, 0 ];
|
15065 |
|
15066 | token = state.push('thead_open', 'thead', 1);
|
15067 | token.map = [ startLine, startLine + 1 ];
|
15068 |
|
15069 | token = state.push('tr_open', 'tr', 1);
|
15070 | token.map = [ startLine, startLine + 1 ];
|
15071 |
|
15072 | for (i = 0; i < columns.length; i++) {
|
15073 | token = state.push('th_open', 'th', 1);
|
15074 | token.map = [ startLine, startLine + 1 ];
|
15075 | if (aligns[i]) {
|
15076 | token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
|
15077 | }
|
15078 |
|
15079 | token = state.push('inline', '', 0);
|
15080 | token.content = columns[i].trim();
|
15081 | token.map = [ startLine, startLine + 1 ];
|
15082 | token.children = [];
|
15083 |
|
15084 | token = state.push('th_close', 'th', -1);
|
15085 | }
|
15086 |
|
15087 | token = state.push('tr_close', 'tr', -1);
|
15088 | token = state.push('thead_close', 'thead', -1);
|
15089 |
|
15090 | token = state.push('tbody_open', 'tbody', 1);
|
15091 | token.map = tbodyLines = [ startLine + 2, 0 ];
|
15092 |
|
15093 | for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
|
15094 | if (state.sCount[nextLine] < state.blkIndent) { break; }
|
15095 |
|
15096 | lineText = getLine(state, nextLine).trim();
|
15097 | if (lineText.indexOf('|') === -1) { break; }
|
15098 | columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
|
15099 |
|
15100 | token = state.push('tr_open', 'tr', 1);
|
15101 | for (i = 0; i < columnCount; i++) {
|
15102 | token = state.push('td_open', 'td', 1);
|
15103 | if (aligns[i]) {
|
15104 | token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
|
15105 | }
|
15106 |
|
15107 | token = state.push('inline', '', 0);
|
15108 | token.content = columns[i] ? columns[i].trim() : '';
|
15109 | token.children = [];
|
15110 |
|
15111 | token = state.push('td_close', 'td', -1);
|
15112 | }
|
15113 | token = state.push('tr_close', 'tr', -1);
|
15114 | }
|
15115 | token = state.push('tbody_close', 'tbody', -1);
|
15116 | token = state.push('table_close', 'table', -1);
|
15117 |
|
15118 | tableLines[1] = tbodyLines[1] = nextLine;
|
15119 | state.line = nextLine;
|
15120 | return true;
|
15121 | };
|
15122 |
|
15123 | },{}],58:[function(require,module,exports){
|
15124 | 'use strict';
|
15125 |
|
15126 |
|
15127 | module.exports = function block(state) {
|
15128 | var token;
|
15129 |
|
15130 | if (state.inlineMode) {
|
15131 | token = new state.Token('inline', '', 0);
|
15132 | token.content = state.src;
|
15133 | token.map = [ 0, 1 ];
|
15134 | token.children = [];
|
15135 | state.tokens.push(token);
|
15136 | } else {
|
15137 | state.md.block.parse(state.src, state.md, state.env, state.tokens);
|
15138 | }
|
15139 | };
|
15140 |
|
15141 | },{}],59:[function(require,module,exports){
|
15142 | 'use strict';
|
15143 |
|
15144 | module.exports = function inline(state) {
|
15145 | var tokens = state.tokens, tok, i, l;
|
15146 |
|
15147 | // Parse inlines
|
15148 | for (i = 0, l = tokens.length; i < l; i++) {
|
15149 | tok = tokens[i];
|
15150 | if (tok.type === 'inline') {
|
15151 | state.md.inline.parse(tok.content, state.md, state.env, tok.children);
|
15152 | }
|
15153 | }
|
15154 | };
|
15155 |
|
15156 | },{}],60:[function(require,module,exports){
|
15157 | // Replace link-like texts with link nodes.
|
15158 | //
|
15159 | // Currently restricted by `md.validateLink()` to http/https/ftp
|
15160 | //
|
15161 | 'use strict';
|
15162 |
|
15163 |
|
15164 | var arrayReplaceAt = require('../common/utils').arrayReplaceAt;
|
15165 |
|
15166 |
|
15167 | function isLinkOpen(str) {
|
15168 | return /^<a[>\s]/i.test(str);
|
15169 | }
|
15170 | function isLinkClose(str) {
|
15171 | return /^<\/a\s*>/i.test(str);
|
15172 | }
|
15173 |
|
15174 |
|
15175 | module.exports = function linkify(state) {
|
15176 | var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
|
15177 | level, htmlLinkLevel, url, fullUrl, urlText,
|
15178 | blockTokens = state.tokens,
|
15179 | links;
|
15180 |
|
15181 | if (!state.md.options.linkify) { return; }
|
15182 |
|
15183 | for (j = 0, l = blockTokens.length; j < l; j++) {
|
15184 | if (blockTokens[j].type !== 'inline' ||
|
15185 | !state.md.linkify.pretest(blockTokens[j].content)) {
|
15186 | continue;
|
15187 | }
|
15188 |
|
15189 | tokens = blockTokens[j].children;
|
15190 |
|
15191 | htmlLinkLevel = 0;
|
15192 |
|
15193 | // We scan from the end, to keep position when new tags added.
|
15194 | // Use reversed logic in links start/end match
|
15195 | for (i = tokens.length - 1; i >= 0; i--) {
|
15196 | currentToken = tokens[i];
|
15197 |
|
15198 | // Skip content of markdown links
|
15199 | if (currentToken.type === 'link_close') {
|
15200 | i--;
|
15201 | while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
|
15202 | i--;
|
15203 | }
|
15204 | continue;
|
15205 | }
|
15206 |
|
15207 | // Skip content of html tag links
|
15208 | if (currentToken.type === 'html_inline') {
|
15209 | if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
|
15210 | htmlLinkLevel--;
|
15211 | }
|
15212 | if (isLinkClose(currentToken.content)) {
|
15213 | htmlLinkLevel++;
|
15214 | }
|
15215 | }
|
15216 | if (htmlLinkLevel > 0) { continue; }
|
15217 |
|
15218 | if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
|
15219 |
|
15220 | text = currentToken.content;
|
15221 | links = state.md.linkify.match(text);
|
15222 |
|
15223 | // Now split string to nodes
|
15224 | nodes = [];
|
15225 | level = currentToken.level;
|
15226 | lastPos = 0;
|
15227 |
|
15228 | for (ln = 0; ln < links.length; ln++) {
|
15229 |
|
15230 | url = links[ln].url;
|
15231 | fullUrl = state.md.normalizeLink(url);
|
15232 | if (!state.md.validateLink(fullUrl)) { continue; }
|
15233 |
|
15234 | urlText = links[ln].text;
|
15235 |
|
15236 | // Linkifier might send raw hostnames like "example.com", where url
|
15237 | // starts with domain name. So we prepend http:// in those cases,
|
15238 | // and remove it afterwards.
|
15239 | //
|
15240 | if (!links[ln].schema) {
|
15241 | urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
|
15242 | } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
|
15243 | urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
|
15244 | } else {
|
15245 | urlText = state.md.normalizeLinkText(urlText);
|
15246 | }
|
15247 |
|
15248 | pos = links[ln].index;
|
15249 |
|
15250 | if (pos > lastPos) {
|
15251 | token = new state.Token('text', '', 0);
|
15252 | token.content = text.slice(lastPos, pos);
|
15253 | token.level = level;
|
15254 | nodes.push(token);
|
15255 | }
|
15256 |
|
15257 | token = new state.Token('link_open', 'a', 1);
|
15258 | token.attrs = [ [ 'href', fullUrl ] ];
|
15259 | token.level = level++;
|
15260 | token.markup = 'linkify';
|
15261 | token.info = 'auto';
|
15262 | nodes.push(token);
|
15263 |
|
15264 | token = new state.Token('text', '', 0);
|
15265 | token.content = urlText;
|
15266 | token.level = level;
|
15267 | nodes.push(token);
|
15268 |
|
15269 | token = new state.Token('link_close', 'a', -1);
|
15270 | token.level = --level;
|
15271 | token.markup = 'linkify';
|
15272 | token.info = 'auto';
|
15273 | nodes.push(token);
|
15274 |
|
15275 | lastPos = links[ln].lastIndex;
|
15276 | }
|
15277 | if (lastPos < text.length) {
|
15278 | token = new state.Token('text', '', 0);
|
15279 | token.content = text.slice(lastPos);
|
15280 | token.level = level;
|
15281 | nodes.push(token);
|
15282 | }
|
15283 |
|
15284 | // replace current node
|
15285 | blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
|
15286 | }
|
15287 | }
|
15288 | }
|
15289 | };
|
15290 |
|
15291 | },{"../common/utils":32}],61:[function(require,module,exports){
|
15292 | // Normalize input string
|
15293 |
|
15294 | 'use strict';
|
15295 |
|
15296 |
|
15297 | var NEWLINES_RE = /\r[\n\u0085]|[\u2424\u2028\u0085]/g;
|
15298 | var NULL_RE = /\u0000/g;
|
15299 |
|
15300 |
|
15301 | module.exports = function inline(state) {
|
15302 | var str;
|
15303 |
|
15304 | // Normalize newlines
|
15305 | str = state.src.replace(NEWLINES_RE, '\n');
|
15306 |
|
15307 | // Replace NULL characters
|
15308 | str = str.replace(NULL_RE, '\uFFFD');
|
15309 |
|
15310 | state.src = str;
|
15311 | };
|
15312 |
|
15313 | },{}],62:[function(require,module,exports){
|
15314 | // Simple typographyc replacements
|
15315 | //
|
15316 | // (c) (C) → ©
|
15317 | // (tm) (TM) → ™
|
15318 | // (r) (R) → ®
|
15319 | // +- → ±
|
15320 | // (p) (P) -> §
|
15321 | // ... → … (also ?.... → ?.., !.... → !..)
|
15322 | // ???????? → ???, !!!!! → !!!, `,,` → `,`
|
15323 | // -- → –, --- → —
|
15324 | //
|
15325 | 'use strict';
|
15326 |
|
15327 | // TODO:
|
15328 | // - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
|
15329 | // - miltiplication 2 x 4 -> 2 × 4
|
15330 |
|
15331 | var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
|
15332 |
|
15333 | // Workaround for phantomjs - need regex without /g flag,
|
15334 | // or root check will fail every second time
|
15335 | var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
|
15336 |
|
15337 | var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
|
15338 | var SCOPED_ABBR = {
|
15339 | 'c': '©',
|
15340 | 'r': '®',
|
15341 | 'p': '§',
|
15342 | 'tm': '™'
|
15343 | };
|
15344 |
|
15345 | function replaceFn(match, name) {
|
15346 | return SCOPED_ABBR[name.toLowerCase()];
|
15347 | }
|
15348 |
|
15349 | function replace_scoped(inlineTokens) {
|
15350 | var i, token;
|
15351 |
|
15352 | for (i = inlineTokens.length - 1; i >= 0; i--) {
|
15353 | token = inlineTokens[i];
|
15354 | if (token.type === 'text') {
|
15355 | token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
|
15356 | }
|
15357 | }
|
15358 | }
|
15359 |
|
15360 | function replace_rare(inlineTokens) {
|
15361 | var i, token;
|
15362 |
|
15363 | for (i = inlineTokens.length - 1; i >= 0; i--) {
|
15364 | token = inlineTokens[i];
|
15365 | if (token.type === 'text') {
|
15366 | if (RARE_RE.test(token.content)) {
|
15367 | token.content = token.content
|
15368 | .replace(/\+-/g, '±')
|
15369 | // .., ..., ....... -> …
|
15370 | // but ?..... & !..... -> ?.. & !..
|
15371 | .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
|
15372 | .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
|
15373 | // em-dash
|
15374 | .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
|
15375 | // en-dash
|
15376 | .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
|
15377 | .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
|
15378 | }
|
15379 | }
|
15380 | }
|
15381 | }
|
15382 |
|
15383 |
|
15384 | module.exports = function replace(state) {
|
15385 | var blkIdx;
|
15386 |
|
15387 | if (!state.md.options.typographer) { return; }
|
15388 |
|
15389 | for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
|
15390 |
|
15391 | if (state.tokens[blkIdx].type !== 'inline') { continue; }
|
15392 |
|
15393 | if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
|
15394 | replace_scoped(state.tokens[blkIdx].children);
|
15395 | }
|
15396 |
|
15397 | if (RARE_RE.test(state.tokens[blkIdx].content)) {
|
15398 | replace_rare(state.tokens[blkIdx].children);
|
15399 | }
|
15400 |
|
15401 | }
|
15402 | };
|
15403 |
|
15404 | },{}],63:[function(require,module,exports){
|
15405 | // Convert straight quotation marks to typographic ones
|
15406 | //
|
15407 | 'use strict';
|
15408 |
|
15409 |
|
15410 | var isWhiteSpace = require('../common/utils').isWhiteSpace;
|
15411 | var isPunctChar = require('../common/utils').isPunctChar;
|
15412 | var isMdAsciiPunct = require('../common/utils').isMdAsciiPunct;
|
15413 |
|
15414 | var QUOTE_TEST_RE = /['"]/;
|
15415 | var QUOTE_RE = /['"]/g;
|
15416 | var APOSTROPHE = '\u2019'; /* ’ */
|
15417 |
|
15418 |
|
15419 | function replaceAt(str, index, ch) {
|
15420 | return str.substr(0, index) + ch + str.substr(index + 1);
|
15421 | }
|
15422 |
|
15423 | function process_inlines(tokens, state) {
|
15424 | var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
|
15425 | isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
|
15426 | canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
|
15427 |
|
15428 | stack = [];
|
15429 |
|
15430 | for (i = 0; i < tokens.length; i++) {
|
15431 | token = tokens[i];
|
15432 |
|
15433 | thisLevel = tokens[i].level;
|
15434 |
|
15435 | for (j = stack.length - 1; j >= 0; j--) {
|
15436 | if (stack[j].level <= thisLevel) { break; }
|
15437 | }
|
15438 | stack.length = j + 1;
|
15439 |
|
15440 | if (token.type !== 'text') { continue; }
|
15441 |
|
15442 | text = token.content;
|
15443 | pos = 0;
|
15444 | max = text.length;
|
15445 |
|
15446 | /*eslint no-labels:0,block-scoped-var:0*/
|
15447 | OUTER:
|
15448 | while (pos < max) {
|
15449 | QUOTE_RE.lastIndex = pos;
|
15450 | t = QUOTE_RE.exec(text);
|
15451 | if (!t) { break; }
|
15452 |
|
15453 | canOpen = canClose = true;
|
15454 | pos = t.index + 1;
|
15455 | isSingle = (t[0] === "'");
|
15456 |
|
15457 | // Find previous character,
|
15458 | // default to space if it's the beginning of the line
|
15459 | //
|
15460 | lastChar = 0x20;
|
15461 |
|
15462 | if (t.index - 1 >= 0) {
|
15463 | lastChar = text.charCodeAt(t.index - 1);
|
15464 | } else {
|
15465 | for (j = i - 1; j >= 0; j--) {
|
15466 | if (tokens[j].type !== 'text') { continue; }
|
15467 |
|
15468 | lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
|
15469 | break;
|
15470 | }
|
15471 | }
|
15472 |
|
15473 | // Find next character,
|
15474 | // default to space if it's the end of the line
|
15475 | //
|
15476 | nextChar = 0x20;
|
15477 |
|
15478 | if (pos < max) {
|
15479 | nextChar = text.charCodeAt(pos);
|
15480 | } else {
|
15481 | for (j = i + 1; j < tokens.length; j++) {
|
15482 | if (tokens[j].type !== 'text') { continue; }
|
15483 |
|
15484 | nextChar = tokens[j].content.charCodeAt(0);
|
15485 | break;
|
15486 | }
|
15487 | }
|
15488 |
|
15489 | isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
|
15490 | isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
|
15491 |
|
15492 | isLastWhiteSpace = isWhiteSpace(lastChar);
|
15493 | isNextWhiteSpace = isWhiteSpace(nextChar);
|
15494 |
|
15495 | if (isNextWhiteSpace) {
|
15496 | canOpen = false;
|
15497 | } else if (isNextPunctChar) {
|
15498 | if (!(isLastWhiteSpace || isLastPunctChar)) {
|
15499 | canOpen = false;
|
15500 | }
|
15501 | }
|
15502 |
|
15503 | if (isLastWhiteSpace) {
|
15504 | canClose = false;
|
15505 | } else if (isLastPunctChar) {
|
15506 | if (!(isNextWhiteSpace || isNextPunctChar)) {
|
15507 | canClose = false;
|
15508 | }
|
15509 | }
|
15510 |
|
15511 | if (nextChar === 0x22 /* " */ && t[0] === '"') {
|
15512 | if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
|
15513 | // special case: 1"" - count first quote as an inch
|
15514 | canClose = canOpen = false;
|
15515 | }
|
15516 | }
|
15517 |
|
15518 | if (canOpen && canClose) {
|
15519 | // treat this as the middle of the word
|
15520 | canOpen = false;
|
15521 | canClose = isNextPunctChar;
|
15522 | }
|
15523 |
|
15524 | if (!canOpen && !canClose) {
|
15525 | // middle of word
|
15526 | if (isSingle) {
|
15527 | token.content = replaceAt(token.content, t.index, APOSTROPHE);
|
15528 | }
|
15529 | continue;
|
15530 | }
|
15531 |
|
15532 | if (canClose) {
|
15533 | // this could be a closing quote, rewind the stack to get a match
|
15534 | for (j = stack.length - 1; j >= 0; j--) {
|
15535 | item = stack[j];
|
15536 | if (stack[j].level < thisLevel) { break; }
|
15537 | if (item.single === isSingle && stack[j].level === thisLevel) {
|
15538 | item = stack[j];
|
15539 |
|
15540 | if (isSingle) {
|
15541 | openQuote = state.md.options.quotes[2];
|
15542 | closeQuote = state.md.options.quotes[3];
|
15543 | } else {
|
15544 | openQuote = state.md.options.quotes[0];
|
15545 | closeQuote = state.md.options.quotes[1];
|
15546 | }
|
15547 |
|
15548 | // replace token.content *before* tokens[item.token].content,
|
15549 | // because, if they are pointing at the same token, replaceAt
|
15550 | // could mess up indices when quote length != 1
|
15551 | token.content = replaceAt(token.content, t.index, closeQuote);
|
15552 | tokens[item.token].content = replaceAt(
|
15553 | tokens[item.token].content, item.pos, openQuote);
|
15554 |
|
15555 | pos += closeQuote.length - 1;
|
15556 | if (item.token === i) { pos += openQuote.length - 1; }
|
15557 |
|
15558 | text = token.content;
|
15559 | max = text.length;
|
15560 |
|
15561 | stack.length = j;
|
15562 | continue OUTER;
|
15563 | }
|
15564 | }
|
15565 | }
|
15566 |
|
15567 | if (canOpen) {
|
15568 | stack.push({
|
15569 | token: i,
|
15570 | pos: t.index,
|
15571 | single: isSingle,
|
15572 | level: thisLevel
|
15573 | });
|
15574 | } else if (canClose && isSingle) {
|
15575 | token.content = replaceAt(token.content, t.index, APOSTROPHE);
|
15576 | }
|
15577 | }
|
15578 | }
|
15579 | }
|
15580 |
|
15581 |
|
15582 | module.exports = function smartquotes(state) {
|
15583 | /*eslint max-depth:0*/
|
15584 | var blkIdx;
|
15585 |
|
15586 | if (!state.md.options.typographer) { return; }
|
15587 |
|
15588 | for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
|
15589 |
|
15590 | if (state.tokens[blkIdx].type !== 'inline' ||
|
15591 | !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
|
15592 | continue;
|
15593 | }
|
15594 |
|
15595 | process_inlines(state.tokens[blkIdx].children, state);
|
15596 | }
|
15597 | };
|
15598 |
|
15599 | },{"../common/utils":32}],64:[function(require,module,exports){
|
15600 | // Core state object
|
15601 | //
|
15602 | 'use strict';
|
15603 |
|
15604 | var Token = require('../token');
|
15605 |
|
15606 |
|
15607 | function StateCore(src, md, env) {
|
15608 | this.src = src;
|
15609 | this.env = env;
|
15610 | this.tokens = [];
|
15611 | this.inlineMode = false;
|
15612 | this.md = md; // link to parser instance
|
15613 | }
|
15614 |
|
15615 | // re-export Token class to use in core rules
|
15616 | StateCore.prototype.Token = Token;
|
15617 |
|
15618 |
|
15619 | module.exports = StateCore;
|
15620 |
|
15621 | },{"../token":79}],65:[function(require,module,exports){
|
15622 | // Process autolinks '<protocol:...>'
|
15623 |
|
15624 | 'use strict';
|
15625 |
|
15626 |
|
15627 | /*eslint max-len:0*/
|
15628 | var EMAIL_RE = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/;
|
15629 | var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
|
15630 |
|
15631 |
|
15632 | module.exports = function autolink(state, silent) {
|
15633 | var tail, linkMatch, emailMatch, url, fullUrl, token,
|
15634 | pos = state.pos;
|
15635 |
|
15636 | if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
|
15637 |
|
15638 | tail = state.src.slice(pos);
|
15639 |
|
15640 | if (tail.indexOf('>') < 0) { return false; }
|
15641 |
|
15642 | if (AUTOLINK_RE.test(tail)) {
|
15643 | linkMatch = tail.match(AUTOLINK_RE);
|
15644 |
|
15645 | url = linkMatch[0].slice(1, -1);
|
15646 | fullUrl = state.md.normalizeLink(url);
|
15647 | if (!state.md.validateLink(fullUrl)) { return false; }
|
15648 |
|
15649 | if (!silent) {
|
15650 | token = state.push('link_open', 'a', 1);
|
15651 | token.attrs = [ [ 'href', fullUrl ] ];
|
15652 | token.markup = 'autolink';
|
15653 | token.info = 'auto';
|
15654 |
|
15655 | token = state.push('text', '', 0);
|
15656 | token.content = state.md.normalizeLinkText(url);
|
15657 |
|
15658 | token = state.push('link_close', 'a', -1);
|
15659 | token.markup = 'autolink';
|
15660 | token.info = 'auto';
|
15661 | }
|
15662 |
|
15663 | state.pos += linkMatch[0].length;
|
15664 | return true;
|
15665 | }
|
15666 |
|
15667 | if (EMAIL_RE.test(tail)) {
|
15668 | emailMatch = tail.match(EMAIL_RE);
|
15669 |
|
15670 | url = emailMatch[0].slice(1, -1);
|
15671 | fullUrl = state.md.normalizeLink('mailto:' + url);
|
15672 | if (!state.md.validateLink(fullUrl)) { return false; }
|
15673 |
|
15674 | if (!silent) {
|
15675 | token = state.push('link_open', 'a', 1);
|
15676 | token.attrs = [ [ 'href', fullUrl ] ];
|
15677 | token.markup = 'autolink';
|
15678 | token.info = 'auto';
|
15679 |
|
15680 | token = state.push('text', '', 0);
|
15681 | token.content = state.md.normalizeLinkText(url);
|
15682 |
|
15683 | token = state.push('link_close', 'a', -1);
|
15684 | token.markup = 'autolink';
|
15685 | token.info = 'auto';
|
15686 | }
|
15687 |
|
15688 | state.pos += emailMatch[0].length;
|
15689 | return true;
|
15690 | }
|
15691 |
|
15692 | return false;
|
15693 | };
|
15694 |
|
15695 | },{}],66:[function(require,module,exports){
|
15696 | // Parse backticks
|
15697 |
|
15698 | 'use strict';
|
15699 |
|
15700 | module.exports = function backtick(state, silent) {
|
15701 | var start, max, marker, matchStart, matchEnd, token,
|
15702 | pos = state.pos,
|
15703 | ch = state.src.charCodeAt(pos);
|
15704 |
|
15705 | if (ch !== 0x60/* ` */) { return false; }
|
15706 |
|
15707 | start = pos;
|
15708 | pos++;
|
15709 | max = state.posMax;
|
15710 |
|
15711 | while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
|
15712 |
|
15713 | marker = state.src.slice(start, pos);
|
15714 |
|
15715 | matchStart = matchEnd = pos;
|
15716 |
|
15717 | while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
|
15718 | matchEnd = matchStart + 1;
|
15719 |
|
15720 | while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
|
15721 |
|
15722 | if (matchEnd - matchStart === marker.length) {
|
15723 | if (!silent) {
|
15724 | token = state.push('code_inline', 'code', 0);
|
15725 | token.markup = marker;
|
15726 | token.content = state.src.slice(pos, matchStart)
|
15727 | .replace(/[ \n]+/g, ' ')
|
15728 | .trim();
|
15729 | }
|
15730 | state.pos = matchEnd;
|
15731 | return true;
|
15732 | }
|
15733 | }
|
15734 |
|
15735 | if (!silent) { state.pending += marker; }
|
15736 | state.pos += marker.length;
|
15737 | return true;
|
15738 | };
|
15739 |
|
15740 | },{}],67:[function(require,module,exports){
|
15741 | // For each opening emphasis-like marker find a matching closing one
|
15742 | //
|
15743 | 'use strict';
|
15744 |
|
15745 |
|
15746 | module.exports = function link_pairs(state) {
|
15747 | var i, j, lastDelim, currDelim,
|
15748 | delimiters = state.delimiters,
|
15749 | max = state.delimiters.length;
|
15750 |
|
15751 | for (i = 0; i < max; i++) {
|
15752 | lastDelim = delimiters[i];
|
15753 |
|
15754 | if (!lastDelim.close) { continue; }
|
15755 |
|
15756 | j = i - lastDelim.jump - 1;
|
15757 |
|
15758 | while (j >= 0) {
|
15759 | currDelim = delimiters[j];
|
15760 |
|
15761 | if (currDelim.open &&
|
15762 | currDelim.marker === lastDelim.marker &&
|
15763 | currDelim.end < 0 &&
|
15764 | currDelim.level === lastDelim.level) {
|
15765 |
|
15766 | lastDelim.jump = i - j;
|
15767 | lastDelim.open = false;
|
15768 | currDelim.end = i;
|
15769 | currDelim.jump = 0;
|
15770 | break;
|
15771 | }
|
15772 |
|
15773 | j -= currDelim.jump + 1;
|
15774 | }
|
15775 | }
|
15776 | };
|
15777 |
|
15778 | },{}],68:[function(require,module,exports){
|
15779 | // Process *this* and _that_
|
15780 | //
|
15781 | 'use strict';
|
15782 |
|
15783 |
|
15784 | // Insert each marker as a separate text token, and add it to delimiter list
|
15785 | //
|
15786 | module.exports.tokenize = function emphasis(state, silent) {
|
15787 | var i, scanned, token,
|
15788 | start = state.pos,
|
15789 | marker = state.src.charCodeAt(start);
|
15790 |
|
15791 | if (silent) { return false; }
|
15792 |
|
15793 | if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
|
15794 |
|
15795 | scanned = state.scanDelims(state.pos, marker === 0x2A);
|
15796 |
|
15797 | for (i = 0; i < scanned.length; i++) {
|
15798 | token = state.push('text', '', 0);
|
15799 | token.content = String.fromCharCode(marker);
|
15800 |
|
15801 | state.delimiters.push({
|
15802 | // Char code of the starting marker (number).
|
15803 | //
|
15804 | marker: marker,
|
15805 |
|
15806 | // An amount of characters before this one that's equivalent to
|
15807 | // current one. In plain English: if this delimiter does not open
|
15808 | // an emphasis, neither do previous `jump` characters.
|
15809 | //
|
15810 | // Used to skip sequences like "*****" in one step, for 1st asterisk
|
15811 | // value will be 0, for 2nd it's 1 and so on.
|
15812 | //
|
15813 | jump: i,
|
15814 |
|
15815 | // A position of the token this delimiter corresponds to.
|
15816 | //
|
15817 | token: state.tokens.length - 1,
|
15818 |
|
15819 | // Token level.
|
15820 | //
|
15821 | level: state.level,
|
15822 |
|
15823 | // If this delimiter is matched as a valid opener, `end` will be
|
15824 | // equal to its position, otherwise it's `-1`.
|
15825 | //
|
15826 | end: -1,
|
15827 |
|
15828 | // Boolean flags that determine if this delimiter could open or close
|
15829 | // an emphasis.
|
15830 | //
|
15831 | open: scanned.can_open,
|
15832 | close: scanned.can_close
|
15833 | });
|
15834 | }
|
15835 |
|
15836 | state.pos += scanned.length;
|
15837 |
|
15838 | return true;
|
15839 | };
|
15840 |
|
15841 |
|
15842 | // Walk through delimiter list and replace text tokens with tags
|
15843 | //
|
15844 | module.exports.postProcess = function emphasis(state) {
|
15845 | var i,
|
15846 | startDelim,
|
15847 | endDelim,
|
15848 | token,
|
15849 | ch,
|
15850 | isStrong,
|
15851 | delimiters = state.delimiters,
|
15852 | max = state.delimiters.length;
|
15853 |
|
15854 | for (i = 0; i < max; i++) {
|
15855 | startDelim = delimiters[i];
|
15856 |
|
15857 | if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
|
15858 | continue;
|
15859 | }
|
15860 |
|
15861 | // Process only opening markers
|
15862 | if (startDelim.end === -1) {
|
15863 | continue;
|
15864 | }
|
15865 |
|
15866 | endDelim = delimiters[startDelim.end];
|
15867 |
|
15868 | // If the next delimiter has the same marker and is adjacent to this one,
|
15869 | // merge those into one strong delimiter.
|
15870 | //
|
15871 | // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`
|
15872 | //
|
15873 | isStrong = i + 1 < max &&
|
15874 | delimiters[i + 1].end === startDelim.end - 1 &&
|
15875 | delimiters[i + 1].token === startDelim.token + 1 &&
|
15876 | delimiters[startDelim.end - 1].token === endDelim.token - 1 &&
|
15877 | delimiters[i + 1].marker === startDelim.marker;
|
15878 |
|
15879 | ch = String.fromCharCode(startDelim.marker);
|
15880 |
|
15881 | token = state.tokens[startDelim.token];
|
15882 | token.type = isStrong ? 'strong_open' : 'em_open';
|
15883 | token.tag = isStrong ? 'strong' : 'em';
|
15884 | token.nesting = 1;
|
15885 | token.markup = isStrong ? ch + ch : ch;
|
15886 | token.content = '';
|
15887 |
|
15888 | token = state.tokens[endDelim.token];
|
15889 | token.type = isStrong ? 'strong_close' : 'em_close';
|
15890 | token.tag = isStrong ? 'strong' : 'em';
|
15891 | token.nesting = -1;
|
15892 | token.markup = isStrong ? ch + ch : ch;
|
15893 | token.content = '';
|
15894 |
|
15895 | if (isStrong) {
|
15896 | state.tokens[delimiters[i + 1].token].content = '';
|
15897 | state.tokens[delimiters[startDelim.end - 1].token].content = '';
|
15898 | i++;
|
15899 | }
|
15900 | }
|
15901 | };
|
15902 |
|
15903 | },{}],69:[function(require,module,exports){
|
15904 | // Process html entity - {, ¯, ", ...
|
15905 |
|
15906 | 'use strict';
|
15907 |
|
15908 | var entities = require('../common/entities');
|
15909 | var has = require('../common/utils').has;
|
15910 | var isValidEntityCode = require('../common/utils').isValidEntityCode;
|
15911 | var fromCodePoint = require('../common/utils').fromCodePoint;
|
15912 |
|
15913 |
|
15914 | var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;
|
15915 | var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
|
15916 |
|
15917 |
|
15918 | module.exports = function entity(state, silent) {
|
15919 | var ch, code, match, pos = state.pos, max = state.posMax;
|
15920 |
|
15921 | if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
|
15922 |
|
15923 | if (pos + 1 < max) {
|
15924 | ch = state.src.charCodeAt(pos + 1);
|
15925 |
|
15926 | if (ch === 0x23 /* # */) {
|
15927 | match = state.src.slice(pos).match(DIGITAL_RE);
|
15928 | if (match) {
|
15929 | if (!silent) {
|
15930 | code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
|
15931 | state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
|
15932 | }
|
15933 | state.pos += match[0].length;
|
15934 | return true;
|
15935 | }
|
15936 | } else {
|
15937 | match = state.src.slice(pos).match(NAMED_RE);
|
15938 | if (match) {
|
15939 | if (has(entities, match[1])) {
|
15940 | if (!silent) { state.pending += entities[match[1]]; }
|
15941 | state.pos += match[0].length;
|
15942 | return true;
|
15943 | }
|
15944 | }
|
15945 | }
|
15946 | }
|
15947 |
|
15948 | if (!silent) { state.pending += '&'; }
|
15949 | state.pos++;
|
15950 | return true;
|
15951 | };
|
15952 |
|
15953 | },{"../common/entities":29,"../common/utils":32}],70:[function(require,module,exports){
|
15954 | // Proceess escaped chars and hardbreaks
|
15955 |
|
15956 | 'use strict';
|
15957 |
|
15958 | var isSpace = require('../common/utils').isSpace;
|
15959 |
|
15960 | var ESCAPED = [];
|
15961 |
|
15962 | for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
|
15963 |
|
15964 | '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
|
15965 | .split('').forEach(function(ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
|
15966 |
|
15967 |
|
15968 | module.exports = function escape(state, silent) {
|
15969 | var ch, pos = state.pos, max = state.posMax;
|
15970 |
|
15971 | if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
|
15972 |
|
15973 | pos++;
|
15974 |
|
15975 | if (pos < max) {
|
15976 | ch = state.src.charCodeAt(pos);
|
15977 |
|
15978 | if (ch < 256 && ESCAPED[ch] !== 0) {
|
15979 | if (!silent) { state.pending += state.src[pos]; }
|
15980 | state.pos += 2;
|
15981 | return true;
|
15982 | }
|
15983 |
|
15984 | if (ch === 0x0A) {
|
15985 | if (!silent) {
|
15986 | state.push('hardbreak', 'br', 0);
|
15987 | }
|
15988 |
|
15989 | pos++;
|
15990 | // skip leading whitespaces from next line
|
15991 | while (pos < max) {
|
15992 | ch = state.src.charCodeAt(pos);
|
15993 | if (!isSpace(ch)) { break; }
|
15994 | pos++;
|
15995 | }
|
15996 |
|
15997 | state.pos = pos;
|
15998 | return true;
|
15999 | }
|
16000 | }
|
16001 |
|
16002 | if (!silent) { state.pending += '\\'; }
|
16003 | state.pos++;
|
16004 | return true;
|
16005 | };
|
16006 |
|
16007 | },{"../common/utils":32}],71:[function(require,module,exports){
|
16008 | // Process html tags
|
16009 |
|
16010 | 'use strict';
|
16011 |
|
16012 |
|
16013 | var HTML_TAG_RE = require('../common/html_re').HTML_TAG_RE;
|
16014 |
|
16015 |
|
16016 | function isLetter(ch) {
|
16017 | /*eslint no-bitwise:0*/
|
16018 | var lc = ch | 0x20; // to lower case
|
16019 | return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
|
16020 | }
|
16021 |
|
16022 |
|
16023 | module.exports = function html_inline(state, silent) {
|
16024 | var ch, match, max, token,
|
16025 | pos = state.pos;
|
16026 |
|
16027 | if (!state.md.options.html) { return false; }
|
16028 |
|
16029 | // Check start
|
16030 | max = state.posMax;
|
16031 | if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
|
16032 | pos + 2 >= max) {
|
16033 | return false;
|
16034 | }
|
16035 |
|
16036 | // Quick fail on second char
|
16037 | ch = state.src.charCodeAt(pos + 1);
|
16038 | if (ch !== 0x21/* ! */ &&
|
16039 | ch !== 0x3F/* ? */ &&
|
16040 | ch !== 0x2F/* / */ &&
|
16041 | !isLetter(ch)) {
|
16042 | return false;
|
16043 | }
|
16044 |
|
16045 | match = state.src.slice(pos).match(HTML_TAG_RE);
|
16046 | if (!match) { return false; }
|
16047 |
|
16048 | if (!silent) {
|
16049 | token = state.push('html_inline', '', 0);
|
16050 | token.content = state.src.slice(pos, pos + match[0].length);
|
16051 | }
|
16052 | state.pos += match[0].length;
|
16053 | return true;
|
16054 | };
|
16055 |
|
16056 | },{"../common/html_re":31}],72:[function(require,module,exports){
|
16057 | // Process ![image](<src> "title")
|
16058 |
|
16059 | 'use strict';
|
16060 |
|
16061 | var parseLinkLabel = require('../helpers/parse_link_label');
|
16062 | var parseLinkDestination = require('../helpers/parse_link_destination');
|
16063 | var parseLinkTitle = require('../helpers/parse_link_title');
|
16064 | var normalizeReference = require('../common/utils').normalizeReference;
|
16065 | var isSpace = require('../common/utils').isSpace;
|
16066 |
|
16067 |
|
16068 | module.exports = function image(state, silent) {
|
16069 | var attrs,
|
16070 | code,
|
16071 | content,
|
16072 | label,
|
16073 | labelEnd,
|
16074 | labelStart,
|
16075 | pos,
|
16076 | ref,
|
16077 | res,
|
16078 | title,
|
16079 | token,
|
16080 | tokens,
|
16081 | start,
|
16082 | href = '',
|
16083 | oldPos = state.pos,
|
16084 | max = state.posMax;
|
16085 |
|
16086 | if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
|
16087 | if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
|
16088 |
|
16089 | labelStart = state.pos + 2;
|
16090 | labelEnd = parseLinkLabel(state, state.pos + 1, false);
|
16091 |
|
16092 | // parser failed to find ']', so it's not a valid link
|
16093 | if (labelEnd < 0) { return false; }
|
16094 |
|
16095 | pos = labelEnd + 1;
|
16096 | if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
|
16097 | //
|
16098 | // Inline link
|
16099 | //
|
16100 |
|
16101 | // [link]( <href> "title" )
|
16102 | // ^^ skipping these spaces
|
16103 | pos++;
|
16104 | for (; pos < max; pos++) {
|
16105 | code = state.src.charCodeAt(pos);
|
16106 | if (!isSpace(code) && code !== 0x0A) { break; }
|
16107 | }
|
16108 | if (pos >= max) { return false; }
|
16109 |
|
16110 | // [link]( <href> "title" )
|
16111 | // ^^^^^^ parsing link destination
|
16112 | start = pos;
|
16113 | res = parseLinkDestination(state.src, pos, state.posMax);
|
16114 | if (res.ok) {
|
16115 | href = state.md.normalizeLink(res.str);
|
16116 | if (state.md.validateLink(href)) {
|
16117 | pos = res.pos;
|
16118 | } else {
|
16119 | href = '';
|
16120 | }
|
16121 | }
|
16122 |
|
16123 | // [link]( <href> "title" )
|
16124 | // ^^ skipping these spaces
|
16125 | start = pos;
|
16126 | for (; pos < max; pos++) {
|
16127 | code = state.src.charCodeAt(pos);
|
16128 | if (!isSpace(code) && code !== 0x0A) { break; }
|
16129 | }
|
16130 |
|
16131 | // [link]( <href> "title" )
|
16132 | // ^^^^^^^ parsing link title
|
16133 | res = parseLinkTitle(state.src, pos, state.posMax);
|
16134 | if (pos < max && start !== pos && res.ok) {
|
16135 | title = res.str;
|
16136 | pos = res.pos;
|
16137 |
|
16138 | // [link]( <href> "title" )
|
16139 | // ^^ skipping these spaces
|
16140 | for (; pos < max; pos++) {
|
16141 | code = state.src.charCodeAt(pos);
|
16142 | if (!isSpace(code) && code !== 0x0A) { break; }
|
16143 | }
|
16144 | } else {
|
16145 | title = '';
|
16146 | }
|
16147 |
|
16148 | if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
|
16149 | state.pos = oldPos;
|
16150 | return false;
|
16151 | }
|
16152 | pos++;
|
16153 | } else {
|
16154 | //
|
16155 | // Link reference
|
16156 | //
|
16157 | if (typeof state.env.references === 'undefined') { return false; }
|
16158 |
|
16159 | if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
|
16160 | start = pos + 1;
|
16161 | pos = parseLinkLabel(state, pos);
|
16162 | if (pos >= 0) {
|
16163 | label = state.src.slice(start, pos++);
|
16164 | } else {
|
16165 | pos = labelEnd + 1;
|
16166 | }
|
16167 | } else {
|
16168 | pos = labelEnd + 1;
|
16169 | }
|
16170 |
|
16171 | // covers label === '' and label === undefined
|
16172 | // (collapsed reference link and shortcut reference link respectively)
|
16173 | if (!label) { label = state.src.slice(labelStart, labelEnd); }
|
16174 |
|
16175 | ref = state.env.references[normalizeReference(label)];
|
16176 | if (!ref) {
|
16177 | state.pos = oldPos;
|
16178 | return false;
|
16179 | }
|
16180 | href = ref.href;
|
16181 | title = ref.title;
|
16182 | }
|
16183 |
|
16184 | //
|
16185 | // We found the end of the link, and know for a fact it's a valid link;
|
16186 | // so all that's left to do is to call tokenizer.
|
16187 | //
|
16188 | if (!silent) {
|
16189 | content = state.src.slice(labelStart, labelEnd);
|
16190 |
|
16191 | state.md.inline.parse(
|
16192 | content,
|
16193 | state.md,
|
16194 | state.env,
|
16195 | tokens = []
|
16196 | );
|
16197 |
|
16198 | token = state.push('image', 'img', 0);
|
16199 | token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
|
16200 | token.children = tokens;
|
16201 | token.content = content;
|
16202 |
|
16203 | if (title) {
|
16204 | attrs.push([ 'title', title ]);
|
16205 | }
|
16206 | }
|
16207 |
|
16208 | state.pos = pos;
|
16209 | state.posMax = max;
|
16210 | return true;
|
16211 | };
|
16212 |
|
16213 | },{"../common/utils":32,"../helpers/parse_link_destination":34,"../helpers/parse_link_label":35,"../helpers/parse_link_title":36}],73:[function(require,module,exports){
|
16214 | // Process [link](<to> "stuff")
|
16215 |
|
16216 | 'use strict';
|
16217 |
|
16218 | var parseLinkLabel = require('../helpers/parse_link_label');
|
16219 | var parseLinkDestination = require('../helpers/parse_link_destination');
|
16220 | var parseLinkTitle = require('../helpers/parse_link_title');
|
16221 | var normalizeReference = require('../common/utils').normalizeReference;
|
16222 | var isSpace = require('../common/utils').isSpace;
|
16223 |
|
16224 |
|
16225 | module.exports = function link(state, silent) {
|
16226 | var attrs,
|
16227 | code,
|
16228 | label,
|
16229 | labelEnd,
|
16230 | labelStart,
|
16231 | pos,
|
16232 | res,
|
16233 | ref,
|
16234 | title,
|
16235 | token,
|
16236 | href = '',
|
16237 | oldPos = state.pos,
|
16238 | max = state.posMax,
|
16239 | start = state.pos;
|
16240 |
|
16241 | if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
|
16242 |
|
16243 | labelStart = state.pos + 1;
|
16244 | labelEnd = parseLinkLabel(state, state.pos, true);
|
16245 |
|
16246 | // parser failed to find ']', so it's not a valid link
|
16247 | if (labelEnd < 0) { return false; }
|
16248 |
|
16249 | pos = labelEnd + 1;
|
16250 | if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
|
16251 | //
|
16252 | // Inline link
|
16253 | //
|
16254 |
|
16255 | // [link]( <href> "title" )
|
16256 | // ^^ skipping these spaces
|
16257 | pos++;
|
16258 | for (; pos < max; pos++) {
|
16259 | code = state.src.charCodeAt(pos);
|
16260 | if (!isSpace(code) && code !== 0x0A) { break; }
|
16261 | }
|
16262 | if (pos >= max) { return false; }
|
16263 |
|
16264 | // [link]( <href> "title" )
|
16265 | // ^^^^^^ parsing link destination
|
16266 | start = pos;
|
16267 | res = parseLinkDestination(state.src, pos, state.posMax);
|
16268 | if (res.ok) {
|
16269 | href = state.md.normalizeLink(res.str);
|
16270 | if (state.md.validateLink(href)) {
|
16271 | pos = res.pos;
|
16272 | } else {
|
16273 | href = '';
|
16274 | }
|
16275 | }
|
16276 |
|
16277 | // [link]( <href> "title" )
|
16278 | // ^^ skipping these spaces
|
16279 | start = pos;
|
16280 | for (; pos < max; pos++) {
|
16281 | code = state.src.charCodeAt(pos);
|
16282 | if (!isSpace(code) && code !== 0x0A) { break; }
|
16283 | }
|
16284 |
|
16285 | // [link]( <href> "title" )
|
16286 | // ^^^^^^^ parsing link title
|
16287 | res = parseLinkTitle(state.src, pos, state.posMax);
|
16288 | if (pos < max && start !== pos && res.ok) {
|
16289 | title = res.str;
|
16290 | pos = res.pos;
|
16291 |
|
16292 | // [link]( <href> "title" )
|
16293 | // ^^ skipping these spaces
|
16294 | for (; pos < max; pos++) {
|
16295 | code = state.src.charCodeAt(pos);
|
16296 | if (!isSpace(code) && code !== 0x0A) { break; }
|
16297 | }
|
16298 | } else {
|
16299 | title = '';
|
16300 | }
|
16301 |
|
16302 | if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
|
16303 | state.pos = oldPos;
|
16304 | return false;
|
16305 | }
|
16306 | pos++;
|
16307 | } else {
|
16308 | //
|
16309 | // Link reference
|
16310 | //
|
16311 | if (typeof state.env.references === 'undefined') { return false; }
|
16312 |
|
16313 | if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
|
16314 | start = pos + 1;
|
16315 | pos = parseLinkLabel(state, pos);
|
16316 | if (pos >= 0) {
|
16317 | label = state.src.slice(start, pos++);
|
16318 | } else {
|
16319 | pos = labelEnd + 1;
|
16320 | }
|
16321 | } else {
|
16322 | pos = labelEnd + 1;
|
16323 | }
|
16324 |
|
16325 | // covers label === '' and label === undefined
|
16326 | // (collapsed reference link and shortcut reference link respectively)
|
16327 | if (!label) { label = state.src.slice(labelStart, labelEnd); }
|
16328 |
|
16329 | ref = state.env.references[normalizeReference(label)];
|
16330 | if (!ref) {
|
16331 | state.pos = oldPos;
|
16332 | return false;
|
16333 | }
|
16334 | href = ref.href;
|
16335 | title = ref.title;
|
16336 | }
|
16337 |
|
16338 | //
|
16339 | // We found the end of the link, and know for a fact it's a valid link;
|
16340 | // so all that's left to do is to call tokenizer.
|
16341 | //
|
16342 | if (!silent) {
|
16343 | state.pos = labelStart;
|
16344 | state.posMax = labelEnd;
|
16345 |
|
16346 | token = state.push('link_open', 'a', 1);
|
16347 | token.attrs = attrs = [ [ 'href', href ] ];
|
16348 | if (title) {
|
16349 | attrs.push([ 'title', title ]);
|
16350 | }
|
16351 |
|
16352 | state.md.inline.tokenize(state);
|
16353 |
|
16354 | token = state.push('link_close', 'a', -1);
|
16355 | }
|
16356 |
|
16357 | state.pos = pos;
|
16358 | state.posMax = max;
|
16359 | return true;
|
16360 | };
|
16361 |
|
16362 | },{"../common/utils":32,"../helpers/parse_link_destination":34,"../helpers/parse_link_label":35,"../helpers/parse_link_title":36}],74:[function(require,module,exports){
|
16363 | // Proceess '\n'
|
16364 |
|
16365 | 'use strict';
|
16366 |
|
16367 | module.exports = function newline(state, silent) {
|
16368 | var pmax, max, pos = state.pos;
|
16369 |
|
16370 | if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
|
16371 |
|
16372 | pmax = state.pending.length - 1;
|
16373 | max = state.posMax;
|
16374 |
|
16375 | // ' \n' -> hardbreak
|
16376 | // Lookup in pending chars is bad practice! Don't copy to other rules!
|
16377 | // Pending string is stored in concat mode, indexed lookups will cause
|
16378 | // convertion to flat mode.
|
16379 | if (!silent) {
|
16380 | if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
|
16381 | if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
|
16382 | state.pending = state.pending.replace(/ +$/, '');
|
16383 | state.push('hardbreak', 'br', 0);
|
16384 | } else {
|
16385 | state.pending = state.pending.slice(0, -1);
|
16386 | state.push('softbreak', 'br', 0);
|
16387 | }
|
16388 |
|
16389 | } else {
|
16390 | state.push('softbreak', 'br', 0);
|
16391 | }
|
16392 | }
|
16393 |
|
16394 | pos++;
|
16395 |
|
16396 | // skip heading spaces for next line
|
16397 | while (pos < max && state.src.charCodeAt(pos) === 0x20) { pos++; }
|
16398 |
|
16399 | state.pos = pos;
|
16400 | return true;
|
16401 | };
|
16402 |
|
16403 | },{}],75:[function(require,module,exports){
|
16404 | // Inline parser state
|
16405 |
|
16406 | 'use strict';
|
16407 |
|
16408 |
|
16409 | var Token = require('../token');
|
16410 | var isWhiteSpace = require('../common/utils').isWhiteSpace;
|
16411 | var isPunctChar = require('../common/utils').isPunctChar;
|
16412 | var isMdAsciiPunct = require('../common/utils').isMdAsciiPunct;
|
16413 |
|
16414 |
|
16415 | function StateInline(src, md, env, outTokens) {
|
16416 | this.src = src;
|
16417 | this.env = env;
|
16418 | this.md = md;
|
16419 | this.tokens = outTokens;
|
16420 |
|
16421 | this.pos = 0;
|
16422 | this.posMax = this.src.length;
|
16423 | this.level = 0;
|
16424 | this.pending = '';
|
16425 | this.pendingLevel = 0;
|
16426 |
|
16427 | this.cache = {}; // Stores { start: end } pairs. Useful for backtrack
|
16428 | // optimization of pairs parse (emphasis, strikes).
|
16429 |
|
16430 | this.delimiters = []; // Emphasis-like delimiters
|
16431 | }
|
16432 |
|
16433 |
|
16434 | // Flush pending text
|
16435 | //
|
16436 | StateInline.prototype.pushPending = function () {
|
16437 | var token = new Token('text', '', 0);
|
16438 | token.content = this.pending;
|
16439 | token.level = this.pendingLevel;
|
16440 | this.tokens.push(token);
|
16441 | this.pending = '';
|
16442 | return token;
|
16443 | };
|
16444 |
|
16445 |
|
16446 | // Push new token to "stream".
|
16447 | // If pending text exists - flush it as text token
|
16448 | //
|
16449 | StateInline.prototype.push = function (type, tag, nesting) {
|
16450 | if (this.pending) {
|
16451 | this.pushPending();
|
16452 | }
|
16453 |
|
16454 | var token = new Token(type, tag, nesting);
|
16455 |
|
16456 | if (nesting < 0) { this.level--; }
|
16457 | token.level = this.level;
|
16458 | if (nesting > 0) { this.level++; }
|
16459 |
|
16460 | this.pendingLevel = this.level;
|
16461 | this.tokens.push(token);
|
16462 | return token;
|
16463 | };
|
16464 |
|
16465 |
|
16466 | // Scan a sequence of emphasis-like markers, and determine whether
|
16467 | // it can start an emphasis sequence or end an emphasis sequence.
|
16468 | //
|
16469 | // - start - position to scan from (it should point at a valid marker);
|
16470 | // - canSplitWord - determine if these markers can be found inside a word
|
16471 | //
|
16472 | StateInline.prototype.scanDelims = function (start, canSplitWord) {
|
16473 | var pos = start, lastChar, nextChar, count, can_open, can_close,
|
16474 | isLastWhiteSpace, isLastPunctChar,
|
16475 | isNextWhiteSpace, isNextPunctChar,
|
16476 | left_flanking = true,
|
16477 | right_flanking = true,
|
16478 | max = this.posMax,
|
16479 | marker = this.src.charCodeAt(start);
|
16480 |
|
16481 | // treat beginning of the line as a whitespace
|
16482 | lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
|
16483 |
|
16484 | while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
|
16485 |
|
16486 | count = pos - start;
|
16487 |
|
16488 | // treat end of the line as a whitespace
|
16489 | nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
|
16490 |
|
16491 | isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
|
16492 | isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
|
16493 |
|
16494 | isLastWhiteSpace = isWhiteSpace(lastChar);
|
16495 | isNextWhiteSpace = isWhiteSpace(nextChar);
|
16496 |
|
16497 | if (isNextWhiteSpace) {
|
16498 | left_flanking = false;
|
16499 | } else if (isNextPunctChar) {
|
16500 | if (!(isLastWhiteSpace || isLastPunctChar)) {
|
16501 | left_flanking = false;
|
16502 | }
|
16503 | }
|
16504 |
|
16505 | if (isLastWhiteSpace) {
|
16506 | right_flanking = false;
|
16507 | } else if (isLastPunctChar) {
|
16508 | if (!(isNextWhiteSpace || isNextPunctChar)) {
|
16509 | right_flanking = false;
|
16510 | }
|
16511 | }
|
16512 |
|
16513 | if (!canSplitWord) {
|
16514 | can_open = left_flanking && (!right_flanking || isLastPunctChar);
|
16515 | can_close = right_flanking && (!left_flanking || isNextPunctChar);
|
16516 | } else {
|
16517 | can_open = left_flanking;
|
16518 | can_close = right_flanking;
|
16519 | }
|
16520 |
|
16521 | return {
|
16522 | can_open: can_open,
|
16523 | can_close: can_close,
|
16524 | length: count
|
16525 | };
|
16526 | };
|
16527 |
|
16528 |
|
16529 | // re-export Token class to use in block rules
|
16530 | StateInline.prototype.Token = Token;
|
16531 |
|
16532 |
|
16533 | module.exports = StateInline;
|
16534 |
|
16535 | },{"../common/utils":32,"../token":79}],76:[function(require,module,exports){
|
16536 | // ~~strike through~~
|
16537 | //
|
16538 | 'use strict';
|
16539 |
|
16540 |
|
16541 | // Insert each marker as a separate text token, and add it to delimiter list
|
16542 | //
|
16543 | module.exports.tokenize = function strikethrough(state, silent) {
|
16544 | var i, scanned, token, len, ch,
|
16545 | start = state.pos,
|
16546 | marker = state.src.charCodeAt(start);
|
16547 |
|
16548 | if (silent) { return false; }
|
16549 |
|
16550 | if (marker !== 0x7E/* ~ */) { return false; }
|
16551 |
|
16552 | scanned = state.scanDelims(state.pos, true);
|
16553 | len = scanned.length;
|
16554 | ch = String.fromCharCode(marker);
|
16555 |
|
16556 | if (len < 2) { return false; }
|
16557 |
|
16558 | if (len % 2) {
|
16559 | token = state.push('text', '', 0);
|
16560 | token.content = ch;
|
16561 | len--;
|
16562 | }
|
16563 |
|
16564 | for (i = 0; i < len; i += 2) {
|
16565 | token = state.push('text', '', 0);
|
16566 | token.content = ch + ch;
|
16567 |
|
16568 | state.delimiters.push({
|
16569 | marker: marker,
|
16570 | jump: i,
|
16571 | token: state.tokens.length - 1,
|
16572 | level: state.level,
|
16573 | end: -1,
|
16574 | open: scanned.can_open,
|
16575 | close: scanned.can_close
|
16576 | });
|
16577 | }
|
16578 |
|
16579 | state.pos += scanned.length;
|
16580 |
|
16581 | return true;
|
16582 | };
|
16583 |
|
16584 |
|
16585 | // Walk through delimiter list and replace text tokens with tags
|
16586 | //
|
16587 | module.exports.postProcess = function strikethrough(state) {
|
16588 | var i, j,
|
16589 | startDelim,
|
16590 | endDelim,
|
16591 | token,
|
16592 | loneMarkers = [],
|
16593 | delimiters = state.delimiters,
|
16594 | max = state.delimiters.length;
|
16595 |
|
16596 | for (i = 0; i < max; i++) {
|
16597 | startDelim = delimiters[i];
|
16598 |
|
16599 | if (startDelim.marker !== 0x7E/* ~ */) {
|
16600 | continue;
|
16601 | }
|
16602 |
|
16603 | if (startDelim.end === -1) {
|
16604 | continue;
|
16605 | }
|
16606 |
|
16607 | endDelim = delimiters[startDelim.end];
|
16608 |
|
16609 | token = state.tokens[startDelim.token];
|
16610 | token.type = 's_open';
|
16611 | token.tag = 's';
|
16612 | token.nesting = 1;
|
16613 | token.markup = '~~';
|
16614 | token.content = '';
|
16615 |
|
16616 | token = state.tokens[endDelim.token];
|
16617 | token.type = 's_close';
|
16618 | token.tag = 's';
|
16619 | token.nesting = -1;
|
16620 | token.markup = '~~';
|
16621 | token.content = '';
|
16622 |
|
16623 | if (state.tokens[endDelim.token - 1].type === 'text' &&
|
16624 | state.tokens[endDelim.token - 1].content === '~') {
|
16625 |
|
16626 | loneMarkers.push(endDelim.token - 1);
|
16627 | }
|
16628 | }
|
16629 |
|
16630 | // If a marker sequence has an odd number of characters, it's splitted
|
16631 | // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
|
16632 | // start of the sequence.
|
16633 | //
|
16634 | // So, we have to move all those markers after subsequent s_close tags.
|
16635 | //
|
16636 | while (loneMarkers.length) {
|
16637 | i = loneMarkers.pop();
|
16638 | j = i + 1;
|
16639 |
|
16640 | while (j < state.tokens.length && state.tokens[j].type === 's_close') {
|
16641 | j++;
|
16642 | }
|
16643 |
|
16644 | j--;
|
16645 |
|
16646 | if (i !== j) {
|
16647 | token = state.tokens[j];
|
16648 | state.tokens[j] = state.tokens[i];
|
16649 | state.tokens[i] = token;
|
16650 | }
|
16651 | }
|
16652 | };
|
16653 |
|
16654 | },{}],77:[function(require,module,exports){
|
16655 | // Skip text characters for text token, place those to pending buffer
|
16656 | // and increment current pos
|
16657 |
|
16658 | 'use strict';
|
16659 |
|
16660 |
|
16661 | // Rule to skip pure text
|
16662 | // '{}$%@~+=:' reserved for extentions
|
16663 |
|
16664 | // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
|
16665 |
|
16666 | // !!!! Don't confuse with "Markdown ASCII Punctuation" chars
|
16667 | // http://spec.commonmark.org/0.15/#ascii-punctuation-character
|
16668 | function isTerminatorChar(ch) {
|
16669 | switch (ch) {
|
16670 | case 0x0A/* \n */:
|
16671 | case 0x21/* ! */:
|
16672 | case 0x23/* # */:
|
16673 | case 0x24/* $ */:
|
16674 | case 0x25/* % */:
|
16675 | case 0x26/* & */:
|
16676 | case 0x2A/* * */:
|
16677 | case 0x2B/* + */:
|
16678 | case 0x2D/* - */:
|
16679 | case 0x3A/* : */:
|
16680 | case 0x3C/* < */:
|
16681 | case 0x3D/* = */:
|
16682 | case 0x3E/* > */:
|
16683 | case 0x40/* @ */:
|
16684 | case 0x5B/* [ */:
|
16685 | case 0x5C/* \ */:
|
16686 | case 0x5D/* ] */:
|
16687 | case 0x5E/* ^ */:
|
16688 | case 0x5F/* _ */:
|
16689 | case 0x60/* ` */:
|
16690 | case 0x7B/* { */:
|
16691 | case 0x7D/* } */:
|
16692 | case 0x7E/* ~ */:
|
16693 | return true;
|
16694 | default:
|
16695 | return false;
|
16696 | }
|
16697 | }
|
16698 |
|
16699 | module.exports = function text(state, silent) {
|
16700 | var pos = state.pos;
|
16701 |
|
16702 | while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
|
16703 | pos++;
|
16704 | }
|
16705 |
|
16706 | if (pos === state.pos) { return false; }
|
16707 |
|
16708 | if (!silent) { state.pending += state.src.slice(state.pos, pos); }
|
16709 |
|
16710 | state.pos = pos;
|
16711 |
|
16712 | return true;
|
16713 | };
|
16714 |
|
16715 | // Alternative implementation, for memory.
|
16716 | //
|
16717 | // It costs 10% of performance, but allows extend terminators list, if place it
|
16718 | // to `ParcerInline` property. Probably, will switch to it sometime, such
|
16719 | // flexibility required.
|
16720 |
|
16721 | /*
|
16722 | var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
|
16723 |
|
16724 | module.exports = function text(state, silent) {
|
16725 | var pos = state.pos,
|
16726 | idx = state.src.slice(pos).search(TERMINATOR_RE);
|
16727 |
|
16728 | // first char is terminator -> empty text
|
16729 | if (idx === 0) { return false; }
|
16730 |
|
16731 | // no terminator -> text till end of string
|
16732 | if (idx < 0) {
|
16733 | if (!silent) { state.pending += state.src.slice(pos); }
|
16734 | state.pos = state.src.length;
|
16735 | return true;
|
16736 | }
|
16737 |
|
16738 | if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
|
16739 |
|
16740 | state.pos += idx;
|
16741 |
|
16742 | return true;
|
16743 | };*/
|
16744 |
|
16745 | },{}],78:[function(require,module,exports){
|
16746 | // Merge adjacent text nodes into one, and re-calculate all token levels
|
16747 | //
|
16748 | 'use strict';
|
16749 |
|
16750 |
|
16751 | module.exports = function text_collapse(state) {
|
16752 | var curr, last,
|
16753 | level = 0,
|
16754 | tokens = state.tokens,
|
16755 | max = state.tokens.length;
|
16756 |
|
16757 | for (curr = last = 0; curr < max; curr++) {
|
16758 | // re-calculate levels
|
16759 | level += tokens[curr].nesting;
|
16760 | tokens[curr].level = level;
|
16761 |
|
16762 | if (tokens[curr].type === 'text' &&
|
16763 | curr + 1 < max &&
|
16764 | tokens[curr + 1].type === 'text') {
|
16765 |
|
16766 | // collapse two adjacent text nodes
|
16767 | tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
|
16768 | } else {
|
16769 | if (curr !== last) { tokens[last] = tokens[curr]; }
|
16770 |
|
16771 | last++;
|
16772 | }
|
16773 | }
|
16774 |
|
16775 | if (curr !== last) {
|
16776 | tokens.length = last;
|
16777 | }
|
16778 | };
|
16779 |
|
16780 | },{}],79:[function(require,module,exports){
|
16781 | // Token class
|
16782 |
|
16783 | 'use strict';
|
16784 |
|
16785 |
|
16786 | /**
|
16787 | * class Token
|
16788 | **/
|
16789 |
|
16790 | /**
|
16791 | * new Token(type, tag, nesting)
|
16792 | *
|
16793 | * Create new token and fill passed properties.
|
16794 | **/
|
16795 | function Token(type, tag, nesting) {
|
16796 | /**
|
16797 | * Token#type -> String
|
16798 | *
|
16799 | * Type of the token (string, e.g. "paragraph_open")
|
16800 | **/
|
16801 | this.type = type;
|
16802 |
|
16803 | /**
|
16804 | * Token#tag -> String
|
16805 | *
|
16806 | * html tag name, e.g. "p"
|
16807 | **/
|
16808 | this.tag = tag;
|
16809 |
|
16810 | /**
|
16811 | * Token#attrs -> Array
|
16812 | *
|
16813 | * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
|
16814 | **/
|
16815 | this.attrs = null;
|
16816 |
|
16817 | /**
|
16818 | * Token#map -> Array
|
16819 | *
|
16820 | * Source map info. Format: `[ line_begin, line_end ]`
|
16821 | **/
|
16822 | this.map = null;
|
16823 |
|
16824 | /**
|
16825 | * Token#nesting -> Number
|
16826 | *
|
16827 | * Level change (number in {-1, 0, 1} set), where:
|
16828 | *
|
16829 | * - `1` means the tag is opening
|
16830 | * - `0` means the tag is self-closing
|
16831 | * - `-1` means the tag is closing
|
16832 | **/
|
16833 | this.nesting = nesting;
|
16834 |
|
16835 | /**
|
16836 | * Token#level -> Number
|
16837 | *
|
16838 | * nesting level, the same as `state.level`
|
16839 | **/
|
16840 | this.level = 0;
|
16841 |
|
16842 | /**
|
16843 | * Token#children -> Array
|
16844 | *
|
16845 | * An array of child nodes (inline and img tokens)
|
16846 | **/
|
16847 | this.children = null;
|
16848 |
|
16849 | /**
|
16850 | * Token#content -> String
|
16851 | *
|
16852 | * In a case of self-closing tag (code, html, fence, etc.),
|
16853 | * it has contents of this tag.
|
16854 | **/
|
16855 | this.content = '';
|
16856 |
|
16857 | /**
|
16858 | * Token#markup -> String
|
16859 | *
|
16860 | * '*' or '_' for emphasis, fence string for fence, etc.
|
16861 | **/
|
16862 | this.markup = '';
|
16863 |
|
16864 | /**
|
16865 | * Token#info -> String
|
16866 | *
|
16867 | * fence infostring
|
16868 | **/
|
16869 | this.info = '';
|
16870 |
|
16871 | /**
|
16872 | * Token#meta -> Object
|
16873 | *
|
16874 | * A place for plugins to store an arbitrary data
|
16875 | **/
|
16876 | this.meta = null;
|
16877 |
|
16878 | /**
|
16879 | * Token#block -> Boolean
|
16880 | *
|
16881 | * True for block-level tokens, false for inline tokens.
|
16882 | * Used in renderer to calculate line breaks
|
16883 | **/
|
16884 | this.block = false;
|
16885 |
|
16886 | /**
|
16887 | * Token#hidden -> Boolean
|
16888 | *
|
16889 | * If it's true, ignore this element when rendering. Used for tight lists
|
16890 | * to hide paragraphs.
|
16891 | **/
|
16892 | this.hidden = false;
|
16893 | }
|
16894 |
|
16895 |
|
16896 | /**
|
16897 | * Token.attrIndex(name) -> Number
|
16898 | *
|
16899 | * Search attribute index by name.
|
16900 | **/
|
16901 | Token.prototype.attrIndex = function attrIndex(name) {
|
16902 | var attrs, i, len;
|
16903 |
|
16904 | if (!this.attrs) { return -1; }
|
16905 |
|
16906 | attrs = this.attrs;
|
16907 |
|
16908 | for (i = 0, len = attrs.length; i < len; i++) {
|
16909 | if (attrs[i][0] === name) { return i; }
|
16910 | }
|
16911 | return -1;
|
16912 | };
|
16913 |
|
16914 |
|
16915 | /**
|
16916 | * Token.attrPush(attrData)
|
16917 | *
|
16918 | * Add `[ name, value ]` attribute to list. Init attrs if necessary
|
16919 | **/
|
16920 | Token.prototype.attrPush = function attrPush(attrData) {
|
16921 | if (this.attrs) {
|
16922 | this.attrs.push(attrData);
|
16923 | } else {
|
16924 | this.attrs = [ attrData ];
|
16925 | }
|
16926 | };
|
16927 |
|
16928 |
|
16929 | /**
|
16930 | * Token.attrSet(name, value)
|
16931 | *
|
16932 | * Set `name` attribute to `value`. Override old value if exists.
|
16933 | **/
|
16934 | Token.prototype.attrSet = function attrSet(name, value) {
|
16935 | var idx = this.attrIndex(name),
|
16936 | attrData = [ name, value ];
|
16937 |
|
16938 | if (idx < 0) {
|
16939 | this.attrPush(attrData);
|
16940 | } else {
|
16941 | this.attrs[idx] = attrData;
|
16942 | }
|
16943 | };
|
16944 |
|
16945 |
|
16946 | /**
|
16947 | * Token.attrJoin(name, value)
|
16948 | *
|
16949 | * Join value to existing attribute via space. Or create new attribute if not
|
16950 | * exists. Useful to operate with token classes.
|
16951 | **/
|
16952 | Token.prototype.attrJoin = function attrJoin(name, value) {
|
16953 | var idx = this.attrIndex(name);
|
16954 |
|
16955 | if (idx < 0) {
|
16956 | this.attrPush([ name, value ]);
|
16957 | } else {
|
16958 | this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;
|
16959 | }
|
16960 | };
|
16961 |
|
16962 |
|
16963 | module.exports = Token;
|
16964 |
|
16965 | },{}],80:[function(require,module,exports){
|
16966 | /** @flow */
|
16967 |
|
16968 | "use strict";
|
16969 |
|
16970 | function getRelocatable(re) {
|
16971 | // In the future, this could use a WeakMap instead of an expando.
|
16972 | if (!re.__matchAtRelocatable) {
|
16973 | // Disjunctions are the lowest-precedence operator, so we can make any
|
16974 | // pattern match the empty string by appending `|()` to it:
|
16975 | // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-patterns
|
16976 | var source = re.source + "|()";
|
16977 |
|
16978 | // We always make the new regex global.
|
16979 | var flags = "g" + (re.ignoreCase ? "i" : "") + (re.multiline ? "m" : "") + (re.unicode ? "u" : "")
|
16980 | // sticky (/.../y) doesn't make sense in conjunction with our relocation
|
16981 | // logic, so we ignore it here.
|
16982 | ;
|
16983 |
|
16984 | re.__matchAtRelocatable = new RegExp(source, flags);
|
16985 | }
|
16986 | return re.__matchAtRelocatable;
|
16987 | }
|
16988 |
|
16989 | function matchAt(re, str, pos) {
|
16990 | if (re.global || re.sticky) {
|
16991 | throw new Error("matchAt(...): Only non-global regexes are supported");
|
16992 | }
|
16993 | var reloc = getRelocatable(re);
|
16994 | reloc.lastIndex = pos;
|
16995 | var match = reloc.exec(str);
|
16996 | // Last capturing group is our sentinel that indicates whether the regex
|
16997 | // matched at the given location.
|
16998 | if (match[match.length - 1] == null) {
|
16999 | // Original regex matched.
|
17000 | match.length = match.length - 1;
|
17001 | return match;
|
17002 | } else {
|
17003 | return null;
|
17004 | }
|
17005 | }
|
17006 |
|
17007 | module.exports = matchAt;
|
17008 | },{}],81:[function(require,module,exports){
|
17009 |
|
17010 | 'use strict';
|
17011 |
|
17012 |
|
17013 | /* eslint-disable no-bitwise */
|
17014 |
|
17015 | var decodeCache = {};
|
17016 |
|
17017 | function getDecodeCache(exclude) {
|
17018 | var i, ch, cache = decodeCache[exclude];
|
17019 | if (cache) { return cache; }
|
17020 |
|
17021 | cache = decodeCache[exclude] = [];
|
17022 |
|
17023 | for (i = 0; i < 128; i++) {
|
17024 | ch = String.fromCharCode(i);
|
17025 | cache.push(ch);
|
17026 | }
|
17027 |
|
17028 | for (i = 0; i < exclude.length; i++) {
|
17029 | ch = exclude.charCodeAt(i);
|
17030 | cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
|
17031 | }
|
17032 |
|
17033 | return cache;
|
17034 | }
|
17035 |
|
17036 |
|
17037 | // Decode percent-encoded string.
|
17038 | //
|
17039 | function decode(string, exclude) {
|
17040 | var cache;
|
17041 |
|
17042 | if (typeof exclude !== 'string') {
|
17043 | exclude = decode.defaultChars;
|
17044 | }
|
17045 |
|
17046 | cache = getDecodeCache(exclude);
|
17047 |
|
17048 | return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
|
17049 | var i, l, b1, b2, b3, b4, chr,
|
17050 | result = '';
|
17051 |
|
17052 | for (i = 0, l = seq.length; i < l; i += 3) {
|
17053 | b1 = parseInt(seq.slice(i + 1, i + 3), 16);
|
17054 |
|
17055 | if (b1 < 0x80) {
|
17056 | result += cache[b1];
|
17057 | continue;
|
17058 | }
|
17059 |
|
17060 | if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
|
17061 | // 110xxxxx 10xxxxxx
|
17062 | b2 = parseInt(seq.slice(i + 4, i + 6), 16);
|
17063 |
|
17064 | if ((b2 & 0xC0) === 0x80) {
|
17065 | chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
|
17066 |
|
17067 | if (chr < 0x80) {
|
17068 | result += '\ufffd\ufffd';
|
17069 | } else {
|
17070 | result += String.fromCharCode(chr);
|
17071 | }
|
17072 |
|
17073 | i += 3;
|
17074 | continue;
|
17075 | }
|
17076 | }
|
17077 |
|
17078 | if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
|
17079 | // 1110xxxx 10xxxxxx 10xxxxxx
|
17080 | b2 = parseInt(seq.slice(i + 4, i + 6), 16);
|
17081 | b3 = parseInt(seq.slice(i + 7, i + 9), 16);
|
17082 |
|
17083 | if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
|
17084 | chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
|
17085 |
|
17086 | if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
|
17087 | result += '\ufffd\ufffd\ufffd';
|
17088 | } else {
|
17089 | result += String.fromCharCode(chr);
|
17090 | }
|
17091 |
|
17092 | i += 6;
|
17093 | continue;
|
17094 | }
|
17095 | }
|
17096 |
|
17097 | if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
|
17098 | // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
|
17099 | b2 = parseInt(seq.slice(i + 4, i + 6), 16);
|
17100 | b3 = parseInt(seq.slice(i + 7, i + 9), 16);
|
17101 | b4 = parseInt(seq.slice(i + 10, i + 12), 16);
|
17102 |
|
17103 | if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
|
17104 | chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
|
17105 |
|
17106 | if (chr < 0x10000 || chr > 0x10FFFF) {
|
17107 | result += '\ufffd\ufffd\ufffd\ufffd';
|
17108 | } else {
|
17109 | chr -= 0x10000;
|
17110 | result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
|
17111 | }
|
17112 |
|
17113 | i += 9;
|
17114 | continue;
|
17115 | }
|
17116 | }
|
17117 |
|
17118 | result += '\ufffd';
|
17119 | }
|
17120 |
|
17121 | return result;
|
17122 | });
|
17123 | }
|
17124 |
|
17125 |
|
17126 | decode.defaultChars = ';/?:@&=+$,#';
|
17127 | decode.componentChars = '';
|
17128 |
|
17129 |
|
17130 | module.exports = decode;
|
17131 |
|
17132 | },{}],82:[function(require,module,exports){
|
17133 |
|
17134 | 'use strict';
|
17135 |
|
17136 |
|
17137 | var encodeCache = {};
|
17138 |
|
17139 |
|
17140 | // Create a lookup array where anything but characters in `chars` string
|
17141 | // and alphanumeric chars is percent-encoded.
|
17142 | //
|
17143 | function getEncodeCache(exclude) {
|
17144 | var i, ch, cache = encodeCache[exclude];
|
17145 | if (cache) { return cache; }
|
17146 |
|
17147 | cache = encodeCache[exclude] = [];
|
17148 |
|
17149 | for (i = 0; i < 128; i++) {
|
17150 | ch = String.fromCharCode(i);
|
17151 |
|
17152 | if (/^[0-9a-z]$/i.test(ch)) {
|
17153 | // always allow unencoded alphanumeric characters
|
17154 | cache.push(ch);
|
17155 | } else {
|
17156 | cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
|
17157 | }
|
17158 | }
|
17159 |
|
17160 | for (i = 0; i < exclude.length; i++) {
|
17161 | cache[exclude.charCodeAt(i)] = exclude[i];
|
17162 | }
|
17163 |
|
17164 | return cache;
|
17165 | }
|
17166 |
|
17167 |
|
17168 | // Encode unsafe characters with percent-encoding, skipping already
|
17169 | // encoded sequences.
|
17170 | //
|
17171 | // - string - string to encode
|
17172 | // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
|
17173 | // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
|
17174 | //
|
17175 | function encode(string, exclude, keepEscaped) {
|
17176 | var i, l, code, nextCode, cache,
|
17177 | result = '';
|
17178 |
|
17179 | if (typeof exclude !== 'string') {
|
17180 | // encode(string, keepEscaped)
|
17181 | keepEscaped = exclude;
|
17182 | exclude = encode.defaultChars;
|
17183 | }
|
17184 |
|
17185 | if (typeof keepEscaped === 'undefined') {
|
17186 | keepEscaped = true;
|
17187 | }
|
17188 |
|
17189 | cache = getEncodeCache(exclude);
|
17190 |
|
17191 | for (i = 0, l = string.length; i < l; i++) {
|
17192 | code = string.charCodeAt(i);
|
17193 |
|
17194 | if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
|
17195 | if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
|
17196 | result += string.slice(i, i + 3);
|
17197 | i += 2;
|
17198 | continue;
|
17199 | }
|
17200 | }
|
17201 |
|
17202 | if (code < 128) {
|
17203 | result += cache[code];
|
17204 | continue;
|
17205 | }
|
17206 |
|
17207 | if (code >= 0xD800 && code <= 0xDFFF) {
|
17208 | if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
|
17209 | nextCode = string.charCodeAt(i + 1);
|
17210 | if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
|
17211 | result += encodeURIComponent(string[i] + string[i + 1]);
|
17212 | i++;
|
17213 | continue;
|
17214 | }
|
17215 | }
|
17216 | result += '%EF%BF%BD';
|
17217 | continue;
|
17218 | }
|
17219 |
|
17220 | result += encodeURIComponent(string[i]);
|
17221 | }
|
17222 |
|
17223 | return result;
|
17224 | }
|
17225 |
|
17226 | encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
|
17227 | encode.componentChars = "-_.!~*'()";
|
17228 |
|
17229 |
|
17230 | module.exports = encode;
|
17231 |
|
17232 | },{}],83:[function(require,module,exports){
|
17233 |
|
17234 | 'use strict';
|
17235 |
|
17236 |
|
17237 | module.exports = function format(url) {
|
17238 | var result = '';
|
17239 |
|
17240 | result += url.protocol || '';
|
17241 | result += url.slashes ? '//' : '';
|
17242 | result += url.auth ? url.auth + '@' : '';
|
17243 |
|
17244 | if (url.hostname && url.hostname.indexOf(':') !== -1) {
|
17245 | // ipv6 address
|
17246 | result += '[' + url.hostname + ']';
|
17247 | } else {
|
17248 | result += url.hostname || '';
|
17249 | }
|
17250 |
|
17251 | result += url.port ? ':' + url.port : '';
|
17252 | result += url.pathname || '';
|
17253 | result += url.search || '';
|
17254 | result += url.hash || '';
|
17255 |
|
17256 | return result;
|
17257 | };
|
17258 |
|
17259 | },{}],84:[function(require,module,exports){
|
17260 | 'use strict';
|
17261 |
|
17262 |
|
17263 | module.exports.encode = require('./encode');
|
17264 | module.exports.decode = require('./decode');
|
17265 | module.exports.format = require('./format');
|
17266 | module.exports.parse = require('./parse');
|
17267 |
|
17268 | },{"./decode":81,"./encode":82,"./format":83,"./parse":85}],85:[function(require,module,exports){
|
17269 | // Copyright Joyent, Inc. and other Node contributors.
|
17270 | //
|
17271 | // Permission is hereby granted, free of charge, to any person obtaining a
|
17272 | // copy of this software and associated documentation files (the
|
17273 | // "Software"), to deal in the Software without restriction, including
|
17274 | // without limitation the rights to use, copy, modify, merge, publish,
|
17275 | // distribute, sublicense, and/or sell copies of the Software, and to permit
|
17276 | // persons to whom the Software is furnished to do so, subject to the
|
17277 | // following conditions:
|
17278 | //
|
17279 | // The above copyright notice and this permission notice shall be included
|
17280 | // in all copies or substantial portions of the Software.
|
17281 | //
|
17282 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
17283 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17284 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
17285 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
17286 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
17287 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
17288 | // USE OR OTHER DEALINGS IN THE SOFTWARE.
|
17289 |
|
17290 | 'use strict';
|
17291 |
|
17292 | //
|
17293 | // Changes from joyent/node:
|
17294 | //
|
17295 | // 1. No leading slash in paths,
|
17296 | // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
|
17297 | //
|
17298 | // 2. Backslashes are not replaced with slashes,
|
17299 | // so `http:\\example.org\` is treated like a relative path
|
17300 | //
|
17301 | // 3. Trailing colon is treated like a part of the path,
|
17302 | // i.e. in `http://example.org:foo` pathname is `:foo`
|
17303 | //
|
17304 | // 4. Nothing is URL-encoded in the resulting object,
|
17305 | // (in joyent/node some chars in auth and paths are encoded)
|
17306 | //
|
17307 | // 5. `url.parse()` does not have `parseQueryString` argument
|
17308 | //
|
17309 | // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
|
17310 | // which can be constructed using other parts of the url.
|
17311 | //
|
17312 |
|
17313 |
|
17314 | function Url() {
|
17315 | this.protocol = null;
|
17316 | this.slashes = null;
|
17317 | this.auth = null;
|
17318 | this.port = null;
|
17319 | this.hostname = null;
|
17320 | this.hash = null;
|
17321 | this.search = null;
|
17322 | this.pathname = null;
|
17323 | }
|
17324 |
|
17325 | // Reference: RFC 3986, RFC 1808, RFC 2396
|
17326 |
|
17327 | // define these here so at least they only have to be
|
17328 | // compiled once on the first module load.
|
17329 | var protocolPattern = /^([a-z0-9.+-]+:)/i,
|
17330 | portPattern = /:[0-9]*$/,
|
17331 |
|
17332 | // Special case for a simple path URL
|
17333 | simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
|
17334 |
|
17335 | // RFC 2396: characters reserved for delimiting URLs.
|
17336 | // We actually just auto-escape these.
|
17337 | delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
|
17338 |
|
17339 | // RFC 2396: characters not allowed for various reasons.
|
17340 | unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
|
17341 |
|
17342 | // Allowed by RFCs, but cause of XSS attacks. Always escape these.
|
17343 | autoEscape = [ '\'' ].concat(unwise),
|
17344 | // Characters that are never ever allowed in a hostname.
|
17345 | // Note that any invalid chars are also handled, but these
|
17346 | // are the ones that are *expected* to be seen, so we fast-path
|
17347 | // them.
|
17348 | nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
|
17349 | hostEndingChars = [ '/', '?', '#' ],
|
17350 | hostnameMaxLen = 255,
|
17351 | hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
|
17352 | hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
|
17353 | // protocols that can allow "unsafe" and "unwise" chars.
|
17354 | /* eslint-disable no-script-url */
|
17355 | // protocols that never have a hostname.
|
17356 | hostlessProtocol = {
|
17357 | 'javascript': true,
|
17358 | 'javascript:': true
|
17359 | },
|
17360 | // protocols that always contain a // bit.
|
17361 | slashedProtocol = {
|
17362 | 'http': true,
|
17363 | 'https': true,
|
17364 | 'ftp': true,
|
17365 | 'gopher': true,
|
17366 | 'file': true,
|
17367 | 'http:': true,
|
17368 | 'https:': true,
|
17369 | 'ftp:': true,
|
17370 | 'gopher:': true,
|
17371 | 'file:': true
|
17372 | };
|
17373 | /* eslint-enable no-script-url */
|
17374 |
|
17375 | function urlParse(url, slashesDenoteHost) {
|
17376 | if (url && url instanceof Url) { return url; }
|
17377 |
|
17378 | var u = new Url();
|
17379 | u.parse(url, slashesDenoteHost);
|
17380 | return u;
|
17381 | }
|
17382 |
|
17383 | Url.prototype.parse = function(url, slashesDenoteHost) {
|
17384 | var i, l, lowerProto, hec, slashes,
|
17385 | rest = url;
|
17386 |
|
17387 | // trim before proceeding.
|
17388 | // This is to support parse stuff like " http://foo.com \n"
|
17389 | rest = rest.trim();
|
17390 |
|
17391 | if (!slashesDenoteHost && url.split('#').length === 1) {
|
17392 | // Try fast path regexp
|
17393 | var simplePath = simplePathPattern.exec(rest);
|
17394 | if (simplePath) {
|
17395 | this.pathname = simplePath[1];
|
17396 | if (simplePath[2]) {
|
17397 | this.search = simplePath[2];
|
17398 | }
|
17399 | return this;
|
17400 | }
|
17401 | }
|
17402 |
|
17403 | var proto = protocolPattern.exec(rest);
|
17404 | if (proto) {
|
17405 | proto = proto[0];
|
17406 | lowerProto = proto.toLowerCase();
|
17407 | this.protocol = proto;
|
17408 | rest = rest.substr(proto.length);
|
17409 | }
|
17410 |
|
17411 | // figure out if it's got a host
|
17412 | // user@server is *always* interpreted as a hostname, and url
|
17413 | // resolution will treat //foo/bar as host=foo,path=bar because that's
|
17414 | // how the browser resolves relative URLs.
|
17415 | if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
17416 | slashes = rest.substr(0, 2) === '//';
|
17417 | if (slashes && !(proto && hostlessProtocol[proto])) {
|
17418 | rest = rest.substr(2);
|
17419 | this.slashes = true;
|
17420 | }
|
17421 | }
|
17422 |
|
17423 | if (!hostlessProtocol[proto] &&
|
17424 | (slashes || (proto && !slashedProtocol[proto]))) {
|
17425 |
|
17426 | // there's a hostname.
|
17427 | // the first instance of /, ?, ;, or # ends the host.
|
17428 | //
|
17429 | // If there is an @ in the hostname, then non-host chars *are* allowed
|
17430 | // to the left of the last @ sign, unless some host-ending character
|
17431 | // comes *before* the @-sign.
|
17432 | // URLs are obnoxious.
|
17433 | //
|
17434 | // ex:
|
17435 | // http://a@b@c/ => user:a@b host:c
|
17436 | // http://a@b?@c => user:a host:c path:/?@c
|
17437 |
|
17438 | // v0.12 TODO(isaacs): This is not quite how Chrome does things.
|
17439 | // Review our test case against browsers more comprehensively.
|
17440 |
|
17441 | // find the first instance of any hostEndingChars
|
17442 | var hostEnd = -1;
|
17443 | for (i = 0; i < hostEndingChars.length; i++) {
|
17444 | hec = rest.indexOf(hostEndingChars[i]);
|
17445 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
|
17446 | hostEnd = hec;
|
17447 | }
|
17448 | }
|
17449 |
|
17450 | // at this point, either we have an explicit point where the
|
17451 | // auth portion cannot go past, or the last @ char is the decider.
|
17452 | var auth, atSign;
|
17453 | if (hostEnd === -1) {
|
17454 | // atSign can be anywhere.
|
17455 | atSign = rest.lastIndexOf('@');
|
17456 | } else {
|
17457 | // atSign must be in auth portion.
|
17458 | // http://a@b/c@d => host:b auth:a path:/c@d
|
17459 | atSign = rest.lastIndexOf('@', hostEnd);
|
17460 | }
|
17461 |
|
17462 | // Now we have a portion which is definitely the auth.
|
17463 | // Pull that off.
|
17464 | if (atSign !== -1) {
|
17465 | auth = rest.slice(0, atSign);
|
17466 | rest = rest.slice(atSign + 1);
|
17467 | this.auth = auth;
|
17468 | }
|
17469 |
|
17470 | // the host is the remaining to the left of the first non-host char
|
17471 | hostEnd = -1;
|
17472 | for (i = 0; i < nonHostChars.length; i++) {
|
17473 | hec = rest.indexOf(nonHostChars[i]);
|
17474 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
|
17475 | hostEnd = hec;
|
17476 | }
|
17477 | }
|
17478 | // if we still have not hit it, then the entire thing is a host.
|
17479 | if (hostEnd === -1) {
|
17480 | hostEnd = rest.length;
|
17481 | }
|
17482 |
|
17483 | if (rest[hostEnd - 1] === ':') { hostEnd--; }
|
17484 | var host = rest.slice(0, hostEnd);
|
17485 | rest = rest.slice(hostEnd);
|
17486 |
|
17487 | // pull out port.
|
17488 | this.parseHost(host);
|
17489 |
|
17490 | // we've indicated that there is a hostname,
|
17491 | // so even if it's empty, it has to be present.
|
17492 | this.hostname = this.hostname || '';
|
17493 |
|
17494 | // if hostname begins with [ and ends with ]
|
17495 | // assume that it's an IPv6 address.
|
17496 | var ipv6Hostname = this.hostname[0] === '[' &&
|
17497 | this.hostname[this.hostname.length - 1] === ']';
|
17498 |
|
17499 | // validate a little.
|
17500 | if (!ipv6Hostname) {
|
17501 | var hostparts = this.hostname.split(/\./);
|
17502 | for (i = 0, l = hostparts.length; i < l; i++) {
|
17503 | var part = hostparts[i];
|
17504 | if (!part) { continue; }
|
17505 | if (!part.match(hostnamePartPattern)) {
|
17506 | var newpart = '';
|
17507 | for (var j = 0, k = part.length; j < k; j++) {
|
17508 | if (part.charCodeAt(j) > 127) {
|
17509 | // we replace non-ASCII char with a temporary placeholder
|
17510 | // we need this to make sure size of hostname is not
|
17511 | // broken by replacing non-ASCII by nothing
|
17512 | newpart += 'x';
|
17513 | } else {
|
17514 | newpart += part[j];
|
17515 | }
|
17516 | }
|
17517 | // we test again with ASCII char only
|
17518 | if (!newpart.match(hostnamePartPattern)) {
|
17519 | var validParts = hostparts.slice(0, i);
|
17520 | var notHost = hostparts.slice(i + 1);
|
17521 | var bit = part.match(hostnamePartStart);
|
17522 | if (bit) {
|
17523 | validParts.push(bit[1]);
|
17524 | notHost.unshift(bit[2]);
|
17525 | }
|
17526 | if (notHost.length) {
|
17527 | rest = notHost.join('.') + rest;
|
17528 | }
|
17529 | this.hostname = validParts.join('.');
|
17530 | break;
|
17531 | }
|
17532 | }
|
17533 | }
|
17534 | }
|
17535 |
|
17536 | if (this.hostname.length > hostnameMaxLen) {
|
17537 | this.hostname = '';
|
17538 | }
|
17539 |
|
17540 | // strip [ and ] from the hostname
|
17541 | // the host field still retains them, though
|
17542 | if (ipv6Hostname) {
|
17543 | this.hostname = this.hostname.substr(1, this.hostname.length - 2);
|
17544 | }
|
17545 | }
|
17546 |
|
17547 | // chop off from the tail first.
|
17548 | var hash = rest.indexOf('#');
|
17549 | if (hash !== -1) {
|
17550 | // got a fragment string.
|
17551 | this.hash = rest.substr(hash);
|
17552 | rest = rest.slice(0, hash);
|
17553 | }
|
17554 | var qm = rest.indexOf('?');
|
17555 | if (qm !== -1) {
|
17556 | this.search = rest.substr(qm);
|
17557 | rest = rest.slice(0, qm);
|
17558 | }
|
17559 | if (rest) { this.pathname = rest; }
|
17560 | if (slashedProtocol[lowerProto] &&
|
17561 | this.hostname && !this.pathname) {
|
17562 | this.pathname = '';
|
17563 | }
|
17564 |
|
17565 | return this;
|
17566 | };
|
17567 |
|
17568 | Url.prototype.parseHost = function(host) {
|
17569 | var port = portPattern.exec(host);
|
17570 | if (port) {
|
17571 | port = port[0];
|
17572 | if (port !== ':') {
|
17573 | this.port = port.substr(1);
|
17574 | }
|
17575 | host = host.substr(0, host.length - port.length);
|
17576 | }
|
17577 | if (host) { this.hostname = host; }
|
17578 | };
|
17579 |
|
17580 | module.exports = urlParse;
|
17581 |
|
17582 | },{}],86:[function(require,module,exports){
|
17583 | module.exports=/[\0-\x1F\x7F-\x9F]/
|
17584 | },{}],87:[function(require,module,exports){
|
17585 | module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
|
17586 | },{}],88:[function(require,module,exports){
|
17587 | module.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\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-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\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]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDE38-\uDE3D]|\uD805[\uDCC6\uDDC1-\uDDC9\uDE41-\uDE43]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F/
|
17588 | },{}],89:[function(require,module,exports){
|
17589 | module.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/
|
17590 | },{}],90:[function(require,module,exports){
|
17591 |
|
17592 | module.exports.Any = require('./properties/Any/regex');
|
17593 | module.exports.Cc = require('./categories/Cc/regex');
|
17594 | module.exports.Cf = require('./categories/Cf/regex');
|
17595 | module.exports.P = require('./categories/P/regex');
|
17596 | module.exports.Z = require('./categories/Z/regex');
|
17597 |
|
17598 | },{"./categories/Cc/regex":86,"./categories/Cf/regex":87,"./categories/P/regex":88,"./categories/Z/regex":89,"./properties/Any/regex":91}],91:[function(require,module,exports){
|
17599 | module.exports=/[\0-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/
|
17600 | },{}],92:[function(require,module,exports){
|
17601 | (function (global){
|
17602 | /*! https://mths.be/punycode v1.4.0 by @mathias */
|
17603 | ;(function(root) {
|
17604 |
|
17605 | /** Detect free variables */
|
17606 | var freeExports = typeof exports == 'object' && exports &&
|
17607 | !exports.nodeType && exports;
|
17608 | var freeModule = typeof module == 'object' && module &&
|
17609 | !module.nodeType && module;
|
17610 | var freeGlobal = typeof global == 'object' && global;
|
17611 | if (
|
17612 | freeGlobal.global === freeGlobal ||
|
17613 | freeGlobal.window === freeGlobal ||
|
17614 | freeGlobal.self === freeGlobal
|
17615 | ) {
|
17616 | root = freeGlobal;
|
17617 | }
|
17618 |
|
17619 | /**
|
17620 | * The `punycode` object.
|
17621 | * @name punycode
|
17622 | * @type Object
|
17623 | */
|
17624 | var punycode,
|
17625 |
|
17626 | /** Highest positive signed 32-bit float value */
|
17627 | maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
|
17628 |
|
17629 | /** Bootstring parameters */
|
17630 | base = 36,
|
17631 | tMin = 1,
|
17632 | tMax = 26,
|
17633 | skew = 38,
|
17634 | damp = 700,
|
17635 | initialBias = 72,
|
17636 | initialN = 128, // 0x80
|
17637 | delimiter = '-', // '\x2D'
|
17638 |
|
17639 | /** Regular expressions */
|
17640 | regexPunycode = /^xn--/,
|
17641 | regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
|
17642 | regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
|
17643 |
|
17644 | /** Error messages */
|
17645 | errors = {
|
17646 | 'overflow': 'Overflow: input needs wider integers to process',
|
17647 | 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
17648 | 'invalid-input': 'Invalid input'
|
17649 | },
|
17650 |
|
17651 | /** Convenience shortcuts */
|
17652 | baseMinusTMin = base - tMin,
|
17653 | floor = Math.floor,
|
17654 | stringFromCharCode = String.fromCharCode,
|
17655 |
|
17656 | /** Temporary variable */
|
17657 | key;
|
17658 |
|
17659 | /*--------------------------------------------------------------------------*/
|
17660 |
|
17661 | /**
|
17662 | * A generic error utility function.
|
17663 | * @private
|
17664 | * @param {String} type The error type.
|
17665 | * @returns {Error} Throws a `RangeError` with the applicable error message.
|
17666 | */
|
17667 | function error(type) {
|
17668 | throw new RangeError(errors[type]);
|
17669 | }
|
17670 |
|
17671 | /**
|
17672 | * A generic `Array#map` utility function.
|
17673 | * @private
|
17674 | * @param {Array} array The array to iterate over.
|
17675 | * @param {Function} callback The function that gets called for every array
|
17676 | * item.
|
17677 | * @returns {Array} A new array of values returned by the callback function.
|
17678 | */
|
17679 | function map(array, fn) {
|
17680 | var length = array.length;
|
17681 | var result = [];
|
17682 | while (length--) {
|
17683 | result[length] = fn(array[length]);
|
17684 | }
|
17685 | return result;
|
17686 | }
|
17687 |
|
17688 | /**
|
17689 | * A simple `Array#map`-like wrapper to work with domain name strings or email
|
17690 | * addresses.
|
17691 | * @private
|
17692 | * @param {String} domain The domain name or email address.
|
17693 | * @param {Function} callback The function that gets called for every
|
17694 | * character.
|
17695 | * @returns {Array} A new string of characters returned by the callback
|
17696 | * function.
|
17697 | */
|
17698 | function mapDomain(string, fn) {
|
17699 | var parts = string.split('@');
|
17700 | var result = '';
|
17701 | if (parts.length > 1) {
|
17702 | // In email addresses, only the domain name should be punycoded. Leave
|
17703 | // the local part (i.e. everything up to `@`) intact.
|
17704 | result = parts[0] + '@';
|
17705 | string = parts[1];
|
17706 | }
|
17707 | // Avoid `split(regex)` for IE8 compatibility. See #17.
|
17708 | string = string.replace(regexSeparators, '\x2E');
|
17709 | var labels = string.split('.');
|
17710 | var encoded = map(labels, fn).join('.');
|
17711 | return result + encoded;
|
17712 | }
|
17713 |
|
17714 | /**
|
17715 | * Creates an array containing the numeric code points of each Unicode
|
17716 | * character in the string. While JavaScript uses UCS-2 internally,
|
17717 | * this function will convert a pair of surrogate halves (each of which
|
17718 | * UCS-2 exposes as separate characters) into a single code point,
|
17719 | * matching UTF-16.
|
17720 | * @see `punycode.ucs2.encode`
|
17721 | * @see <https://mathiasbynens.be/notes/javascript-encoding>
|
17722 | * @memberOf punycode.ucs2
|
17723 | * @name decode
|
17724 | * @param {String} string The Unicode input string (UCS-2).
|
17725 | * @returns {Array} The new array of code points.
|
17726 | */
|
17727 | function ucs2decode(string) {
|
17728 | var output = [],
|
17729 | counter = 0,
|
17730 | length = string.length,
|
17731 | value,
|
17732 | extra;
|
17733 | while (counter < length) {
|
17734 | value = string.charCodeAt(counter++);
|
17735 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
17736 | // high surrogate, and there is a next character
|
17737 | extra = string.charCodeAt(counter++);
|
17738 | if ((extra & 0xFC00) == 0xDC00) { // low surrogate
|
17739 | output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
17740 | } else {
|
17741 | // unmatched surrogate; only append this code unit, in case the next
|
17742 | // code unit is the high surrogate of a surrogate pair
|
17743 | output.push(value);
|
17744 | counter--;
|
17745 | }
|
17746 | } else {
|
17747 | output.push(value);
|
17748 | }
|
17749 | }
|
17750 | return output;
|
17751 | }
|
17752 |
|
17753 | /**
|
17754 | * Creates a string based on an array of numeric code points.
|
17755 | * @see `punycode.ucs2.decode`
|
17756 | * @memberOf punycode.ucs2
|
17757 | * @name encode
|
17758 | * @param {Array} codePoints The array of numeric code points.
|
17759 | * @returns {String} The new Unicode string (UCS-2).
|
17760 | */
|
17761 | function ucs2encode(array) {
|
17762 | return map(array, function(value) {
|
17763 | var output = '';
|
17764 | if (value > 0xFFFF) {
|
17765 | value -= 0x10000;
|
17766 | output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
|
17767 | value = 0xDC00 | value & 0x3FF;
|
17768 | }
|
17769 | output += stringFromCharCode(value);
|
17770 | return output;
|
17771 | }).join('');
|
17772 | }
|
17773 |
|
17774 | /**
|
17775 | * Converts a basic code point into a digit/integer.
|
17776 | * @see `digitToBasic()`
|
17777 | * @private
|
17778 | * @param {Number} codePoint The basic numeric code point value.
|
17779 | * @returns {Number} The numeric value of a basic code point (for use in
|
17780 | * representing integers) in the range `0` to `base - 1`, or `base` if
|
17781 | * the code point does not represent a value.
|
17782 | */
|
17783 | function basicToDigit(codePoint) {
|
17784 | if (codePoint - 48 < 10) {
|
17785 | return codePoint - 22;
|
17786 | }
|
17787 | if (codePoint - 65 < 26) {
|
17788 | return codePoint - 65;
|
17789 | }
|
17790 | if (codePoint - 97 < 26) {
|
17791 | return codePoint - 97;
|
17792 | }
|
17793 | return base;
|
17794 | }
|
17795 |
|
17796 | /**
|
17797 | * Converts a digit/integer into a basic code point.
|
17798 | * @see `basicToDigit()`
|
17799 | * @private
|
17800 | * @param {Number} digit The numeric value of a basic code point.
|
17801 | * @returns {Number} The basic code point whose value (when used for
|
17802 | * representing integers) is `digit`, which needs to be in the range
|
17803 | * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
|
17804 | * used; else, the lowercase form is used. The behavior is undefined
|
17805 | * if `flag` is non-zero and `digit` has no uppercase form.
|
17806 | */
|
17807 | function digitToBasic(digit, flag) {
|
17808 | // 0..25 map to ASCII a..z or A..Z
|
17809 | // 26..35 map to ASCII 0..9
|
17810 | return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
17811 | }
|
17812 |
|
17813 | /**
|
17814 | * Bias adaptation function as per section 3.4 of RFC 3492.
|
17815 | * https://tools.ietf.org/html/rfc3492#section-3.4
|
17816 | * @private
|
17817 | */
|
17818 | function adapt(delta, numPoints, firstTime) {
|
17819 | var k = 0;
|
17820 | delta = firstTime ? floor(delta / damp) : delta >> 1;
|
17821 | delta += floor(delta / numPoints);
|
17822 | for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
|
17823 | delta = floor(delta / baseMinusTMin);
|
17824 | }
|
17825 | return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
17826 | }
|
17827 |
|
17828 | /**
|
17829 | * Converts a Punycode string of ASCII-only symbols to a string of Unicode
|
17830 | * symbols.
|
17831 | * @memberOf punycode
|
17832 | * @param {String} input The Punycode string of ASCII-only symbols.
|
17833 | * @returns {String} The resulting string of Unicode symbols.
|
17834 | */
|
17835 | function decode(input) {
|
17836 | // Don't use UCS-2
|
17837 | var output = [],
|
17838 | inputLength = input.length,
|
17839 | out,
|
17840 | i = 0,
|
17841 | n = initialN,
|
17842 | bias = initialBias,
|
17843 | basic,
|
17844 | j,
|
17845 | index,
|
17846 | oldi,
|
17847 | w,
|
17848 | k,
|
17849 | digit,
|
17850 | t,
|
17851 | /** Cached calculation results */
|
17852 | baseMinusT;
|
17853 |
|
17854 | // Handle the basic code points: let `basic` be the number of input code
|
17855 | // points before the last delimiter, or `0` if there is none, then copy
|
17856 | // the first basic code points to the output.
|
17857 |
|
17858 | basic = input.lastIndexOf(delimiter);
|
17859 | if (basic < 0) {
|
17860 | basic = 0;
|
17861 | }
|
17862 |
|
17863 | for (j = 0; j < basic; ++j) {
|
17864 | // if it's not a basic code point
|
17865 | if (input.charCodeAt(j) >= 0x80) {
|
17866 | error('not-basic');
|
17867 | }
|
17868 | output.push(input.charCodeAt(j));
|
17869 | }
|
17870 |
|
17871 | // Main decoding loop: start just after the last delimiter if any basic code
|
17872 | // points were copied; start at the beginning otherwise.
|
17873 |
|
17874 | for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
|
17875 |
|
17876 | // `index` is the index of the next character to be consumed.
|
17877 | // Decode a generalized variable-length integer into `delta`,
|
17878 | // which gets added to `i`. The overflow checking is easier
|
17879 | // if we increase `i` as we go, then subtract off its starting
|
17880 | // value at the end to obtain `delta`.
|
17881 | for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
|
17882 |
|
17883 | if (index >= inputLength) {
|
17884 | error('invalid-input');
|
17885 | }
|
17886 |
|
17887 | digit = basicToDigit(input.charCodeAt(index++));
|
17888 |
|
17889 | if (digit >= base || digit > floor((maxInt - i) / w)) {
|
17890 | error('overflow');
|
17891 | }
|
17892 |
|
17893 | i += digit * w;
|
17894 | t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
17895 |
|
17896 | if (digit < t) {
|
17897 | break;
|
17898 | }
|
17899 |
|
17900 | baseMinusT = base - t;
|
17901 | if (w > floor(maxInt / baseMinusT)) {
|
17902 | error('overflow');
|
17903 | }
|
17904 |
|
17905 | w *= baseMinusT;
|
17906 |
|
17907 | }
|
17908 |
|
17909 | out = output.length + 1;
|
17910 | bias = adapt(i - oldi, out, oldi == 0);
|
17911 |
|
17912 | // `i` was supposed to wrap around from `out` to `0`,
|
17913 | // incrementing `n` each time, so we'll fix that now:
|
17914 | if (floor(i / out) > maxInt - n) {
|
17915 | error('overflow');
|
17916 | }
|
17917 |
|
17918 | n += floor(i / out);
|
17919 | i %= out;
|
17920 |
|
17921 | // Insert `n` at position `i` of the output
|
17922 | output.splice(i++, 0, n);
|
17923 |
|
17924 | }
|
17925 |
|
17926 | return ucs2encode(output);
|
17927 | }
|
17928 |
|
17929 | /**
|
17930 | * Converts a string of Unicode symbols (e.g. a domain name label) to a
|
17931 | * Punycode string of ASCII-only symbols.
|
17932 | * @memberOf punycode
|
17933 | * @param {String} input The string of Unicode symbols.
|
17934 | * @returns {String} The resulting Punycode string of ASCII-only symbols.
|
17935 | */
|
17936 | function encode(input) {
|
17937 | var n,
|
17938 | delta,
|
17939 | handledCPCount,
|
17940 | basicLength,
|
17941 | bias,
|
17942 | j,
|
17943 | m,
|
17944 | q,
|
17945 | k,
|
17946 | t,
|
17947 | currentValue,
|
17948 | output = [],
|
17949 | /** `inputLength` will hold the number of code points in `input`. */
|
17950 | inputLength,
|
17951 | /** Cached calculation results */
|
17952 | handledCPCountPlusOne,
|
17953 | baseMinusT,
|
17954 | qMinusT;
|
17955 |
|
17956 | // Convert the input in UCS-2 to Unicode
|
17957 | input = ucs2decode(input);
|
17958 |
|
17959 | // Cache the length
|
17960 | inputLength = input.length;
|
17961 |
|
17962 | // Initialize the state
|
17963 | n = initialN;
|
17964 | delta = 0;
|
17965 | bias = initialBias;
|
17966 |
|
17967 | // Handle the basic code points
|
17968 | for (j = 0; j < inputLength; ++j) {
|
17969 | currentValue = input[j];
|
17970 | if (currentValue < 0x80) {
|
17971 | output.push(stringFromCharCode(currentValue));
|
17972 | }
|
17973 | }
|
17974 |
|
17975 | handledCPCount = basicLength = output.length;
|
17976 |
|
17977 | // `handledCPCount` is the number of code points that have been handled;
|
17978 | // `basicLength` is the number of basic code points.
|
17979 |
|
17980 | // Finish the basic string - if it is not empty - with a delimiter
|
17981 | if (basicLength) {
|
17982 | output.push(delimiter);
|
17983 | }
|
17984 |
|
17985 | // Main encoding loop:
|
17986 | while (handledCPCount < inputLength) {
|
17987 |
|
17988 | // All non-basic code points < n have been handled already. Find the next
|
17989 | // larger one:
|
17990 | for (m = maxInt, j = 0; j < inputLength; ++j) {
|
17991 | currentValue = input[j];
|
17992 | if (currentValue >= n && currentValue < m) {
|
17993 | m = currentValue;
|
17994 | }
|
17995 | }
|
17996 |
|
17997 | // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
|
17998 | // but guard against overflow
|
17999 | handledCPCountPlusOne = handledCPCount + 1;
|
18000 | if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
18001 | error('overflow');
|
18002 | }
|
18003 |
|
18004 | delta += (m - n) * handledCPCountPlusOne;
|
18005 | n = m;
|
18006 |
|
18007 | for (j = 0; j < inputLength; ++j) {
|
18008 | currentValue = input[j];
|
18009 |
|
18010 | if (currentValue < n && ++delta > maxInt) {
|
18011 | error('overflow');
|
18012 | }
|
18013 |
|
18014 | if (currentValue == n) {
|
18015 | // Represent delta as a generalized variable-length integer
|
18016 | for (q = delta, k = base; /* no condition */; k += base) {
|
18017 | t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
18018 | if (q < t) {
|
18019 | break;
|
18020 | }
|
18021 | qMinusT = q - t;
|
18022 | baseMinusT = base - t;
|
18023 | output.push(
|
18024 | stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
|
18025 | );
|
18026 | q = floor(qMinusT / baseMinusT);
|
18027 | }
|
18028 |
|
18029 | output.push(stringFromCharCode(digitToBasic(q, 0)));
|
18030 | bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
18031 | delta = 0;
|
18032 | ++handledCPCount;
|
18033 | }
|
18034 | }
|
18035 |
|
18036 | ++delta;
|
18037 | ++n;
|
18038 |
|
18039 | }
|
18040 | return output.join('');
|
18041 | }
|
18042 |
|
18043 | /**
|
18044 | * Converts a Punycode string representing a domain name or an email address
|
18045 | * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
|
18046 | * it doesn't matter if you call it on a string that has already been
|
18047 | * converted to Unicode.
|
18048 | * @memberOf punycode
|
18049 | * @param {String} input The Punycoded domain name or email address to
|
18050 | * convert to Unicode.
|
18051 | * @returns {String} The Unicode representation of the given Punycode
|
18052 | * string.
|
18053 | */
|
18054 | function toUnicode(input) {
|
18055 | return mapDomain(input, function(string) {
|
18056 | return regexPunycode.test(string)
|
18057 | ? decode(string.slice(4).toLowerCase())
|
18058 | : string;
|
18059 | });
|
18060 | }
|
18061 |
|
18062 | /**
|
18063 | * Converts a Unicode string representing a domain name or an email address to
|
18064 | * Punycode. Only the non-ASCII parts of the domain name will be converted,
|
18065 | * i.e. it doesn't matter if you call it with a domain that's already in
|
18066 | * ASCII.
|
18067 | * @memberOf punycode
|
18068 | * @param {String} input The domain name or email address to convert, as a
|
18069 | * Unicode string.
|
18070 | * @returns {String} The Punycode representation of the given domain name or
|
18071 | * email address.
|
18072 | */
|
18073 | function toASCII(input) {
|
18074 | return mapDomain(input, function(string) {
|
18075 | return regexNonASCII.test(string)
|
18076 | ? 'xn--' + encode(string)
|
18077 | : string;
|
18078 | });
|
18079 | }
|
18080 |
|
18081 | /*--------------------------------------------------------------------------*/
|
18082 |
|
18083 | /** Define the public API */
|
18084 | punycode = {
|
18085 | /**
|
18086 | * A string representing the current Punycode.js version number.
|
18087 | * @memberOf punycode
|
18088 | * @type String
|
18089 | */
|
18090 | 'version': '1.3.2',
|
18091 | /**
|
18092 | * An object of methods to convert from JavaScript's internal character
|
18093 | * representation (UCS-2) to Unicode code points, and back.
|
18094 | * @see <https://mathiasbynens.be/notes/javascript-encoding>
|
18095 | * @memberOf punycode
|
18096 | * @type Object
|
18097 | */
|
18098 | 'ucs2': {
|
18099 | 'decode': ucs2decode,
|
18100 | 'encode': ucs2encode
|
18101 | },
|
18102 | 'decode': decode,
|
18103 | 'encode': encode,
|
18104 | 'toASCII': toASCII,
|
18105 | 'toUnicode': toUnicode
|
18106 | };
|
18107 |
|
18108 | /** Expose `punycode` */
|
18109 | // Some AMD build optimizers, like r.js, check for specific condition patterns
|
18110 | // like the following:
|
18111 | if (
|
18112 | typeof define == 'function' &&
|
18113 | typeof define.amd == 'object' &&
|
18114 | define.amd
|
18115 | ) {
|
18116 | define('punycode', function() {
|
18117 | return punycode;
|
18118 | });
|
18119 | } else if (freeExports && freeModule) {
|
18120 | if (module.exports == freeExports) {
|
18121 | // in Node.js, io.js, or RingoJS v0.8.0+
|
18122 | freeModule.exports = punycode;
|
18123 | } else {
|
18124 | // in Narwhal or RingoJS v0.7.0-
|
18125 | for (key in punycode) {
|
18126 | punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
|
18127 | }
|
18128 | }
|
18129 | } else {
|
18130 | // in Rhino or a web browser
|
18131 | root.punycode = punycode;
|
18132 | }
|
18133 |
|
18134 | }(this));
|
18135 |
|
18136 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
18137 | },{}]},{},[1]);
|