MCPcopy Index your code
hub / github.com/lingodotdev/lingo.dev / setInnerHTML

Function setInnerHTML

packages/cli/src/cli/loaders/mjml.ts:205–222  ·  view source on GitHub ↗
(node: any, htmlContent: string)

Source from the content-addressed store, hash-verified

203}
204
205function setInnerHTML(node: any, htmlContent: string): void {
206 const handler = new DomHandler();
207 const parser = new htmlparser2.Parser(handler);
208 parser.write(htmlContent);
209 parser.end();
210
211 const newChildren: any[] = [];
212
213 for (const domNode of handler.dom) {
214 const xmlNode = convertDomToXmlNode(domNode);
215 if (xmlNode) {
216 newChildren.push(xmlNode);
217 }
218 }
219
220 node.$$ = newChildren;
221 node._ = htmlContent;
222}
223
224function serializeXmlNode(node: any): string {
225 const name = node["#name"];

Callers 1

pushFunction · 0.85

Calls 3

convertDomToXmlNodeFunction · 0.85
writeMethod · 0.80
pushMethod · 0.65

Tested by

no test coverage detected