-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.9.13, 3.10.10, 3.11.6, 4.0
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
This is a follow up from https://tracker.moodle.org/browse/MDL-32317
The issue is still eminent:
"If you create a wiki using the html format (others not tested) then create a new section header using h1 tags. If you also include an additional tag inside of that html tag - such as a span tag - clicking the corresponding "[edit]" link will give an 'invalid section' error."
Example:
<h1>Title0 without any styles</h1> |
<h1 dir="ltr" style="text-align:left;"><span style="color:#FF0000;">Title1 (h1 style + span style)</span></h1> |
<h1 dir="ltr" style="text-align:left;">Title2 (h1 style)</h1> |
<h1>Title3 without any styles</h1> |
<h3>Subtitle3 without any styles</h3> |
It can be fixed by changing line 85 in mod/wiki/parser/markups/html.php:
$h1 = array("<\s*h{$minheaderlevel}\s*>", "<\/h{$minheaderlevel}>");
to
$h1 = array("<\s*h{$minheaderlevel}.*>", "<\/h{$minheaderlevel}>");
See also https://tracker.moodle.org/browse/MDL-70521 ("Additional HTML coding in Atto breaks Table of Content creation in Wiki") - the two issues are related!