katex 0.13.16 → 0.13.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/cli.js +3 -1
- package/contrib/copy-tex/README.md +3 -3
- package/contrib/mathtex-script-type/README.md +5 -5
- package/contrib/mhchem/README.md +1 -1
- package/dist/README.md +3 -3
- package/dist/contrib/auto-render.js +5 -5
- package/dist/contrib/auto-render.min.js +1 -1
- package/dist/contrib/copy-tex.js +1 -1
- package/dist/contrib/mathtex-script-type.js +5 -5
- package/dist/contrib/mathtex-script-type.min.js +1 -1
- package/dist/contrib/mhchem.js +5 -5
- package/dist/contrib/mhchem.min.js +1 -1
- package/dist/contrib/render-a11y-string.js +5 -5
- package/dist/contrib/render-a11y-string.min.js +1 -1
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/katex.css +1 -1
- package/dist/katex.js +31 -12
- package/dist/katex.min.css +1 -1
- package/dist/katex.min.js +1 -1
- package/dist/katex.mjs +30 -11
- package/package.json +5 -5
- package/src/buildHTML.js +6 -2
- package/src/environments/array.js +4 -2
- package/src/fonts/Makefile +2 -2
- package/src/functions/lap.js +3 -1
- package/src/symbols.js +2 -2
- package/CHANGELOG.md +0 -848
- package/src/fonts/.gitignore +0 -9
- package/src/metrics/.gitignore +0 -1
package/dist/katex.mjs
CHANGED
|
@@ -4273,9 +4273,9 @@ defineSymbol(math, main, mathord, "\u03d6", "\\varpi", true);
|
|
|
4273
4273
|
defineSymbol(math, main, mathord, "\u03f1", "\\varrho", true);
|
|
4274
4274
|
defineSymbol(math, main, mathord, "\u03c2", "\\varsigma", true);
|
|
4275
4275
|
defineSymbol(math, main, mathord, "\u03c6", "\\varphi", true);
|
|
4276
|
-
defineSymbol(math, main, bin, "\u2217", "*");
|
|
4276
|
+
defineSymbol(math, main, bin, "\u2217", "*", true);
|
|
4277
4277
|
defineSymbol(math, main, bin, "+", "+");
|
|
4278
|
-
defineSymbol(math, main, bin, "\u2212", "-");
|
|
4278
|
+
defineSymbol(math, main, bin, "\u2212", "-", true);
|
|
4279
4279
|
defineSymbol(math, main, bin, "\u22c5", "\\cdot", true);
|
|
4280
4280
|
defineSymbol(math, main, bin, "\u2218", "\\circ");
|
|
4281
4281
|
defineSymbol(math, main, bin, "\u00f7", "\\div", true);
|
|
@@ -6286,7 +6286,11 @@ function buildHTMLUnbreakable(children, options) {
|
|
|
6286
6286
|
|
|
6287
6287
|
var strut = makeSpan$1(["strut"]);
|
|
6288
6288
|
strut.style.height = body.height + body.depth + "em";
|
|
6289
|
-
|
|
6289
|
+
|
|
6290
|
+
if (body.depth) {
|
|
6291
|
+
strut.style.verticalAlign = -body.depth + "em";
|
|
6292
|
+
}
|
|
6293
|
+
|
|
6290
6294
|
body.children.unshift(strut);
|
|
6291
6295
|
return body;
|
|
6292
6296
|
}
|
|
@@ -6381,7 +6385,10 @@ function buildHTML(tree, options) {
|
|
|
6381
6385
|
if (tagChild) {
|
|
6382
6386
|
var strut = tagChild.children[0];
|
|
6383
6387
|
strut.style.height = htmlNode.height + htmlNode.depth + "em";
|
|
6384
|
-
|
|
6388
|
+
|
|
6389
|
+
if (htmlNode.depth) {
|
|
6390
|
+
strut.style.verticalAlign = -htmlNode.depth + "em";
|
|
6391
|
+
}
|
|
6385
6392
|
}
|
|
6386
6393
|
|
|
6387
6394
|
return htmlNode;
|
|
@@ -10038,7 +10045,8 @@ var htmlBuilder$7 = function htmlBuilder(group, options) {
|
|
|
10038
10045
|
var nc = 0;
|
|
10039
10046
|
var body = new Array(nr);
|
|
10040
10047
|
var hlines = [];
|
|
10041
|
-
var ruleThickness = Math.max(
|
|
10048
|
+
var ruleThickness = Math.max( // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
|
|
10049
|
+
options.fontMetrics().arrayRuleWidth, options.minRuleThickness // User override.
|
|
10042
10050
|
); // Horizontal spacing
|
|
10043
10051
|
|
|
10044
10052
|
var pt = 1 / options.fontMetrics().ptPerEm;
|
|
@@ -10193,7 +10201,13 @@ var htmlBuilder$7 = function htmlBuilder(group, options) {
|
|
|
10193
10201
|
separator.style.borderRightWidth = ruleThickness + "em";
|
|
10194
10202
|
separator.style.borderRightStyle = lineType;
|
|
10195
10203
|
separator.style.margin = "0 -" + ruleThickness / 2 + "em";
|
|
10196
|
-
|
|
10204
|
+
|
|
10205
|
+
var _shift = totalHeight - offset;
|
|
10206
|
+
|
|
10207
|
+
if (_shift) {
|
|
10208
|
+
separator.style.verticalAlign = -_shift + "em";
|
|
10209
|
+
}
|
|
10210
|
+
|
|
10197
10211
|
cols.push(separator);
|
|
10198
10212
|
} else {
|
|
10199
10213
|
throw new ParseError("Invalid separator type: " + colDescr.separator);
|
|
@@ -10230,14 +10244,14 @@ var htmlBuilder$7 = function htmlBuilder(group, options) {
|
|
|
10230
10244
|
continue;
|
|
10231
10245
|
}
|
|
10232
10246
|
|
|
10233
|
-
var
|
|
10247
|
+
var _shift2 = row.pos - offset;
|
|
10234
10248
|
|
|
10235
10249
|
elem.depth = row.depth;
|
|
10236
10250
|
elem.height = row.height;
|
|
10237
10251
|
col.push({
|
|
10238
10252
|
type: "elem",
|
|
10239
10253
|
elem: elem,
|
|
10240
|
-
shift:
|
|
10254
|
+
shift: _shift2
|
|
10241
10255
|
});
|
|
10242
10256
|
}
|
|
10243
10257
|
|
|
@@ -12453,7 +12467,11 @@ defineFunction({
|
|
|
12453
12467
|
|
|
12454
12468
|
var strut = buildCommon.makeSpan(["strut"]);
|
|
12455
12469
|
strut.style.height = node.height + node.depth + "em";
|
|
12456
|
-
|
|
12470
|
+
|
|
12471
|
+
if (node.depth) {
|
|
12472
|
+
strut.style.verticalAlign = -node.depth + "em";
|
|
12473
|
+
}
|
|
12474
|
+
|
|
12457
12475
|
node.children.unshift(strut); // Next, prevent vertical misplacement when next to something tall.
|
|
12458
12476
|
// This code resolves issue #1234
|
|
12459
12477
|
|
|
@@ -17021,7 +17039,8 @@ class Parser {
|
|
|
17021
17039
|
var argType = funcData.argTypes && funcData.argTypes[i];
|
|
17022
17040
|
var isOptional = i < funcData.numOptionalArgs;
|
|
17023
17041
|
|
|
17024
|
-
if (funcData.primitive && argType == null ||
|
|
17042
|
+
if (funcData.primitive && argType == null || // \sqrt expands into primitive if optional argument doesn't exist
|
|
17043
|
+
funcData.type === "sqrt" && i === 1 && optArgs[0] == null) {
|
|
17025
17044
|
argType = "primitive";
|
|
17026
17045
|
}
|
|
17027
17046
|
|
|
@@ -17720,7 +17739,7 @@ var katex = {
|
|
|
17720
17739
|
/**
|
|
17721
17740
|
* Current KaTeX version
|
|
17722
17741
|
*/
|
|
17723
|
-
version: "0.13.
|
|
17742
|
+
version: "0.13.20",
|
|
17724
17743
|
|
|
17725
17744
|
/**
|
|
17726
17745
|
* Renders the given LaTeX into an HTML+MathML combination, and adds
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "katex",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.20",
|
|
4
4
|
"description": "Fast math typesetting for the web.",
|
|
5
5
|
"main": "dist/katex.js",
|
|
6
6
|
"homepage": "https://katex.org",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@babel/runtime": "^7.10.4",
|
|
30
30
|
"@rollup/plugin-alias": "^3.1.1",
|
|
31
31
|
"@rollup/plugin-babel": "^5.0.4",
|
|
32
|
-
"@semantic-release/changelog": "^
|
|
33
|
-
"@semantic-release/git": "^
|
|
32
|
+
"@semantic-release/changelog": "^6.0.0",
|
|
33
|
+
"@semantic-release/git": "^10.0.0",
|
|
34
34
|
"babel-jest": "^27.0.0",
|
|
35
35
|
"babel-loader": "^8.0.5",
|
|
36
36
|
"babel-plugin-istanbul": "^6.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"cssnano": "^5.0.0-rc.1",
|
|
45
45
|
"eslint": "^7.4.0",
|
|
46
46
|
"eslint-plugin-actions": "^1.0.1",
|
|
47
|
-
"eslint-plugin-flowtype": "^
|
|
47
|
+
"eslint-plugin-flowtype": "^6.0.0",
|
|
48
48
|
"eslint-plugin-react": "^7.20.3",
|
|
49
49
|
"flow-bin": "^0.135.0",
|
|
50
50
|
"fs-extra": "^10.0.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"rimraf": "^3.0.2",
|
|
76
76
|
"rollup": "^2.21.0",
|
|
77
77
|
"selenium-webdriver": "^4.0.0-beta.4",
|
|
78
|
-
"semantic-release": "^
|
|
78
|
+
"semantic-release": "^18.0.0",
|
|
79
79
|
"sri-toolbox": "^0.2.0",
|
|
80
80
|
"style-loader": "^3.0.0",
|
|
81
81
|
"stylelint": "^13.6.1",
|
package/src/buildHTML.js
CHANGED
|
@@ -300,7 +300,9 @@ function buildHTMLUnbreakable(children, options) {
|
|
|
300
300
|
// falls at the depth of the expression.
|
|
301
301
|
const strut = makeSpan(["strut"]);
|
|
302
302
|
strut.style.height = (body.height + body.depth) + "em";
|
|
303
|
-
|
|
303
|
+
if (body.depth) {
|
|
304
|
+
strut.style.verticalAlign = -body.depth + "em";
|
|
305
|
+
}
|
|
304
306
|
body.children.unshift(strut);
|
|
305
307
|
|
|
306
308
|
return body;
|
|
@@ -394,7 +396,9 @@ export default function buildHTML(tree: AnyParseNode[], options: Options): DomSp
|
|
|
394
396
|
if (tagChild) {
|
|
395
397
|
const strut = tagChild.children[0];
|
|
396
398
|
strut.style.height = (htmlNode.height + htmlNode.depth) + "em";
|
|
397
|
-
|
|
399
|
+
if (htmlNode.depth) {
|
|
400
|
+
strut.style.verticalAlign = (-htmlNode.depth) + "em";
|
|
401
|
+
}
|
|
398
402
|
}
|
|
399
403
|
|
|
400
404
|
return htmlNode;
|
|
@@ -381,8 +381,10 @@ const htmlBuilder: HtmlBuilder<"array"> = function(group, options) {
|
|
|
381
381
|
separator.style.borderRightWidth = `${ruleThickness}em`;
|
|
382
382
|
separator.style.borderRightStyle = lineType;
|
|
383
383
|
separator.style.margin = `0 -${ruleThickness / 2}em`;
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
const shift = totalHeight - offset;
|
|
385
|
+
if (shift) {
|
|
386
|
+
separator.style.verticalAlign = -shift + "em";
|
|
387
|
+
}
|
|
386
388
|
|
|
387
389
|
cols.push(separator);
|
|
388
390
|
} else {
|
package/src/fonts/Makefile
CHANGED
|
@@ -123,9 +123,9 @@ fonts: ff
|
|
|
123
123
|
\
|
|
124
124
|
echo "Hinting $$file"; \
|
|
125
125
|
if echo "$$file" | $(GREP) -q -e "Size[1-4]" -e "Typewriter"; then \
|
|
126
|
-
$(TTFAUTOHINT) --windows-compatibility --symbol ttf/$$file.ttf ttf/$$file.ttf.hinted; \
|
|
126
|
+
$(TTFAUTOHINT) -f none -S --windows-compatibility --symbol ttf/$$file.ttf ttf/$$file.ttf.hinted; \
|
|
127
127
|
else \
|
|
128
|
-
$(TTFAUTOHINT) --windows-compatibility ttf/$$file.ttf ttf/$$file.ttf.hinted; \
|
|
128
|
+
$(TTFAUTOHINT) -f none -S --windows-compatibility ttf/$$file.ttf ttf/$$file.ttf.hinted; \
|
|
129
129
|
fi; \
|
|
130
130
|
mv ttf/$$file.ttf.hinted ttf/$$file.ttf; \
|
|
131
131
|
\
|
package/src/functions/lap.js
CHANGED
|
@@ -47,7 +47,9 @@ defineFunction({
|
|
|
47
47
|
// This code resolved issue #1153
|
|
48
48
|
const strut = buildCommon.makeSpan(["strut"]);
|
|
49
49
|
strut.style.height = (node.height + node.depth) + "em";
|
|
50
|
-
|
|
50
|
+
if (node.depth) {
|
|
51
|
+
strut.style.verticalAlign = -node.depth + "em";
|
|
52
|
+
}
|
|
51
53
|
node.children.unshift(strut);
|
|
52
54
|
|
|
53
55
|
// Next, prevent vertical misplacement when next to something tall.
|
package/src/symbols.js
CHANGED
|
@@ -534,9 +534,9 @@ defineSymbol(math, main, mathord, "\u03d6", "\\varpi", true);
|
|
|
534
534
|
defineSymbol(math, main, mathord, "\u03f1", "\\varrho", true);
|
|
535
535
|
defineSymbol(math, main, mathord, "\u03c2", "\\varsigma", true);
|
|
536
536
|
defineSymbol(math, main, mathord, "\u03c6", "\\varphi", true);
|
|
537
|
-
defineSymbol(math, main, bin, "\u2217", "*");
|
|
537
|
+
defineSymbol(math, main, bin, "\u2217", "*", true);
|
|
538
538
|
defineSymbol(math, main, bin, "+", "+");
|
|
539
|
-
defineSymbol(math, main, bin, "\u2212", "-");
|
|
539
|
+
defineSymbol(math, main, bin, "\u2212", "-", true);
|
|
540
540
|
defineSymbol(math, main, bin, "\u22c5", "\\cdot", true);
|
|
541
541
|
defineSymbol(math, main, bin, "\u2218", "\\circ");
|
|
542
542
|
defineSymbol(math, main, bin, "\u00f7", "\\div", true);
|