From: gustav_delius Date: Thu, 1 Jul 2004 10:18:14 +0000 (+0000) Subject: fixed bug 1550 about broken anchor links X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ad6178ea81df13cf24e439eb512ab3801e3f33ea;p=moodle.git fixed bug 1550 about broken anchor links --- diff --git a/lib/editor/htmlarea.php b/lib/editor/htmlarea.php index 000041ee4e..e5f8bc1ba6 100644 --- a/lib/editor/htmlarea.php +++ b/lib/editor/htmlarea.php @@ -2169,10 +2169,17 @@ HTMLArea.getHTML = function(root, outputRoot, editor) { }; HTMLArea.prototype.stripBaseURL = function(string) { - var baseurl = this.config.baseURL; - - return string; // Moodle addition to skip this whole routine + // IE adds the path to an anchor, converting #anchor + // to path/#anchor which of course needs to be fixed + var index = string.indexOf("/#")+1; + if (index > 0) { + return string.substr(index); + } + return string; // Moodle doesn't use the code below because + // Moodle likes to keep absolute links + + var baseurl = this.config.baseURL; // strip to last directory in case baseurl points to a file baseurl = baseurl.replace(/[^\/]+$/, ''); var basere = new RegExp(baseurl);