MCPcopy
hub / github.com/KaTeX/KaTeX / LineNode

Class LineNode

src/domTree.ts:576–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576export class LineNode implements VirtualNode {
577 attributes: Record<string, string>;
578
579 constructor(
580 attributes?: Record<string, string>,
581 ) {
582 this.attributes = attributes || {};
583 }
584
585 toNode(): Node {
586 const svgNS = "http://www.w3.org/2000/svg";
587 const node = document.createElementNS(svgNS, "line");
588
589 // Apply attributes
590 for (const attr of Object.keys(this.attributes)) {
591 node.setAttribute(attr, this.attributes[attr]);
592 }
593
594 return node;
595 }
596
597 toMarkup(): string {
598 let markup = "<line";
599
600 for (const attr of Object.keys(this.attributes)) {
601 markup += ` ${attr}="${escape(this.attributes[attr])}"`;
602 }
603
604 markup += "/>";
605
606 return markup;
607 }
608}
609
610export function assertSymbolDomNode(
611 group: HtmlDomNode,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…