Browse Source

Merge pull request #2617 from Yidadaa/rtl-fix

Yifei Zhang 1 year ago
parent
commit
25ada1eae9
1 changed files with 1 additions and 7 deletions
  1. 1 7
      app/components/markdown.tsx

+ 1 - 7
app/components/markdown.tsx

@@ -38,12 +38,6 @@ export function Mermaid(props: { code: string }) {
     if (!svg) return;
     const text = new XMLSerializer().serializeToString(svg);
     const blob = new Blob([text], { type: "image/svg+xml" });
-    console.log(blob);
-    // const url = URL.createObjectURL(blob);
-    // const win = window.open(url);
-    // if (win) {
-    //   win.onload = () => URL.revokeObjectURL(url);
-    // }
     showImageModal(URL.createObjectURL(blob));
   }
 
@@ -152,11 +146,11 @@ export function Markdown(
       className="markdown-body"
       style={{
         fontSize: `${props.fontSize ?? 14}px`,
-        direction: /[\u0600-\u06FF]/.test(props.content) ? "rtl" : "ltr",
       }}
       ref={mdRef}
       onContextMenu={props.onContextMenu}
       onDoubleClickCapture={props.onDoubleClickCapture}
+      dir="auto"
     >
       {props.loading ? (
         <LoadingIcon />