Search code examples
ckeditor

ckeditor bidi force use direction rtl or ltr


i'm using ckeditor 4 and would like to allow my customers to use rtl or ltr directions - but since i'm going to send the output as email message i want to always have the direction attribute to be used.

for some reason, if i'm using the hebrew or arabic version of ckeditor - it simply omit the rtl instead of writing it. is there a way to force ckeditor to write the direction?

i tried this settings:

config.language = 'he';          
config.contentsLangDirection = 'ltr';

i've looked in the ckeditor documentation but found nothing about forcing direction tag.


Solution

  • You should use config.contentsLangDirection = 'rtl'; or config.contentsLangDirection = 'ltr'; in your config file.

    Or:

    CKEDITOR.replace( 'instance-name', {
        contentsLangDirection: 'rtl'
    } );
    

    You can find documentation here

    You can also use a BIDI plugin.