feat: convert html AST nodes to text

This commit is contained in:
Paul Makles
2022-07-13 12:32:39 +01:00
parent 2214efe1bc
commit 4f3f6e26cf
3 changed files with 12 additions and 12 deletions

View File

@@ -0,0 +1,10 @@
import { Plugin } from "unified";
import { visit } from "unist-util-visit";
export const remarkHtmlToText: Plugin = () => {
return (tree) => {
visit(tree, "html", (node: { type: string; value: string }) => {
node.type = "text";
});
};
};