Browse Source

Set markdown-body RTL for Arabic text

Zizwar 1 year ago
parent
commit
15f8d13d81
2 changed files with 2 additions and 0 deletions
  1. 1 0
      app/components/markdown.tsx
  2. 1 0
      app/styles/markdown.scss

+ 1 - 0
app/components/markdown.tsx

@@ -195,6 +195,7 @@ export function Markdown(
         fontSize: `${props.fontSize ?? 14}px`,
         height: getSize(renderedHeight.current),
         width: getSize(renderedWidth.current),
+        direction: /[\u0600-\u06FF]/.test(props.content) ? "rtl" : "ltr",
       }}
       ref={mdRef}
       onContextMenu={props.onContextMenu}

+ 1 - 0
app/styles/markdown.scss

@@ -844,6 +844,7 @@
   font-size: 85%;
   line-height: 1.45;
   border-radius: 6px;
+  direction: ltr;
 }
 
 .markdown-body pre code,