MCPcopy Index your code
hub / github.com/resend/react-email / parseNodes

Function parseNodes

packages/editor/src/extensions/prism-plugin.ts:22–41  ·  view source on GitHub ↗
(
  nodes: RefractorNode[],
  className: string[] = [],
)

Source from the content-addressed store, hash-verified

20}
21
22function parseNodes(
23 nodes: RefractorNode[],
24 className: string[] = [],
25): { text: string; classes: string[] }[] {
26 return nodes.flatMap((node) => {
27 const classes = [
28 ...className,
29 ...(node.properties ? node.properties.className : []),
30 ];
31
32 if (node.children) {
33 return parseNodes(node.children, classes);
34 }
35
36 return {
37 text: node.value ?? '',
38 classes,
39 };
40 });
41}
42
43function getHighlightNodes(html: string) {
44 return fromHtml(html, { fragment: true }).children;

Callers 1

getDecorationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected