-
Bug
-
Resolution: Fixed
-
Major
-
3.4.9, 3.7.4, 3.8.1, 3.9
-
MOODLE_34_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MOODLE_37_STABLE, MOODLE_38_STABLE
-
-
Easy
-
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
- Login as a Moodle Administrator.
- Create a course.
- Add a Page activity to the course.
- 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
- 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.