UNPKG

@atlaskit/editor-wikimarkup-transformer

Version:

Wiki markup transformer for JIRA and Confluence

28 lines (27 loc) 931 B
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; import _createClass from "@babel/runtime/helpers/createClass"; import { parseString } from './text'; import { normalizePMNodes } from './utils/normalize'; var AbstractTree = /*#__PURE__*/function () { function AbstractTree(schema, wikiMarkup) { _classCallCheck(this, AbstractTree); this.schema = schema; this.wikiMarkup = wikiMarkup; } /** * Convert reduced macros tree into prosemirror model tree */ return _createClass(AbstractTree, [{ key: "getProseMirrorModel", value: function getProseMirrorModel(context) { var content = parseString({ context: context, ignoreTokenTypes: [], input: this.wikiMarkup, schema: this.schema }); return this.schema.nodes.doc.createChecked({}, normalizePMNodes(content, this.schema, 'doc')); } }]); }(); export { AbstractTree as default };