forked from abner/for-legacy-web
11 lines
285 B
TypeScript
11 lines
285 B
TypeScript
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";
|
|
});
|
|
};
|
|
};
|