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

Wiki html parser does not recognize h1 section headers if they contain attributes (follow-up MDL-32317)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.9.13, 3.10.10, 3.11.6, 4.0
    • Wiki (2.x)
    • 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!

            Unassigned Unassigned
            melanie.treitinger@ruhr-uni-bochum.de Melanie Treitinger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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