Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66170

Atto editor - The Right-to-left directionality mechanism doesn't work as expected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.4, 3.7
    • Fix Version/s: None
    • Component/s: HTML Editor (Atto)
    • Labels:
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE

      Description

      Repro Steps
      1. Login to Moodle as a teacher.
      2. Install a Right-to-left language pack (Hebrew, for example).
      3. Create a new post in the "News Announcements" forum.
      4. Change your keyboard language to Hebrew.
      5. Write a couple of paragraphs.
      6. Select all the text in the editor.
      7. Click on the "Right to left" button.
      8. Click on the "Right align" button.
      9. Notice that for now the directionality of the text is correct - The period is presented at the end of the Hebrew sentence, on the left side of it.
      9. Switch to HTML view

       

      Expected Results
      Each one of the paragraphs elements (<p>) should have a "dir=rtl" attribute.

       

      Actual Results
      The separate paragraphs elements don't have a "dir=rtl" attribute, and the only element that have a "dir=rtl" attribute is the encompassing <p> element that include all the separate paragraphs (<p> elements).

       

      Problem
      In HTML, a <p> element doesn't suppose to handle nested <p> elements in it, and because of that there is no inheritance of attributes. Therefore the directionality attribute of the encompassing <p> element does not follow to the child <p> elements in it, and the paragraphs in the text don't get the expected directionality - right to left.

      BTW, If you'll switch back (from HTML view) to text view, you'll notice that the directionality is now incorrect. Anyway, the real issue here is that when the post is sent to the students via e-mail, the e-mail client (Gmail, most of the time) presents the text with an incorrect directionality. While at least sometimes the text would be displayed "RTL correctly" in Moodle, outside of it (in an e-mail client or any other external program that renders text in a different way than Moodle in an RTL UI mode) it would display incorrectly.

      Also, this is not the only issue with Right-to-left editing in Atto, but maybe investigating and fixing this issue would fix some of the other issues.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                AcquaAlta Acqua Alta
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: