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 dir attribute #671

Closed
wwalc opened this issue Nov 17, 2017 · 3 comments
Closed

Support dir attribute #671

wwalc opened this issue Nov 17, 2017 · 3 comments
Labels
type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Milestone

Comments

@wwalc
Copy link
Member

wwalc commented Nov 17, 2017

Similar to #670, but may be more complex due to expected RTL support in the editor.

🐞 Is this a bug report or feature request? (choose one)

  • Feature request

💻 Version of CKEditor

1.0.0-alpha.2

📋 Steps to reproduce

It's impossible to use Classic Editor in systems where the input language direction in the editor is different than by the language used by the CMS (e.g. in any systems where the content is translatable).

✅ Expected result

There should be a simple way to instruct Classic Editor to add dir attribute that will apply to the entered content.

❎ Actual result

In case of Inline/Balloon editor this is plain simple as I can set the attributes on the editable element, in case of Classic Editor this is a bit more cumbersome:

    ClassicEditor
        .create( document.querySelector( '#editor' ) )
        .then( editor => {
            editor.ui.view.editable.element.setAttribute('dir', 'rtl');
        } )
        .catch( error => {
            console.error( error );
        } );

📃 Other details that might be useful

Note: the inner content of the editor may have nothing to do with the interface language of the editor.

@wwalc wwalc added the type:improvement This issue reports a possible enhancement of an existing feature. label Nov 17, 2017
@Reinmar Reinmar added status:confirmed type:feature This issue reports a feature request (an idea for a new functionality or a missing option). and removed type:improvement This issue reports a possible enhancement of an existing feature. labels Nov 17, 2017
@Reinmar Reinmar mentioned this issue Jul 12, 2018
35 tasks
@Reinmar Reinmar added this to the backlog milestone Oct 15, 2018
@oleq
Copy link
Member

oleq commented Aug 13, 2019

Since #1151, you can set config.language.content that will change the dir attribute of the content (all editors).

@oleq oleq closed this as completed Aug 13, 2019
@oleq oleq modified the milestones: backlog, iteration 26 Aug 13, 2019
@ashishforgrz
Copy link

ashishforgrz commented Jul 11, 2023

This if for full editor but <div dir="rtl">right</div> does not work in ckeditor5 but was working for ckeditor4. Is there any way to support dir="rtl" for only the tags where it is present. @Reinmar @wwalc @oleq @Inviz

@Witoso
Copy link
Member

Witoso commented Jul 13, 2023

@ashishforgrz consider that the implementation of this feature may be different in the CKE5. Take a look at the RTL support and Text part language. If you still want to support rtl via div, you need to enable this attribute in the General HTML support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

No branches or pull requests

5 participants