temml 0.11.11 → 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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/dist/temml.cjs +208 -230
  3. package/dist/temml.d.ts +2 -2
  4. package/dist/temml.js +208 -230
  5. package/dist/temml.min.js +1 -1
  6. package/dist/temml.mjs +208 -230
  7. package/dist/temmlPostProcess.js +1 -1
  8. package/package.json +1 -1
  9. package/src/Settings.js +3 -3
  10. package/src/buildMathML.js +1 -1
  11. package/src/domTree.js +1 -1
  12. package/src/environments/array.js +2 -3
  13. package/src/environments/cd.js +1 -1
  14. package/src/functions/accent.js +2 -2
  15. package/src/functions/accentunder.js +2 -2
  16. package/src/functions/arrow.js +2 -2
  17. package/src/functions/cancelto.js +1 -1
  18. package/src/functions/color.js +1 -1
  19. package/src/functions/cr.js +1 -1
  20. package/src/functions/delimsizing.js +1 -1
  21. package/src/functions/enclose.js +3 -3
  22. package/src/functions/envTag.js +1 -1
  23. package/src/functions/font.js +1 -1
  24. package/src/functions/genfrac.js +1 -1
  25. package/src/functions/horizBrace.js +2 -2
  26. package/src/functions/includegraphics.js +1 -1
  27. package/src/functions/kern.js +1 -1
  28. package/src/functions/label.js +1 -1
  29. package/src/functions/lap.js +1 -1
  30. package/src/functions/mclass.js +2 -2
  31. package/src/functions/multiscript.js +1 -1
  32. package/src/functions/not.js +1 -1
  33. package/src/functions/operatorname.js +1 -1
  34. package/src/functions/phantom.js +1 -1
  35. package/src/functions/raise.js +1 -1
  36. package/src/functions/rule.js +1 -1
  37. package/src/functions/sfrac.js +1 -1
  38. package/src/functions/smash.js +1 -1
  39. package/src/functions/sqrt.js +1 -1
  40. package/src/functions/supsub.js +1 -1
  41. package/src/functions/symbolsOp.js +1 -1
  42. package/src/functions/symbolsOrd.js +1 -1
  43. package/src/functions/symbolsSpacing.js +1 -1
  44. package/src/functions/tip.js +1 -1
  45. package/src/functions/toggle.js +1 -1
  46. package/src/functions/vcenter.js +1 -1
  47. package/src/functions/verb.js +1 -1
  48. package/src/linebreaking.js +1 -1
  49. package/src/mathMLTree.js +1 -7
  50. package/src/postProcess.js +1 -1
  51. package/src/stretchy.js +3 -8
  52. package/src/units.js +1 -1
  53. package/src/utils.js +6 -16
@@ -11,7 +11,7 @@
11
11
  * https://mit-license.org/
12
12
  */
13
13
 
14
- const version = "0.11.11";
14
+ const version = "0.12.01";
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.11",
3
+ "version": "0.12.01",
4
4
  "description": "TeX to MathML conversion in JavaScript.",
5
5
  "main": "dist/temml.js",
6
6
  "engines": {
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, "tex") // "tex" | "="
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); // booelean
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
@@ -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
@@ -8,7 +8,7 @@
8
8
  * Similar functions for working with MathML nodes exist in mathMLTree.js.
9
9
  *
10
10
  */
11
- import utils from "./utils";
11
+ import * as utils from "./utils";
12
12
 
13
13
  /**
14
14
  * Create an HTML className based on a list of classes. In addition to joining
@@ -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 = { type: "small" };
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
@@ -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";
@@ -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
@@ -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
 
5
5
  import * as mml from "../buildMathML";
6
6
 
@@ -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
 
@@ -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
 
5
5
  defineFunction({
@@ -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"
@@ -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
 
@@ -1,11 +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
7
  const mathmlBuilder = (group, style) => {
8
- const node = new mathMLTree.MathNode("menclose", [mml.buildGroup(group.body, style)])
8
+ const tag = group.label === "\\boxed" ? "mrow" : "menclose"
9
+ const node = new mathMLTree.MathNode(tag, [mml.buildGroup(group.body, style)])
9
10
  switch (group.label) {
10
11
  case "\\overline":
11
12
  node.setAttribute("notation", "top") // for Firefox & WebKit
@@ -52,7 +53,6 @@ const mathmlBuilder = (group, style) => {
52
53
  break
53
54
  case "\\boxed":
54
55
  // \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} from amsmath.sty
55
- node.setAttribute("notation", "box")
56
56
  node.style.padding = "3pt"
57
57
  node.style.border = "1px solid"
58
58
  node.setAttribute("scriptlevel", "0")
@@ -1,5 +1,5 @@
1
1
  import defineFunction from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
 
4
4
  defineFunction({
5
5
  type: "envTag",
@@ -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) {
@@ -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) {
@@ -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"
@@ -1,5 +1,5 @@
1
1
  import defineFunction from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
 
4
4
  // Limit valid characters to a small set, for safety.
5
5
  export const invalidIdRegEx = /[^A-Za-z_0-9-]/g
@@ -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
 
@@ -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";
@@ -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 ParseError from "../ParseError";
5
5
 
@@ -1,7 +1,7 @@
1
1
  import defineFunction, { ordargument } from "../defineFunction";
2
2
  import symbols from "../symbols";
3
3
  import * as mml from "../buildMathML";
4
- import utils from "../utils"
4
+ import * as utils from "../utils"
5
5
 
6
6
  defineFunction({
7
7
  type: "not",
@@ -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"
@@ -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 * as mml from "../buildMathML";
4
4
 
5
5
  defineFunction({
@@ -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"
@@ -1,5 +1,5 @@
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 { calculateSize } from "../units";
5
5
 
@@ -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
 
5
5
  const numRegEx = /^[0-9]$/
@@ -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";
@@ -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
 
5
5
  // Letters that are x-height w/o a descender.
@@ -1,6 +1,6 @@
1
1
  import { defineFunctionBuilders } from "../defineFunction"
2
2
  import { StyleLevel } from "../constants"
3
- import mathMLTree from "../mathMLTree"
3
+ import * as mathMLTree from "../mathMLTree"
4
4
  import * as mml from "../buildMathML"
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { defineFunctionBuilders } from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
  import * as mml from "../buildMathML";
4
4
  import { padding } from "./arrow";
5
5
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  import { defineFunctionBuilders } from "../defineFunction"
2
- import mathMLTree from "../mathMLTree"
2
+ import * as mathMLTree from "../mathMLTree"
3
3
  import ParseError from "../ParseError"
4
4
 
5
5
  // A map of CSS-based spacing functions to their CSS class.
@@ -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
 
5
5
  // Two functions included to enable migration from Mathjax.
@@ -1,5 +1,5 @@
1
1
  import { defineFunctionBuilders } from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
  import * as mml from "../buildMathML";
4
4
 
5
5
  defineFunctionBuilders({
@@ -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
 
5
5
  // \vcenter: Vertically center the argument group on the math axis.
@@ -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
 
5
5
  defineFunction({
@@ -1,4 +1,4 @@
1
- import mathMLTree from "./mathMLTree"
1
+ import * as mathMLTree from "./mathMLTree"
2
2
  import { DocumentFragment } from "./tree"
3
3
 
4
4
  /*
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
- };
@@ -5,7 +5,7 @@
5
5
  * https://mit-license.org/
6
6
  */
7
7
 
8
- export const version = "0.11.11";
8
+ export const version = "0.12.01";
9
9
 
10
10
  export function postProcess(block) {
11
11
  const labelMap = {}
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
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import ParseError from "./ParseError"
7
- import utils from "./utils"
7
+ import * as utils from "./utils"
8
8
 
9
9
  const ptPerUnit = {
10
10
  // Convert to CSS (Postscipt) points, not TeX points
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
- };