Auto setting for text direction for lists in the editor content
- Dominant language
- JavaScript
- Stars
- 20k
- Forks
- 1.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 13
Description
Hello,
I am facing an issue when writing both RTL and LTR text in the Trix editor, where Trix automatically sets a direction by setting the **dir** attribute to tags inside the content of the editor. I think it would be great if there would be a config to disable or enable this feature upon the need of the developer. Or at least check if there is **dir** attribute set for the editor to anything but **auto** then this feature should be disabled automatically.
I even tried to force styling to ordered and unordered lists using the **direction** CSS but faced a problem that when changing language while writing content, Trix separates the listing items into a new list with padding or margin.
##### Steps to Reproduce
1. Open https://trix-editor.org/ in Mozilla Firefox (or chrome if using Trix version: 2.0.5).
2. Clear content in the editor.
3. Write test in an LTR language.
4. Start an new unordered list.
5. Write an item in LTR language.
6. press enter.
7. write a new item in RTL language.
8. press enter.
9. write a new item in LTR language.
##### Details
* Trix version: 2.0.4
* Browser name and version: Mozilla Firefox 116.0.3 (64-bit)
* Operating system: Ubuntu 22.04.2 LTS
Thanks
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the mixed LTR/RTL unordered-list steps on trix-editor.org in Firefox or Chrome, using the reported Trix version details as context. Inspect how the editor assigns dir attributes and splits list items; done means the requested opt-out or editor-dir behavior is defined and mixed-direction list editing no longer produces the reported unwanted separation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100