vue-admin-core
Version:
A Component Library for Vue 3
28 lines (25 loc) • 712 B
JavaScript
import { SlateText } from '@wangeditor/editor';
function parseParagraphHtml(elem, children, editor) {
children = children.filter((child) => {
if (SlateText.isText(child))
return true;
if (editor.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
};
export { paragraphParseHtmlConf as default };
//# sourceMappingURL=parse-elem-html.mjs.map