temml 0.11.10 → 0.12.1
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 +1 -1
- package/dist/temml.cjs +229 -268
- package/dist/temml.d.ts +2 -2
- package/dist/temml.js +229 -268
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +229 -268
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/Settings.js +3 -3
- package/src/buildMathML.js +1 -1
- package/src/domTree.js +1 -1
- package/src/environments/array.js +2 -3
- package/src/environments/cd.js +1 -1
- package/src/functions/accent.js +2 -2
- package/src/functions/accentunder.js +2 -2
- package/src/functions/arrow.js +2 -2
- package/src/functions/cancelto.js +1 -1
- package/src/functions/color.js +1 -1
- package/src/functions/cr.js +1 -1
- package/src/functions/delimsizing.js +4 -1
- package/src/functions/enclose.js +6 -26
- package/src/functions/envTag.js +1 -1
- package/src/functions/font.js +1 -1
- package/src/functions/genfrac.js +1 -1
- package/src/functions/horizBrace.js +2 -2
- package/src/functions/includegraphics.js +1 -1
- package/src/functions/kern.js +1 -1
- package/src/functions/label.js +1 -1
- package/src/functions/lap.js +1 -1
- package/src/functions/mclass.js +2 -2
- package/src/functions/multiscript.js +1 -1
- package/src/functions/not.js +1 -1
- package/src/functions/operatorname.js +1 -1
- package/src/functions/phantom.js +1 -1
- package/src/functions/raise.js +1 -1
- package/src/functions/rule.js +1 -1
- package/src/functions/sfrac.js +1 -1
- package/src/functions/smash.js +1 -1
- package/src/functions/sqrt.js +1 -1
- package/src/functions/supsub.js +1 -1
- package/src/functions/symbolsOp.js +1 -1
- package/src/functions/symbolsOrd.js +1 -1
- package/src/functions/symbolsSpacing.js +1 -1
- package/src/functions/tip.js +1 -1
- package/src/functions/toggle.js +1 -1
- package/src/functions/vcenter.js +1 -1
- package/src/functions/verb.js +1 -1
- package/src/linebreaking.js +1 -1
- package/src/mathMLTree.js +1 -7
- package/src/postProcess.js +1 -1
- package/src/stretchy.js +3 -8
- package/src/units.js +1 -1
- package/src/utils.js +6 -16
package/dist/temmlPostProcess.js
CHANGED
package/package.json
CHANGED
package/src/Settings.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* default settings.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import utils from "./utils";
|
|
6
|
+
import * as utils from "./utils";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The main Settings object
|
|
@@ -18,9 +18,9 @@ export default class Settings {
|
|
|
18
18
|
this.throwOnError = utils.deflt(options.throwOnError, false); // boolean
|
|
19
19
|
this.errorColor = utils.deflt(options.errorColor, "#b22222"); // string
|
|
20
20
|
this.macros = options.macros || {};
|
|
21
|
-
this.wrap = utils.deflt(options.wrap, "
|
|
21
|
+
this.wrap = utils.deflt(options.wrap, "none") // "none" | "tex" | "="
|
|
22
22
|
this.xml = utils.deflt(options.xml, false); // boolean
|
|
23
|
-
this.colorIsTextColor = utils.deflt(options.colorIsTextColor, false); //
|
|
23
|
+
this.colorIsTextColor = utils.deflt(options.colorIsTextColor, false); // boolean
|
|
24
24
|
this.strict = utils.deflt(options.strict, false); // boolean
|
|
25
25
|
this.trust = utils.deflt(options.trust, false); // trust context. See html.js.
|
|
26
26
|
this.maxSize = (options.maxSize === undefined
|
package/src/buildMathML.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* parser.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import mathMLTree from "./mathMLTree"
|
|
7
|
+
import * as mathMLTree from "./mathMLTree"
|
|
8
8
|
import ParseError from "./ParseError"
|
|
9
9
|
import symbols, { ligatures } from "./symbols"
|
|
10
10
|
import { _mathmlGroupBuilders as groupBuilders } from "./defineFunction"
|
package/src/domTree.js
CHANGED
|
@@ -2,7 +2,7 @@ import defineEnvironment from "../defineEnvironment";
|
|
|
2
2
|
import { parseCD } from "./cd";
|
|
3
3
|
import { bordermatrixParseTree } from "./borderTree.js"
|
|
4
4
|
import defineFunction from "../defineFunction";
|
|
5
|
-
import mathMLTree from "../mathMLTree";
|
|
5
|
+
import * as mathMLTree from "../mathMLTree";
|
|
6
6
|
import { Span } from "../domTree"
|
|
7
7
|
import { Token } from "../Token";
|
|
8
8
|
import { StyleLevel } from "../constants"
|
|
@@ -794,9 +794,8 @@ defineEnvironment({
|
|
|
794
794
|
numArgs: 0
|
|
795
795
|
},
|
|
796
796
|
handler(context) {
|
|
797
|
-
const payload = {
|
|
797
|
+
const payload = { envClasses: ["small"] };
|
|
798
798
|
const res = parseArray(context.parser, payload, "script");
|
|
799
|
-
res.envClasses = ["small"];
|
|
800
799
|
return res;
|
|
801
800
|
},
|
|
802
801
|
mathmlBuilder
|
package/src/environments/cd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
3
|
import * as mml from "../buildMathML";
|
|
4
4
|
import { assertSymbolNodeType } from "../parseNode";
|
|
5
5
|
import ParseError from "../ParseError";
|
package/src/functions/accent.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction, { normalizeArgument } from "../defineFunction"
|
|
2
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
-
import stretchy from "../stretchy"
|
|
2
|
+
import * as mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as stretchy from "../stretchy"
|
|
4
4
|
import * as mml from "../buildMathML"
|
|
5
5
|
|
|
6
6
|
// Identify letters to which we'll attach a combining accent character
|
package/src/functions/arrow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
3
|
-
import stretchy from "../stretchy";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
|
+
import * as stretchy from "../stretchy";
|
|
4
4
|
import { emScale } from "../units";
|
|
5
5
|
import * as mml from "../buildMathML";
|
|
6
6
|
|
package/src/functions/color.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defineFunction, { ordargument } from "../defineFunction"
|
|
2
|
-
import mathMLTree from "../mathMLTree"
|
|
2
|
+
import * as mathMLTree from "../mathMLTree"
|
|
3
3
|
import { assertNodeType } from "../parseNode"
|
|
4
4
|
import ParseError from "../ParseError"
|
|
5
5
|
import * as mml from "../buildMathML"
|
package/src/functions/cr.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Row breaks within tabular environments, and line breaks at top level
|
|
2
2
|
|
|
3
3
|
import defineFunction from "../defineFunction"
|
|
4
|
-
import mathMLTree from "../mathMLTree"
|
|
4
|
+
import * as mathMLTree from "../mathMLTree"
|
|
5
5
|
import { calculateSize } from "../units"
|
|
6
6
|
import { assertNodeType } from "../parseNode"
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
3
|
import ParseError from "../ParseError";
|
|
4
4
|
import { assertNodeType, checkSymbolNodeType } from "../parseNode";
|
|
5
5
|
|
|
@@ -115,6 +115,9 @@ const sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];
|
|
|
115
115
|
|
|
116
116
|
// Delimiter functions
|
|
117
117
|
function checkDelimiter(delim, context) {
|
|
118
|
+
if (delim.type === "ordgroup" && delim.body.length === 1) {
|
|
119
|
+
delim = delim.body[0]; // Unwrap the braces
|
|
120
|
+
}
|
|
118
121
|
const symDelim = checkSymbolNodeType(delim)
|
|
119
122
|
if (symDelim && delimiters.includes(symDelim.text)) {
|
|
120
123
|
// If a character is not in the MathML operator dictionary, it will not stretch.
|
package/src/functions/enclose.js
CHANGED
|
@@ -1,29 +1,12 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
3
|
import { assertNodeType } from "../parseNode";
|
|
4
4
|
import { colorFromSpec, validateColor } from "./color"
|
|
5
5
|
import * as mml from "../buildMathML";
|
|
6
6
|
|
|
7
|
-
const padding = _ => {
|
|
8
|
-
const node = new mathMLTree.MathNode("mspace")
|
|
9
|
-
node.setAttribute("width", "3pt")
|
|
10
|
-
return node
|
|
11
|
-
}
|
|
12
|
-
|
|
13
7
|
const mathmlBuilder = (group, style) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// MathML core does not support +width attribute in <mpadded>.
|
|
17
|
-
// Firefox does not reliably add side padding.
|
|
18
|
-
// Insert <mspace>
|
|
19
|
-
node = new mathMLTree.MathNode("mrow", [
|
|
20
|
-
padding(),
|
|
21
|
-
mml.buildGroup(group.body, style),
|
|
22
|
-
padding()
|
|
23
|
-
])
|
|
24
|
-
} else {
|
|
25
|
-
node = new mathMLTree.MathNode("menclose", [mml.buildGroup(group.body, style)])
|
|
26
|
-
}
|
|
8
|
+
const tag = group.label === "\\boxed" ? "mrow" : "menclose"
|
|
9
|
+
const node = new mathMLTree.MathNode(tag, [mml.buildGroup(group.body, style)])
|
|
27
10
|
switch (group.label) {
|
|
28
11
|
case "\\overline":
|
|
29
12
|
node.setAttribute("notation", "top") // for Firefox & WebKit
|
|
@@ -70,8 +53,7 @@ const mathmlBuilder = (group, style) => {
|
|
|
70
53
|
break
|
|
71
54
|
case "\\boxed":
|
|
72
55
|
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} from amsmath.sty
|
|
73
|
-
node.
|
|
74
|
-
node.style.padding = "padding: 3pt 0 3pt 0"
|
|
56
|
+
node.style.padding = "3pt"
|
|
75
57
|
node.style.border = "1px solid"
|
|
76
58
|
node.setAttribute("scriptlevel", "0")
|
|
77
59
|
node.setAttribute("displaystyle", "true")
|
|
@@ -88,12 +70,10 @@ const mathmlBuilder = (group, style) => {
|
|
|
88
70
|
//const fboxsep = 3; // 3 pt from LaTeX source2e
|
|
89
71
|
//node.setAttribute("height", `+${2 * fboxsep}pt`)
|
|
90
72
|
//node.setAttribute("voffset", `${fboxsep}pt`)
|
|
91
|
-
|
|
92
|
-
|
|
73
|
+
node.style.padding = "3pt"
|
|
93
74
|
if (group.label === "\\fcolorbox") {
|
|
94
|
-
style.border = "0.0667em solid " + String(group.borderColor)
|
|
75
|
+
node.style.border = "0.0667em solid " + String(group.borderColor)
|
|
95
76
|
}
|
|
96
|
-
node.style = style
|
|
97
77
|
break
|
|
98
78
|
}
|
|
99
79
|
}
|
package/src/functions/envTag.js
CHANGED
package/src/functions/font.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction, { normalizeArgument } from "../defineFunction"
|
|
2
2
|
import * as mml from "../buildMathML"
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
|
|
5
5
|
const isLongVariableName = (group, font) => {
|
|
6
6
|
if (font !== "mathrm" || group.body.type !== "ordgroup" || group.body.body.length === 1) {
|
package/src/functions/genfrac.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import defineFunction, { normalizeArgument } from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
3
|
import { StyleLevel } from "../constants"
|
|
4
4
|
import { assertNodeType } from "../parseNode";
|
|
5
5
|
import { assert } from "../utils";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction";
|
|
2
|
-
import mathMLTree from "../mathMLTree";
|
|
3
|
-
import stretchy from "../stretchy";
|
|
2
|
+
import * as mathMLTree from "../mathMLTree";
|
|
3
|
+
import * as stretchy from "../stretchy";
|
|
4
4
|
import * as mml from "../buildMathML";
|
|
5
5
|
|
|
6
6
|
const mathmlBuilder = (group, style) => {
|
|
@@ -2,7 +2,7 @@ import defineFunction from "../defineFunction"
|
|
|
2
2
|
import { calculateSize, validUnit } from "../units"
|
|
3
3
|
import ParseError from "../ParseError"
|
|
4
4
|
import { Img } from "../domTree"
|
|
5
|
-
import mathMLTree from "../mathMLTree"
|
|
5
|
+
import * as mathMLTree from "../mathMLTree"
|
|
6
6
|
import { assertNodeType } from "../parseNode"
|
|
7
7
|
|
|
8
8
|
const sizeData = function(str) {
|
package/src/functions/kern.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Horizontal spacing commands
|
|
2
2
|
|
|
3
3
|
import defineFunction from "../defineFunction";
|
|
4
|
-
import mathMLTree from "../mathMLTree";
|
|
4
|
+
import * as mathMLTree from "../mathMLTree";
|
|
5
5
|
import { calculateSize } from "../units";
|
|
6
6
|
import { assertNodeType } from "../parseNode";
|
|
7
7
|
import ParseError from "../ParseError"
|
package/src/functions/label.js
CHANGED
package/src/functions/lap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Horizontal overlap functions
|
|
2
2
|
import defineFunction, { ordargument } from "../defineFunction";
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
import * as mml from "../buildMathML"
|
|
5
5
|
import ParseError from "../ParseError";
|
|
6
6
|
|
package/src/functions/mclass.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import defineFunction, { ordargument } from "../defineFunction";
|
|
2
2
|
import symbols from "../symbols";
|
|
3
|
-
import mathMLTree from "../mathMLTree";
|
|
4
|
-
import utils from "../utils.js"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree";
|
|
4
|
+
import * as utils from "../utils.js"
|
|
5
5
|
import { padding } from "./arrow";
|
|
6
6
|
|
|
7
7
|
import * as mml from "../buildMathML";
|
package/src/functions/not.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction, { ordargument } from "../defineFunction"
|
|
2
2
|
import defineMacro from "../defineMacro";
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
import { spaceCharacter } from "./kern"
|
|
5
5
|
import { ordTypes } from "./op"
|
|
6
6
|
import { isDelimiter } from "./delimsizing"
|
package/src/functions/phantom.js
CHANGED
package/src/functions/raise.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defineFunction from "../defineFunction"
|
|
2
2
|
import { StyleLevel } from "../constants"
|
|
3
|
-
import mathMLTree from "../mathMLTree"
|
|
3
|
+
import * as mathMLTree from "../mathMLTree"
|
|
4
4
|
import { assertNodeType } from "../parseNode"
|
|
5
5
|
import { calculateSize } from "../units"
|
|
6
6
|
import * as mml from "../buildMathML"
|
package/src/functions/rule.js
CHANGED
package/src/functions/sfrac.js
CHANGED
package/src/functions/smash.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// smash, with optional [tb], as in AMS
|
|
2
2
|
import defineFunction from "../defineFunction";
|
|
3
|
-
import mathMLTree from "../mathMLTree";
|
|
3
|
+
import * as mathMLTree from "../mathMLTree";
|
|
4
4
|
import { assertNodeType } from "../parseNode";
|
|
5
5
|
|
|
6
6
|
import * as mml from "../buildMathML";
|
package/src/functions/sqrt.js
CHANGED
package/src/functions/supsub.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineFunctionBuilders } from "../defineFunction"
|
|
2
2
|
import { getVariant } from "../variant"
|
|
3
3
|
import { variantChar, smallCaps } from "../replace"
|
|
4
|
-
import mathMLTree from "../mathMLTree"
|
|
4
|
+
import * as mathMLTree from "../mathMLTree"
|
|
5
5
|
import * as mml from "../buildMathML"
|
|
6
6
|
|
|
7
7
|
// "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
|
package/src/functions/tip.js
CHANGED
package/src/functions/toggle.js
CHANGED
package/src/functions/vcenter.js
CHANGED
package/src/functions/verb.js
CHANGED
package/src/linebreaking.js
CHANGED
package/src/mathMLTree.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* HTML text markup respectively.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import utils from "./utils";
|
|
8
|
+
import * as utils from "./utils";
|
|
9
9
|
import { DocumentFragment } from "./tree";
|
|
10
10
|
import { createClass } from "./domTree";
|
|
11
11
|
|
|
@@ -172,9 +172,3 @@ export const wrapWithMstyle = expression => {
|
|
|
172
172
|
}
|
|
173
173
|
return node
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
export default {
|
|
177
|
-
MathNode,
|
|
178
|
-
TextNode,
|
|
179
|
-
newDocumentFragment
|
|
180
|
-
};
|
package/src/postProcess.js
CHANGED
package/src/stretchy.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file provides support for building horizontal stretchy elements.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import mathMLTree from "./mathMLTree"
|
|
5
|
+
import * as mathMLTree from "./mathMLTree"
|
|
6
6
|
|
|
7
7
|
// TODO: Remove when Chromium stretches \widetilde & \widehat
|
|
8
8
|
const estimatedWidth = node => {
|
|
@@ -89,7 +89,7 @@ const stretchyCodePoint = {
|
|
|
89
89
|
chemequilibrium: "\u21cc"
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
const mathMLnode = function(label) {
|
|
92
|
+
export const mathMLnode = function(label) {
|
|
93
93
|
const child = new mathMLTree.TextNode(stretchyCodePoint[label.slice(1)])
|
|
94
94
|
const node = new mathMLTree.MathNode("mo", [child])
|
|
95
95
|
node.setAttribute("stretchy", "true")
|
|
@@ -99,7 +99,7 @@ const mathMLnode = function(label) {
|
|
|
99
99
|
const crookedWides = ["\\widetilde", "\\widehat", "\\widecheck", "\\utilde"]
|
|
100
100
|
|
|
101
101
|
// TODO: Remove when Chromium stretches \widetilde & \widehat
|
|
102
|
-
const accentNode = (group) => {
|
|
102
|
+
export const accentNode = (group) => {
|
|
103
103
|
const mo = mathMLnode(group.label)
|
|
104
104
|
if (crookedWides.includes(group.label)) {
|
|
105
105
|
const width = estimatedWidth(group.base)
|
|
@@ -113,8 +113,3 @@ const accentNode = (group) => {
|
|
|
113
113
|
}
|
|
114
114
|
return mo
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
export default {
|
|
118
|
-
mathMLnode,
|
|
119
|
-
accentNode
|
|
120
|
-
}
|
package/src/units.js
CHANGED
package/src/utils.js
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Provide a default value if a setting is undefined
|
|
9
9
|
*/
|
|
10
|
-
const deflt = function(setting, defaultIfUndefined) {
|
|
10
|
+
export const deflt = function(setting, defaultIfUndefined) {
|
|
11
11
|
return setting === undefined ? defaultIfUndefined : setting;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
// hyphenate and escape adapted from Facebook's React under Apache 2 license
|
|
15
15
|
|
|
16
16
|
const uppercase = /([A-Z])/g;
|
|
17
|
-
const hyphenate = function(str) {
|
|
17
|
+
export const hyphenate = function(str) {
|
|
18
18
|
return str.replace(uppercase, "-$1").toLowerCase();
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -31,7 +31,7 @@ const ESCAPE_REGEX = /[&><"']/g;
|
|
|
31
31
|
/**
|
|
32
32
|
* Escapes text to prevent scripting attacks.
|
|
33
33
|
*/
|
|
34
|
-
function escape(text) {
|
|
34
|
+
export function escape(text) {
|
|
35
35
|
return String(text).replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]);
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ function escape(text) {
|
|
|
40
40
|
* cases, this will just be the group itself, but when ordgroups and colors have
|
|
41
41
|
* a single element, we want to pull that out.
|
|
42
42
|
*/
|
|
43
|
-
const getBaseElem = function(group) {
|
|
43
|
+
export const getBaseElem = function(group) {
|
|
44
44
|
if (group.type === "ordgroup") {
|
|
45
45
|
if (group.body.length === 1) {
|
|
46
46
|
return getBaseElem(group.body[0]);
|
|
@@ -65,7 +65,7 @@ const getBaseElem = function(group) {
|
|
|
65
65
|
* with a single character in them. To decide if something is a character box,
|
|
66
66
|
* we find its innermost group, and see if it is a single character.
|
|
67
67
|
*/
|
|
68
|
-
const isCharacterBox = function(group) {
|
|
68
|
+
export const isCharacterBox = function(group) {
|
|
69
69
|
const baseElem = getBaseElem(group);
|
|
70
70
|
|
|
71
71
|
// These are all the types of groups which hold single characters
|
|
@@ -112,16 +112,6 @@ export const protocolFromUrl = function(url) {
|
|
|
112
112
|
* 1/6551.6em with our ptPerEm = 10):
|
|
113
113
|
* http://www.ctex.org/documents/shredder/src/texbook.pdf#page=69
|
|
114
114
|
*/
|
|
115
|
-
const round = function(n) {
|
|
115
|
+
export const round = function(n) {
|
|
116
116
|
return +n.toFixed(4);
|
|
117
117
|
};
|
|
118
|
-
|
|
119
|
-
export default {
|
|
120
|
-
deflt,
|
|
121
|
-
escape,
|
|
122
|
-
hyphenate,
|
|
123
|
-
getBaseElem,
|
|
124
|
-
isCharacterBox,
|
|
125
|
-
protocolFromUrl,
|
|
126
|
-
round
|
|
127
|
-
};
|