mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
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";
|
|
});
|
|
};
|
|
};
|