How to change rtl direction to ltr in codesample plugin of tinymce

658 Views Asked by At

My Django-TinyMCE direction has turned rtl due to my language and everything looks fine except the codesample plugin which has gotten rtl and scrambles the code. I would appreciate anyone help me figure this out. I want code sample to be ltr while everything else is rtl.

Thanks in advance

images ...

rtl text editor I want rtl to ltr

2

There are 2 best solutions below

0
NimiA On BEST ANSWER

I solved this problem with this style in head of my html code:

    .tox .tox-form__group--stretched .tox-textarea {
        flex: 1;
        text-align: left;
        direction: ltr !important;
        -ms-flex-preferred-size: auto;
    }
3
Omid Shojaee On

You need to add directionality to the list of plugins and ltr rtl to the toolbar.

Then, before adding the code block set the direction to LTR.

See a working sample here.