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

Atto: client-side HTML cleanup is not enough

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.5
    • Fix Version/s: None
    • Component/s: HTML Editor (Atto)
    • Labels:
      None
    • Affected Branches:
      MOODLE_35_STABLE

      Description

      Steps to reproduce/test

      1. (If Atto is not the default editor:) make Atto the default editor.
      2. Open a course.
      3. Turn editing on (if it is turned off).
      4. If the course does not have topics except the General section, add 5 topics to it.
      5. Turn off JavaScript in your web browser.
      6. Use "Edit section" on the first section. (The page "Edit General" (to be exact, "Edit <sectionname>") will open.)
      7. Replace the entire content of the "Summary" field with

        </div>
        

      8. Save the changes.
      9. Back on the course page, turn JavaScript on in your web browser.

      Expected result

      Topic headlines are styled as usual.

      Actual result

      Topic headlines have a bullet point next to them on the left. Blocks in the course (if present) may be moved to the bottom.
      (Tested with Firefox 66.0.1.)

      Preliminary analysis

      This does not happen with JavaScript turned on. So it seems to be the result of a HTML cleanup step which is done on client side (only).

      The bullet points appear, because the ul element around the headings is prematurely closed. This is probably a reaction of the browser which cleans up HTML markup when it sees the closing div tag: it injects a closing ul tag first, then places /div. This results in a change to the following li elements for the topics: they are no longer surrounded by ul so the default Moodle CSS rule which sets 'list-style: none' does not apply anymore.

      Suggested way to fix

      Move (or copy) cleanup of submitted HTML content to the server side.

      Affected versions

      Tested on a local 3.5 instance (weekly), and on demo.moodle.net and qa.moodle.net.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nicoroeser Nico Roeser
              Participants:
              Component watchers:
              Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: