UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing systems.

27 lines (19 loc) 590 B
import { DefaultDOMElement } from '../dom' import DOMImporter from './DOMImporter' /* Base class for custom XML importers. If you want to use HTML as your exchange format see {@link model/HTMLImporter}. TODO: provide example and activate reenable API docs */ class XMLImporter extends DOMImporter { constructor(config, context) { super(Object.assign({ idAttribute: 'id' }, config), context) } importDocument(xml) { this.reset() let dom = DefaultDOMElement.parseXML(xml) this.convertDocument(dom) return this.state.doc } } export default XMLImporter