@atlaskit/editor-wikimarkup-transformer

Wiki markup transformer for JIRA and Confluence

Usage no npm install needed!

<script type="module">
  import atlaskitEditorWikimarkupTransformer from 'https://cdn.skypack.dev/@atlaskit/editor-wikimarkup-transformer';
</script>

README

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.