From b8e306062bc93fee0afd249bf0a51b82ae882bd4 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 28 Jul 2017 16:39:32 +1000 Subject: [PATCH] improve cloze and latex tag display in RTL environment https://anki.tenderapp.com/discussions/ankidesktop/24292-mixed-arabic-and-english-words --- web/editor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/editor.js b/web/editor.js index 22080748a..01247326d 100644 --- a/web/editor.js +++ b/web/editor.js @@ -209,6 +209,10 @@ function maybeDisableButtons() { }; function wrap(front, back) { + if (currentField.dir == "rtl") { + front = "‫" + front + "‬"; + back = "‫" + back + "‬"; + } var s = window.getSelection(); var r = s.getRangeAt(0); var content = r.cloneContents();