Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code block direction in RTL interface #4809

Closed
okaeiz opened this issue Jan 28, 2024 · 2 comments
Closed

Code block direction in RTL interface #4809

okaeiz opened this issue Jan 28, 2024 · 2 comments

Comments

@okaeiz
Copy link

okaeiz commented Jan 28, 2024

Describe the Bug

When we create a code block in a RTL page and modify its direction to LTR, it looks flawless in the editing mode. But when we save the document, it goes RTL and is not properly readable.

Steps to Reproduce

  1. Go to an RTL interface.
  2. Create a code block in a page.
  3. In edit mode, make it left to right.
  4. Save the page.
  5. See? It is right to left.

Expected Behaviour

The code is expected to be rendered left to right regardless of the interface language.

Screenshots or Additional Context

Capture

Browser Details

Google Chrome Version 104.0.5112.102 (Official Build) (64-bit) On Windows 10

Exact BookStack Version

BookStack v23.12

@ssddanbrown
Copy link
Member

Thanks for reporting @okaeiz, I've assigned this to be fixed in the next feature release.
If a temporary workaround was desired, you can add this below code to the "Custom HTML Head Content" customization setting to force all code blocks to ltr:

<style>
  .cm-editor, .page-content pre {direction: ltr;}
</style>

ssddanbrown added a commit that referenced this issue Feb 18, 2024
Specifically supports "dir" attribute being on top level "pre" element,
and handles application/switching of this within the editor.

For #4809
@ssddanbrown
Copy link
Member

This has now been addressed within commit 999d41a.
This will be part of the next feature release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants