vditor
Version:
♏ 易于使用的 Markdown 编辑器,为适配不同的应用场景而生
12 lines (10 loc) • 443 B
text/typescript
import {getMarkdown} from "./getMarkdown";
export const getHTML = (vditor: IVditor) => {
if (vditor.currentMode === "sv") {
return vditor.lute.Md2HTML(getMarkdown(vditor));
} else if (vditor.currentMode === "wysiwyg") {
return vditor.lute.VditorDOM2HTML(vditor.wysiwyg.element.innerHTML);
} else if (vditor.currentMode === "ir") {
return vditor.lute.VditorIRDOM2HTML(vditor.ir.element.innerHTML);
}
};