@atlaskit/editor-wikimarkup-transformer
Version:
Wiki markup transformer for JIRA and Confluence
43 lines (25 loc) • 1.37 kB
Markdown
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.
```js
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
```
```js
import { WikiMarkupTransformer } from '@atlaskit/editor-wikimarkup-transformer';
const transformer = new WikiMarkupTransformer(schema);
const pmNode = transformer.parse(wikiMarkup); // A prosemirror node is output
```
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.
The tests for this project is stored in `src/__tests__`.
Detailed docs and example usage can be found [here](https://atlaskit.atlassian.com/packages/editor/editor-wikimarkup-transformer).