Skip to content

Commit 0b5d65f

Browse files
committed
Merge branch 'fix-mu' into develop
2 parents f8bea72 + 331fea0 commit 0b5d65f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ts/input/tex/ParseUtil.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import TexParser from './TexParser.js';
3131
import TexError from './TexError.js';
3232
import {entities} from '../../util/Entities.js';
3333
import {MmlMunderover} from '../../core/MmlTree/MmlNodes/munderover.js';
34-
import {em} from '../../util/lengths.js';
3534

3635

3736
namespace ParseUtil {
@@ -107,7 +106,10 @@ namespace ParseUtil {
107106
* @return {string} The em dimension string.
108107
*/
109108
export function Em(m: number): string {
110-
return em(m);
109+
if (Math.abs(m) < .0006) {
110+
return '0em';
111+
}
112+
return m.toFixed(3).replace(/\.?0+$/, '') + 'em';
111113
}
112114

113115

@@ -525,6 +527,13 @@ namespace ParseUtil {
525527
parser.stack.global.eqnenv = true;
526528
}
527529

530+
/**
531+
* Copy an MmlNode and add it (and its children) to the proper lists.
532+
*
533+
* @param {MmlNode} node The MmlNode to copy
534+
* @param {TexParser} parser The active tex parser
535+
* @return {MmlNode} The duplicate tree
536+
*/
528537
export function copyNode(node: MmlNode, parser: TexParser): MmlNode {
529538
const tree = node.copy() as MmlNode;
530539
const options = parser.configuration;

0 commit comments

Comments
 (0)