UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

26 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var prosemirror_1 = require("../../prosemirror"); var serializer_1 = require("./serializer"); var schema_1 = require("../../schema"); var util_1 = require("./util"); var BitbucketTransformer = (function () { function BitbucketTransformer(schema) { if (schema === void 0) { schema = schema_1.bitbucketSchema; } this.serializer = new serializer_1.MarkdownSerializer(serializer_1.nodes, serializer_1.marks); this.schema = schema; } BitbucketTransformer.prototype.encode = function (node) { return this.serializer.serialize(node); }; BitbucketTransformer.prototype.parse = function (html) { var dom = this.buildDOMTree(html); return prosemirror_1.DOMParser.fromSchema(this.schema).parse(dom); }; BitbucketTransformer.prototype.buildDOMTree = function (html) { return util_1.transformHtml(html); }; return BitbucketTransformer; }()); exports.default = BitbucketTransformer; //# sourceMappingURL=index.js.map