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

<header> HTML5 tag is filtered out by Atto editor

XMLWordPrintable

    • MOODLE_34_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • Hide

      Other than fixing the source code in moodle-editor_atto-editor...js, I have yet to find a workaround.

      Show
      Other than fixing the source code in moodle-editor_atto-editor...js, I have yet to find a workaround.
    • Easy
    • Hide
      1. Log in as admin and go to any course.
      2. Add a Page resource.
      3. Switch to Atto editor's HTML/Source view and add the following lines:

        <header>
        <p>This content will vanish when you save it.</p>
        </header>
        <footer>
        <p>This content will stay.</p>
        </footer>
        

      4. Switch to WYSIWYG
      5. Go back to Source view again.
      6. Make sure <header> and </header> tags should still be there.
      Show
      Log in as admin and go to any course. Add a Page resource. Switch to Atto editor's HTML/Source view and add the following lines: <header> <p>This content will vanish when you save it.</p> </header> <footer> <p>This content will stay.</p> </footer> Switch to WYSIWYG Go back to Source view again. Make sure <header> and </header> tags should still be there.

      The <header> and </header> HTML5 tags are filtered out in the Moodle Atto editor. Judging by the source code, I believe the removal of the header tag is unintentional and the result of an attempt to filter out the <head> tag. This creates an accessibility issue if your properly coded HTML content is now missing the <header> tags.

      This happens in the _cleanHTML( ) function which appears in the following files:

      /lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
      /lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
      /lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js

      Steps to reproduce the issue

      1. Login as a Moodle Administrator.
      2. Create a course.
      3. Add a Page activity to the course.
      4. Switch to Atto editor's HTML/Source view and add the following lines:
        <header>
        <p>This content will vanish when you save it.</p>
        </header>
        <footer>
        <p>This content will stay.</p>
        </footer>
      5. Switch to WYSIWYG
      6. Switch back to the HTML/Source view.

      What happened

      Notice the <header> and </header>** tags have been removed. There is no reason that a <header> tag should be filtered out by Atto. The footer contain remains.

      What was expected

      As you can see, the footer tag did not disappear and neither should the <header> tag.

        1. MDL-66858.png
          9 kB
          Jennifer Bauzon
        2. MDL-66858.jpg
          20 kB
          Anna Carissa Sadia

            michael-milette Michael Milette
            michael-milette Michael Milette
            Simey Lameze Simey Lameze
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 25 minutes
                2h 25m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.