MCPcopy
hub / github.com/KaTeX/KaTeX / toText

Method toText

src/tree.ts:70–78  ·  view source on GitHub ↗

* Converts the math node into a string, similar to innerText. Applies to * MathDomNode's only.

()

Source from the content-addressed store, hash-verified

68 * MathDomNode's only.
69 */
70 toText(): string {
71 return this.children.map((child: ChildType): string => {
72 if (isMathDomNode(child)) {
73 return child.toText();
74 }
75 throw new Error(
76 `Expected MathDomNode with toText, got ${child.constructor.name}`);
77 }).join("");
78 }
79}

Callers

nothing calls this directly

Calls 2

isMathDomNodeFunction · 0.85
toTextMethod · 0.65

Tested by

no test coverage detected