mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-09 13:08:40 +00:00
Correct (type-wise) raisebox's usage of sizing's buildHtml. (#1361)
* Correct (type-wise) raisebox's usage of sizing's buildHtml. * Move HTML and MathML groupTypes into defineFunction. Currently, functions defined in functions/* import all exports from buildHtml and buildMathML, but they should never use `groupTypes` directly as it loses type-safety. They should instead use more type-safe `htmlBuilder`s and `mathmlBuilder`s exported directly from other definitions `functions/*` to allow flow to catch errors. * Rename groupTypes to groupBuilders.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
// @flow
|
||||
import {groupTypes as htmlGroupTypes} from "./buildHTML";
|
||||
import {groupTypes as mathmlGroupTypes} from "./buildMathML";
|
||||
import {_htmlGroupBuilders, _mathmlGroupBuilders} from "./defineFunction";
|
||||
|
||||
import Options from "./Options";
|
||||
import ParseNode from "./ParseNode";
|
||||
@@ -114,9 +113,9 @@ export default function defineEnvironment<NODETYPE: NodeType>({
|
||||
_environments[names[i]] = data;
|
||||
}
|
||||
if (htmlBuilder) {
|
||||
htmlGroupTypes[type] = htmlBuilder;
|
||||
_htmlGroupBuilders[type] = htmlBuilder;
|
||||
}
|
||||
if (mathmlBuilder) {
|
||||
mathmlGroupTypes[type] = mathmlBuilder;
|
||||
_mathmlGroupBuilders[type] = mathmlBuilder;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user