From 05460d8ecc9d73bccc1b88fc3cd0615ae5f9fc80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 30 May 2023 19:59:34 -0400 Subject: [PATCH] fix: rtl fixes for code and long text closes #11643, closes #11655 --- public/scss/global.scss | 14 ++++++++++++++ public/src/client/topic.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/public/scss/global.scss b/public/scss/global.scss index 7fb8234708..394eec646e 100644 --- a/public/scss/global.scss +++ b/public/scss/global.scss @@ -6,3 +6,17 @@ ========== */ +// rtl fixes for text-break and code blocks +/*rtl:begin:ignore*/ +html[data-dir="rtl"] { + .text-break { + word-wrap: break-word!important; + word-break: break-word!important; + } + + [component="post/content"] code { + direction: ltr; + text-align: left; + } +} +/*rtl:end:ignore*/ diff --git a/public/src/client/topic.js b/public/src/client/topic.js index da5ecae1b0..3206bb4466 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -241,7 +241,7 @@ define('forum/topic', [ let codeBlocks = $('[component="topic"] [component="post/content"] code:not([data-button-added])'); codeBlocks = codeBlocks.filter((i, el) => $(el).text().includes('\n')); const container = $('
'); - const buttonDiv = $(''); + const buttonDiv = $(''); codeBlocks.parent().wrap(container).parent().append(buttonDiv); codeBlocks.parent().parent().find('[component="copy/code/btn"]').translateAttr('title', '[[topic:copy-code]]'); codeBlocks.attr('data-button-added', 1);