UNPKG

vue-admin-core

Version:
32 lines (27 loc) 793 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var editor = require('@wangeditor/editor'); function parseParagraphHtml(elem, children, editor$1) { children = children.filter((child) => { if (editor.SlateText.isText(child)) return true; if (editor$1.isInline(child)) return true; return false; }); if (children.length === 0) { children = [{ text: elem.innerHTML.replace(/\s+/gm, " ") }]; } return { type: "paragraph", // @ts-ignore children }; } var paragraphParseHtmlConf = { selector: "p:not([data-w-e-type])", // data-w-e-type 属性,留给自定义元素,保证扩展性 parseElemHtml: parseParagraphHtml }; exports.default = paragraphParseHtmlConf; //# sourceMappingURL=parse-elem-html.js.map