Major directive refactor (#195)
Fixes #188 #144 #76: major refactor of directive parsing, rendering, styling
This commit is contained in:
@@ -148,3 +148,12 @@ export function renderToText(tree: ParseTree): string {
|
||||
}
|
||||
return pieces.join("");
|
||||
}
|
||||
|
||||
export function cloneTree(tree: ParseTree): ParseTree {
|
||||
const newTree = { ...tree };
|
||||
if (tree.children) {
|
||||
newTree.children = tree.children.map(cloneTree);
|
||||
}
|
||||
delete newTree.parent;
|
||||
return newTree;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user