Kaynağa Gözat

Add converter default options

jerryliao 1 yıl önce
ebeveyn
işleme
f9aed69e18
1 değiştirilmiş dosya ile 10 ekleme ve 2 silme
  1. 10 2
      islands/Editor.tsx

+ 10 - 2
islands/Editor.tsx

@@ -160,9 +160,17 @@ export default function Editor(props: EditorProps) {
   }, [props.content]);
   }, [props.content]);
 
 
   const convertText = (text: string) => {
   const convertText = (text: string) => {
-    // Init converter
+    // Init converter and options
     if (!converter) {
     if (!converter) {
-      converter = new showdown.Converter();
+      converter = new showdown.Converter({
+        emoji: true,
+        tables: true,
+        tasklists: true,
+        ghCodeBlocks: true,
+        tablesHeaderId: true,
+        simplifiedAutoLink: true,
+        ghCompatibleHeaderId: true,
+      });
     }
     }
 
 
     // Save display text
     // Save display text