RTL support is broken for some mixed LTR and RTL text

  • Unknown's avatar

    sometimes I write posts with mixed English and Arabic text, this cause some troubles with some type of characters.

    I’ve put all the example I can on this blog post:

    testing wordpress rtl support

    basically the only way to get things right for the following text to show in RTL website is by using the unicode U+202D
    ./run_script.sh

    otherwise it get the wrong direction becomes like this:
    run_script.sh/.

    and sometimes if I use U+202E before it, it becomes:
    ‮./run_script.sh

    hs.tpircs_nur/.

    The blog I need help with is: (visible only to logged in users)

  • Hi there,

    Does this only happen when you write command line code like that, or with regular English text as well?

    This is most likely because the editor doesn’t recognise your code as “English”, so it’s treating it as Arabic instead with regards to the text direction.

    Can you check if the same thing happens if you wrap that code in backticks or code tags instead?

  • Unknown's avatar

    Hi, thank you for answering.

    For sure text dosn’t look fine while writing English text in RTL blog as the text will be aligned to the left and dots will go to the left instead of the end of the text. yo can see that in Example 8 here: https://wp.me/p5Xhrj-3o

    also and backticks doesn't help as in example 6 and 7

    I think fixing this requires the dir=rtl and dir=ltr to be activated.

  • Hm, yeah that won’t be something we’d be able to support on a free site since the content is mixed and it’s not just RTL site-wide.

    There are plugins for this, but to use plugins here you’ll need a paid Business Plan: https://wordpress.com/support/plugins/#using-other-plugins

  • Unknown's avatar

    Hi there @uadroid , some of your duplicate replies were caught in our spam filter and I’ve gone ahead and deleted the duplicates.

    I think fixing this requires the dir=rtl and dir=ltr to be activated.

    That’s pretty much what is suggested in this earlier forum thread by a different user. https://wordpress.com/forums/topic/bilingual-posts-hebrew-english/?replies=1 They also explain how to implement it in the HTML tab. I’m not certain how this would work if you are using blocks.

  • Unknown's avatar

    @justjennifer thank you for the hint, dir=rtl and dir=ltr actually works inside <p> tag. I’ve used them with the code but they break after the first empty line for RTL. I’ve added example 9 to my example post in my original question.

    I’ve seen many editors fix those issue by identifying the text language and setting direction accordingly for each line.

    Also one possible work around is to use Github to share code as it get embedded in wordpress as I’ve discovered today.

  • The topic ‘RTL support is broken for some mixed LTR and RTL text’ is closed to new replies.