katex 0.13.19 → 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/dist/katex.mjs CHANGED
@@ -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
- strut.style.verticalAlign = -body.depth + "em";
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
- strut.style.verticalAlign = -htmlNode.depth + "em";
6388
+
6389
+ if (htmlNode.depth) {
6390
+ strut.style.verticalAlign = -htmlNode.depth + "em";
6391
+ }
6385
6392
  }
6386
6393
 
6387
6394
  return htmlNode;
@@ -10194,7 +10201,13 @@ var htmlBuilder$7 = function htmlBuilder(group, options) {
10194
10201
  separator.style.borderRightWidth = ruleThickness + "em";
10195
10202
  separator.style.borderRightStyle = lineType;
10196
10203
  separator.style.margin = "0 -" + ruleThickness / 2 + "em";
10197
- separator.style.verticalAlign = -(totalHeight - offset) + "em";
10204
+
10205
+ var _shift = totalHeight - offset;
10206
+
10207
+ if (_shift) {
10208
+ separator.style.verticalAlign = -_shift + "em";
10209
+ }
10210
+
10198
10211
  cols.push(separator);
10199
10212
  } else {
10200
10213
  throw new ParseError("Invalid separator type: " + colDescr.separator);
@@ -10231,14 +10244,14 @@ var htmlBuilder$7 = function htmlBuilder(group, options) {
10231
10244
  continue;
10232
10245
  }
10233
10246
 
10234
- var _shift = row.pos - offset;
10247
+ var _shift2 = row.pos - offset;
10235
10248
 
10236
10249
  elem.depth = row.depth;
10237
10250
  elem.height = row.height;
10238
10251
  col.push({
10239
10252
  type: "elem",
10240
10253
  elem: elem,
10241
- shift: _shift
10254
+ shift: _shift2
10242
10255
  });
10243
10256
  }
10244
10257
 
@@ -12454,7 +12467,11 @@ defineFunction({
12454
12467
 
12455
12468
  var strut = buildCommon.makeSpan(["strut"]);
12456
12469
  strut.style.height = node.height + node.depth + "em";
12457
- strut.style.verticalAlign = -node.depth + "em";
12470
+
12471
+ if (node.depth) {
12472
+ strut.style.verticalAlign = -node.depth + "em";
12473
+ }
12474
+
12458
12475
  node.children.unshift(strut); // Next, prevent vertical misplacement when next to something tall.
12459
12476
  // This code resolves issue #1234
12460
12477
 
@@ -17722,7 +17739,7 @@ var katex = {
17722
17739
  /**
17723
17740
  * Current KaTeX version
17724
17741
  */
17725
- version: "0.13.19",
17742
+ version: "0.13.20",
17726
17743
 
17727
17744
  /**
17728
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.19",
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",
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
- strut.style.verticalAlign = -body.depth + "em";
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
- strut.style.verticalAlign = (-htmlNode.depth) + "em";
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
- separator.style.verticalAlign =
385
- -(totalHeight - offset) + "em";
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 {
@@ -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
- strut.style.verticalAlign = -node.depth + "em";
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.