Ionaru / Ionaru/easy-markdown-editor
Preview ignores the direction passed to CodeMirror, and uses the surrounding direction
- Dominant language
- JavaScript
- Stars
- 3.1k
- Forks
- 363
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Even though I've passed `direction: rtl` to the options, the preview ignores this option. Instead it always follows the surrounding direction.
**To Reproduce**
Steps to reproduce the behavior:
1. Pass `direction: rtl` into the configuration
2. Toggle the body `dir` attribute between `ltr` and `rtl`
3. The editor correctly respects the CodeMirror option, but the preview does not
**Expected behavior**
Preview should also respect the CodeMirror option
**Screenshots**


In the editor the Hebrew word is on the right while "HTML" is on the left, whether the body direction is `ltr` or `rtl`. But this changes in the preview, based on the `body` `dir` attribute.
**Version information**
- OS: Windows
- Browser: Edge 97 (via WebView2 control)
- EasyMDE version: [e.g. 2.16.1]
**Additional information**
It may just be a matter of setting `direction` on the `.editor-preview` CSS rule.
```css
.editor-preview {
direction: rtl;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.