vditor
Version:
♏ 易于使用的 Markdown 编辑器,为适配不同的应用场景而生
25 lines (24 loc) • 1.02 kB
text/typescript
export const setLute = (options: ILuteOptions) => {
const lute: Lute = Lute.New();
lute.PutEmojis(options.emojis);
lute.SetEmojiSite(options.emojiSite);
lute.SetHeadingAnchor(options.headingAnchor);
lute.SetInlineMathAllowDigitAfterOpenMarker(options.inlineMathDigit);
lute.SetAutoSpace(options.autoSpace);
lute.SetToC(options.toc);
lute.SetFootnotes(options.footnotes);
lute.SetFixTermTypo(options.fixTermTypo);
lute.SetVditorCodeBlockPreview(options.codeBlockPreview);
lute.SetVditorMathBlockPreview(options.mathBlockPreview);
lute.SetSanitize(options.sanitize);
lute.SetChineseParagraphBeginningSpace(options.paragraphBeginningSpace);
lute.SetRenderListStyle(options.listStyle);
lute.SetLinkBase(options.linkBase);
lute.SetLinkPrefix(options.linkPrefix);
lute.SetMark(options.mark);
lute.SetGFMAutoLink(options.gfmAutoLink);
if (options.lazyLoadImage) {
lute.SetImageLazyLoading(options.lazyLoadImage);
}
return lute;
};