]> git.mjollnir.org Git - moodle.git/commitdiff
fixed bug 1550 about broken anchor links
authorgustav_delius <gustav_delius>
Thu, 1 Jul 2004 10:18:14 +0000 (10:18 +0000)
committergustav_delius <gustav_delius>
Thu, 1 Jul 2004 10:18:14 +0000 (10:18 +0000)
lib/editor/htmlarea.php

index 000041ee4ebd9d6822f5b8fc73fb7731f7097843..e5f8bc1ba6640e38b507a82f928612b7e13755a8 100644 (file)
@@ -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);