MDL-52724 editor_atto: Scrub atto html for invalid ol, ul, and li tags
authorEric Merrill <merrill@oakland.edu>
Thu, 8 Apr 2021 19:20:24 +0000 (15:20 -0400)
committerEric Merrill <merrill@oakland.edu>
Thu, 8 Apr 2021 19:20:24 +0000 (15:20 -0400)
commit59704c659c848a43500ded966c7d44cf8fc8af95
treef783d28010cd7b0f320a3766132b53e0a5fad1a4
parent18aafd0ed4d89447cf7a6ac54c8aa7b710299563
MDL-52724 editor_atto: Scrub atto html for invalid ol, ul, and li tags

Try to correct broken ul/ol/li tags, as they have an outsized impact
on course layout. Uses basic regex and loops to track open and closed
tags.

Also adds a deep clean option to the HTML cleaner, that runs less
frequent, more intensive cleanings. This is because normally _cleanHTML
gets called after each keystroke, which could cause problems with
large content on weak systems.

Behat changes are a fix for setting multiline strings in Atto, and
creating a multiline match step.
lib/behat/form_field/behat_form_editor.php
lib/editor/atto/tests/behat/clean.feature [new file with mode: 0644]
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
lib/editor/atto/yui/src/editor/js/clean.js
lib/editor/atto/yui/src/editor/js/textarea.js
lib/tests/behat/behat_forms.php