wikiast-util-to-slate-plate-ast
v0.3.0
Published
Get SlateJS AST from Wiki AST
Downloads
3
Maintainers
Readme
wikiast-util-to-slate-plate-ast
Get SlateJS AST (udecode/plate variant) from Wiki AST.
Usage
import { wikiAstToSlateAst } from "wikiast-util-to-slate-plate-ast";
const wikiast = [
{
type: "element",
tag: "p",
children: [{ type: "text" as const, text: "AAA", start: 0, end: 3 }],
start: 0,
end: 3,
},
];
const slatePlateAst = wikiAstToSlateAst(wikiast);
expect(slatePlateAst).toEqual({ type: "p", children: [{ text: "AAA" }] });