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

Malformed links in table of contents when headings are also links to pages

XMLWordPrintable

      Create a wiki page with the following content:

      <h1>[[Heading 1]]</h1>
      <h2>[[Heading A]]</h2>
      <h2>[[Heading B]]</h2>
      <h2>Heading D</h2>
      

      Save and return to the page.

      Notice the table of contents the item for "Heading 1" appears as something like "%!0%!" and so on with others. "Heading D" appears correctly, however.

      I've tried tracking this down myself in order to supply a patch but haven't been successful. It appears to have to do with how the toc content is generated after the parser has worked through the page content. By the time execution gets to wiki_markup_parser::generate_header() the $text parameter contains something like:

      <a href="%!1%!">%!0%!</a>
      

            lucaboesch Luca Bösch
            pennedav David Penner
            Adrian Greeve Adrian Greeve
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Andrew Lyons Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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