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

Support RTL in the Preview pane #2524

Open
tareefdev opened this issue Aug 8, 2019 · 7 comments
Open

Support RTL in the Preview pane #2524

tareefdev opened this issue Aug 8, 2019 · 7 comments
Labels

Comments

@tareefdev
Copy link

Writing RTL text in the markdown editor works well. The text appears from right to left:

Screenshot_20190808_141727

However, when pressing on the Preview button, the text rendered without direction: rtl property and appears from left to right:

Screenshot_20190808_141930

This is different from #1769 issue where the layout of the CMS itself was requested to support RTL.

Also, I would be happy to solve this issue if there is some info about where/how that work should be done.

netlify-cms-app 2.9.1
netlify-cms-core 2.11.0

@erquhart
Copy link
Contributor

Hmm so you start typing in an RTL language and the markdown widget automatically formats it right to left? If so we'll need to see if Slate outputs anything indicating that the content is RTL, maybe the preview can key off of that.

@tareefdev
Copy link
Author

Hmm so you start typing in an RTL language and the markdown widget automatically formats it right to left?

Exactly

@yoavniran
Copy link

yoavniran commented Aug 29, 2019

@tareefdev, For the editor I use this code. (havent gotten around to PRing it yet) and its a little crude but it works:
https://gist.github.com/yoavniran/771085beb35ac0ab4b700e7b8b2f8199

The preview itself I render with an dir="rtl" wrapper so it looks right in the editor and in the preview:

I have a component I wrap all of my preview templates. This way i can also inject my custom css styles and control the direction

@stale
Copy link

stale bot commented Oct 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@ShahriarKh
Copy link

Any updates on this?
A direction button will be really helpful for the text editor.

@erezrokah
Copy link
Contributor

Hi @ShahriarKh, the best way to move this forward is by contributing. We'd happily accept a PR for this.
We use slate for the editor, so we would need to dig into slate for a solution.

@Xadoy
Copy link

Xadoy commented May 10, 2024

Additionally, when typing in other locales(e.g. Chinese), the input direction get changed to RTL incorrectly. I guess this would be the same fix.

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

No branches or pull requests

6 participants