ソースを参照

Add converter default options

jerryliao 1 年間 前
コミット
f9aed69e18
1 ファイル変更10 行追加2 行削除
  1. 10 2
      islands/Editor.tsx

+ 10 - 2
islands/Editor.tsx

@@ -160,9 +160,17 @@ export default function Editor(props: EditorProps) {
   }, [props.content]);
 
   const convertText = (text: string) => {
-    // Init converter
+    // Init converter and options
     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