mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-16 16:28:39 +00:00
Port domTree and buildCommon to @flow. (#938)
* Port domTree to @flow. * Port buildCommon to @flow. * Change domTree attribute arrays to attribute objects.
This commit is contained in:
@@ -333,11 +333,13 @@ const sqrtSvg = function(sqrtName, height, viewBoxHeight, options) {
|
||||
}
|
||||
const pathNode = new domTree.pathNode(sqrtName, alternate);
|
||||
|
||||
// Note: 1000:1 ratio of viewBox to document em width.
|
||||
const attributes = [["width", "400em"], ["height", height + "em"]];
|
||||
attributes.push(["viewBox", "0 0 400000 " + viewBoxHeight]);
|
||||
attributes.push(["preserveAspectRatio", "xMinYMin slice"]);
|
||||
const svg = new domTree.svgNode([pathNode], attributes);
|
||||
const svg = new domTree.svgNode([pathNode], {
|
||||
// Note: 1000:1 ratio of viewBox to document em width.
|
||||
"width": "400em",
|
||||
"height": height + "em",
|
||||
"viewBox": "0 0 400000 " + viewBoxHeight,
|
||||
"preserveAspectRatio": "xMinYMin slice",
|
||||
});
|
||||
|
||||
return buildCommon.makeSpan(["hide-tail"], [svg], options);
|
||||
};
|
||||
|
Reference in New Issue
Block a user