wikiast-util-from-slate-plate-ast
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

wikiast-util-from-slate-plate-ast

Transform slate-plate based WYSIWYG editor's AST back to wikiast.

Usage

import { wikiAstFromSlateAst } from "wikiast-util-from-slate-plate-ast";

const slatePlateAst = { type: "p", children: [{ text: "AAA" }] };
const wikiast = wikiAstFromSlateAst(slatePlateAst);
// without `, start: 0, end: 3` position info.
expect(wikiast).toEqual([
  {
    type: "element",
    tag: "p",
    children: [{ type: "text" as const, text: "AAA" }],
  },
]);

Package Sidebar

Install

npm i wikiast-util-from-slate-plate-ast

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

18.3 kB

Total Files

38

Last publish

Collaborators

  • linonetwo012