From 15f8d13d8199049daf55a3fb182a6822be3cf274 Mon Sep 17 00:00:00 2001 From: Zizwar Date: Sat, 24 Jun 2023 05:53:58 +0000 Subject: [PATCH] Set markdown-body RTL for Arabic text --- app/components/markdown.tsx | 1 + app/styles/markdown.scss | 1 + 2 files changed, 2 insertions(+) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index fbde6453..4db5f573 100644 --- a/app/components/markdown.tsx +++ b/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} diff --git a/app/styles/markdown.scss b/app/styles/markdown.scss index 31d10c4c..672167d4 100644 --- a/app/styles/markdown.scss +++ b/app/styles/markdown.scss @@ -844,6 +844,7 @@ font-size: 85%; line-height: 1.45; border-radius: 6px; + direction: ltr; } .markdown-body pre code,