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

Internal links with anchor not rendered correctly in wiki

    XMLWordPrintable

Details

    • MOODLE_400_STABLE

    Description

      Internal links with an anchor are parsed, but not rendered correctly in Moodle Wiki, e.g.

      [[Page#toc-1|Page]]

      A tiny patch in /mod/wiki/locallib.php:wiki_parser_link could fix this behavior:

       

              $swid = $options['swid'];
              $anchor = (!empty($options['anchor']) ? "#" . urlencode($options['anchor']) : "");
       
              if ($page = wiki_get_page_by_title($swid, $link)) {
                  $parsedlink = array('content' => $link, 'url' => $CFG->wwwroot . '/mod/wiki/view.php?pageid=' . $page->id . $anchor, 'new' => false, 'link_info' => array('link' => $link, 'pageid' => $page->id, 'new' => false)); 

      Attachments

        Activity

          People

            Unassigned Unassigned
            SpaceCafe Lars Thoms
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: