@atlaskit/editor-wikimarkup-transformer
TypeScript icon, indicating that this package has built-in type declarations

11.2.46 • Public • Published

Editor Wikimarkup Transformer

This transformer allows encoding Prosemirror node -> Wikimarkup and parsing Wikimarkup -> Prosemirror node.

Some nodes support roundtripping, where it has capability of transforming to and from each syntax.

Usage

Encoding ADF to Wikimarkup

import { WikiMarkupTransformer } from '@atlaskit/editor-wikimarkup-transformer';

const transformer = new WikiMarkupTransformer(schema);
const wikimarkupString = transformer.encode(pmNode); // A Wikimarkup string representing the Prosemirror node output

Parsing Wikimarkup to ADF

import { WikiMarkupTransformer } from '@atlaskit/editor-wikimarkup-transformer';

const transformer = new WikiMarkupTransformer(schema);
const pmNode = transformer.parse(wikiMarkup); // A prosemirror node is output

Development

This project consists of encoders and parsers in order to tranform between ADF and Wikimarkup.

  • If converting to Wikimarkup, encoders are stored in src/encoder
  • If converting from Wikimarkup, parsers are stored in src/parser

In each of these locations, you can find the nodes and marks for each component.

Testing

The tests for this project is stored in src/__tests__.

More info

Detailed docs and example usage can be found here.

Readme

Keywords

none

Package Sidebar

Install

npm i @atlaskit/editor-wikimarkup-transformer

Weekly Downloads

3,582

Version

11.2.46

License

Apache-2.0

Unpacked Size

836 kB

Total Files

545

Last publish

Collaborators

  • atlaskit