make all classes in domTree.js PascalCase and make them named exports (#1636)

* make all classes in domTree.js PascalCase and make them named exports

* add eslint rule to enforce capitalization, fix failures

* address feedback
This commit is contained in:
Kevin Barabash
2018-08-19 10:49:21 -04:00
committed by ylemkimon
parent ead04e5a29
commit b2432e8ad2
21 changed files with 90 additions and 82 deletions

View File

@@ -14,7 +14,14 @@ import Settings from "./src/Settings";
import {buildTree, buildHTMLTree} from "./src/buildTree";
import parseTree from "./src/parseTree";
import buildCommon from "./src/buildCommon";
import domTree from "./src/domTree";
import {
Span,
Anchor,
SymbolNode,
SvgNode,
PathNode,
LineNode,
} from "./src/domTree";
import utils from "./src/utils";
import type {SettingsOptions} from "./src/Settings";
@@ -90,7 +97,7 @@ const renderError = function(
throw error;
}
const node = buildCommon.makeSpan(["katex-error"],
[new domTree.symbolNode(expression)]);
[new SymbolNode(expression)]);
node.setAttribute("title", error.toString());
node.setAttribute("style", `color:${options.errorColor}`);
return node;
@@ -196,5 +203,12 @@ export default {
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__domTree: domTree,
__domTree: {
Span,
Anchor,
SymbolNode,
SvgNode,
PathNode,
LineNode,
},
};