Wiki omitting anchors in external links

Wiki omitting anchors in external links

by Florian Reichl -
Number of replies: 3
Hello everybody,

I want to link to a specific part of an external page like this:
http://docs.moodle.org/en/Wikis#Creative_Wiki_practices

If I add a link like this inside a wiki page, it links only to the first part of the link (http://docs.moodle.org/en/Wikis) but omits the anchor (#Creative_Wiki_practices).

(By the way, we have the same problem on this page. Just look at the first link above.)

Is there a solution to my problem?

Thank you for your answers!
Best regards,
Florian
Average of ratings: -
In reply to Florian Reichl

Re: Wiki omitting anchors in external links

by John Rodkey -
We used to be able to specify anchors within Moodle 1.8.x, e.g. [https://eureka.westmont.edu/mod/wiki/view.php?id=2848&page=FAQ+-+Students#nopasswd] . (This is a live, public page.)

However, apparently since upgrading to 1.9.2+, when a wiki page is edited either in HTML mode or using WYSIWYG HTML editor, all anchors are stripped from the resulting code, leaving only <a></a> where <a name=nopasswd></a> should be. Previous versions of the page in the mysql database have the proper anchor tags.

Anyone else seeing this problem?

John Rodkey


In reply to John Rodkey

Re: Wiki omitting anchors in external links

by rich holman -
I'm having this problem, does anyone know if there was a fix?

r.
In reply to rich holman

Re: Wiki omitting anchors in external links

by rich holman -
For the record I discovered the following:

HTMLpurifier was casuing this problem.

I had to update HTMLPurifier Lite to Version 4 and then I added

$config->set('Attr', 'EnableID', true);
$config->set('Attr', 'EnableAttrID', true);

to the constructor in HTMLPurifier.php

Anchors work perfectly and the formating of my page is retained!

R.