Opened 10 years ago

Last modified 10 years ago

#6897 closed New Feature

No "dir" attribute is added unless direction is changed manually — at Initial Version

Reported by: Mohammad Ebrahim Mohammadi Panah Owned by:
Priority: Normal Milestone:
Component: Core : BiDi Version: 3.5
Keywords: Cc: ebrahim@…


I use Persian UI of CKEditor, which is right-to-left, to produce right-to-left content on an English page, and English is a left-to-right language. I expect CKEditor to add a dir="rtl" to elements by default, but it doesn't add it. For example if I open CKEditor and type "salam, output HTML would be '<p>salam</p>' rather than '<p dir="rtl">salam</p>'. So the final content which was right-to-left in CKEditor, is left-to-right outside of CKEditor. The same issue happens if someone uses a left-to-right UI of CKEditor to produce some content for a right-to-left page/context.

If you're wondering why would anybody produce RTL content for a LTR context: Language of content should be thought of independently of language of UI. It is popular for RTL-languaged people to use the normal LTR UI, but with RTL content. The issue would be more obvious in multi-language environments.

I think "dir" attribute should be added to content by default for some reasons:

  1. Text direction is actually an attribute of the content.
  2. Not always layout direction of editing equals layout direction of presentation.
  3. If adding direction is not done by CKEditor, it has to be taken care of outside CKEditor, which complicates integrating CKEditor in BiDi environments, specially if you want the user to be able to personalize UI language of his editor.

(Note that I know direction of UI is independent of contentsLangDirection, but I described it like above not to complicate the description.)

Change History (0)

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy