From fa33ee6504e7cb2c6d33250dea79ecffe6cd26e1 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 6 Oct 2026 07:52:41 +0900 Subject: [PATCH] Fix reversed RTL text in the code editors Bootstrap 5.1's reboot sets `unicode-bidi: bidi-override` on `pre`, and CodeMirror draws every line as a `pre`, so RTL text in the editor and output was shown in logical order and the cursor and selection no longer matched it. Bootstrap 5.2 dropped that rule. https://github.com/ruby/TryRuby/issues/223 https://github.com/twbs/bootstrap/pull/35230 Co-Authored-By: Claude Opus 5.5 --- source/stylesheets/application.css.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/stylesheets/application.css.scss b/source/stylesheets/application.css.scss index 45f1866..0a88d6b 100644 --- a/source/stylesheets/application.css.scss +++ b/source/stylesheets/application.css.scss @@ -252,6 +252,11 @@ pre { background: white; padding: .25em; border-radius: .5rem; + + // Undo Bootstrap's bidi-override on pre, which lays out RTL text in logical order + pre { + unicode-bidi: normal; + } } }