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

Enable RTL mode for CodeMirror editor #2297

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Enable RTL mode for CodeMirror editor #2297

merged 1 commit into from
Jul 26, 2022

Conversation

yankl
Copy link
Contributor

@yankl yankl commented Jun 16, 2022

Background: CodeMirror 5 has the capability of being switched to RTL on the fly (cf. https://codemirror.net/5/demo/bidi.html), using the setOption method on the editor object, e.g. editor.setOption("direction", "rtl").

As mentioned here, the Editor instance is exposed in the Grav admin interface. So it should be possible to switch it to RTL as above.

However, this does not work, seemingly because of one missing line of CSS. For although the CodeMirror JS files, as far as I can tell, are pulled in as a dependency and include the RTL-enabling changes made in this commit, codemirror.css is hardcoded based on a version from before the commit, and so is missing this addition.

The attached commit corrects this accident of history, and provides the option for a plugin or a future feature addition to the Admin plugin to enable the RTL feature of the editor.

@yankl yankl mentioned this pull request Jun 24, 2022
@w00fz w00fz merged commit a3deb71 into getgrav:develop Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants