temml 0.11.5 → 0.11.6

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/temml.mjs CHANGED
@@ -769,10 +769,12 @@ var mathMLTree = {
769
769
  // TODO: Remove when Chromium stretches \widetilde & \widehat
770
770
  const estimatedWidth = node => {
771
771
  let width = 0;
772
- if (node.body) {
772
+ if (node.body && Array.isArray(node.body)) {
773
773
  for (const item of node.body) {
774
774
  width += estimatedWidth(item);
775
775
  }
776
+ } else if (node.body) {
777
+ width += estimatedWidth(node.body);
776
778
  } else if (node.type === "supsub") {
777
779
  width += estimatedWidth(node.base);
778
780
  if (node.sub) { width += 0.7 * estimatedWidth(node.sub); }
@@ -13970,7 +13972,7 @@ class Style {
13970
13972
  * https://mit-license.org/
13971
13973
  */
13972
13974
 
13973
- const version = "0.11.05";
13975
+ const version = "0.11.06";
13974
13976
 
13975
13977
  function postProcess(block) {
13976
13978
  const labelMap = {};
@@ -11,7 +11,7 @@
11
11
  * https://mit-license.org/
12
12
  */
13
13
 
14
- const version = "0.11.05";
14
+ const version = "0.11.06";
15
15
 
16
16
  function postProcess(block) {
17
17
  const labelMap = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "temml",
3
- "version": "0.11.05",
3
+ "version": "0.11.06",
4
4
  "description": "TeX to MathML conversion in JavaScript.",
5
5
  "main": "dist/temml.js",
6
6
  "engines": {
@@ -5,7 +5,7 @@
5
5
  * https://mit-license.org/
6
6
  */
7
7
 
8
- export const version = "0.11.05";
8
+ export const version = "0.11.06";
9
9
 
10
10
  export function postProcess(block) {
11
11
  const labelMap = {}
package/src/stretchy.js CHANGED
@@ -7,10 +7,12 @@ import mathMLTree from "./mathMLTree"
7
7
  // TODO: Remove when Chromium stretches \widetilde & \widehat
8
8
  const estimatedWidth = node => {
9
9
  let width = 0
10
- if (node.body) {
10
+ if (node.body && Array.isArray(node.body)) {
11
11
  for (const item of node.body) {
12
12
  width += estimatedWidth(item)
13
13
  }
14
+ } else if (node.body) {
15
+ width += estimatedWidth(node.body)
14
16
  } else if (node.type === "supsub") {
15
17
  width += estimatedWidth(node.base)
16
18
  if (node.sub) { width += 0.7 * estimatedWidth(node.sub) }