setLute.ts 879 B

123456789101112131415161718192021
  1. export const setLute = (options: ILuteOptions) => {
  2. const lute: ILute = Lute.New();
  3. lute.PutEmojis(options.emojis);
  4. lute.SetEmojiSite(options.emojiSite);
  5. lute.SetHeadingAnchor(options.headingAnchor);
  6. lute.SetInlineMathAllowDigitAfterOpenMarker(options.inlineMathDigit);
  7. lute.SetAutoSpace(options.autoSpace);
  8. lute.SetToC(options.toc);
  9. lute.SetFootnotes(options.footnotes);
  10. lute.SetChinesePunct(options.chinesePunct);
  11. lute.SetFixTermTypo(options.fixTermTypo);
  12. lute.SetVditorCodeBlockPreview(options.codeBlockPreview);
  13. lute.SetSetext(options.setext);
  14. lute.SetSanitize(options.sanitize);
  15. lute.SetChineseParagraphBeginningSpace(options.paragraphBeginningSpace);
  16. lute.SetRenderListMarker(options.listMarker);
  17. if (options.lazyLoadImage) {
  18. lute.SetImageLazyLoading(options.lazyLoadImage);
  19. }
  20. return lute;
  21. };