Links in NWiki automatic table of contents not working

Links in NWiki automatic table of contents not working

by Pia Jensen -
Number of replies: 1

I'm a new user of Moodle, and started straight with Moodle 2.0 (well, the newest version, I guess that's rather 2.x, to be fair :P). At the moment, I'm trying to make a wiki, using the NWiki format.

I like the fact that when one or more sections are made, a table of contents show up automatically. However, the links to the different sections (they link towards anchors of the form #toc-1, #toc-2 etc.) do not work. When looking at the source code of a wiki page, I see no corresponding anchors at the actual headings.

A related problem is that I cannot make anchors manually. I would like to make simple footnotes: I put a link somewhere in the text, which should lead the reader to the bottom of the page, where a corresponding footnote is situated. The link points toward the anchor #blah, and the footnote is situated inside a HTML li tag with id="blah". However, when I click the link in the text, nothing happens, although the anchor is appended to the URL seen in my browser (this happens both in Firefox, IE and Opera).

Have anyone else got code that has working anchors? Or can you see what I do wrong just from what I've described?

If you need more information about my Moodle installation, the wiki page, or my code - please ask smile

Average of ratings: -
In reply to Pia Jensen

Re: Links in NWiki automatic table of contents not working

by Pia Jensen -

A solution was found in a newer thread: http://moodle.org/mod/forum/discuss.php?d=172852#p757880

In short: If one goes to Site administration -> Security -> Site policies, turning of the HTML Purifier, the id="" and name="" tags should work as intended. This also fixes the problem with the table of content links not working, since these also use HTML anchors.