MCPcopy Create free account
hub / github.com/TruthHun/BookStack / staticSvg

Function staticSvg

static/katex/katex.mjs:5932–5952  ·  view source on GitHub ↗
(value, options)

Source from the content-addressed store, hash-verified

5930};
5931
5932const staticSvg = function staticSvg(value, options) {
5933 // Create a span with inline SVG for the element.
5934 const _svgData$value = svgData[value],
5935 pathName = _svgData$value[0],
5936 width = _svgData$value[1],
5937 height = _svgData$value[2];
5938 const path = new PathNode(pathName);
5939 const svgNode = new SvgNode([path], {
5940 "width": width + "em",
5941 "height": height + "em",
5942 // Override CSS rule `.katex svg { width: 100% }`
5943 "style": "width:" + width + "em",
5944 "viewBox": "0 0 " + 1000 * width + " " + 1000 * height,
5945 "preserveAspectRatio": "xMinYMin"
5946 });
5947 const span = makeSvgSpan(["overlay"], [svgNode], options);
5948 span.height = height;
5949 span.style.height = height + "em";
5950 span.style.width = width + "em";
5951 return span;
5952};
5953
5954var buildCommon = {
5955 fontMap,

Callers

nothing calls this directly

Calls 1

makeSvgSpanFunction · 0.85

Tested by

no test coverage detected