]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for wordClean. Don't strip all h -tags
authorjulmis <julmis>
Thu, 12 Aug 2004 07:40:57 +0000 (07:40 +0000)
committerjulmis <julmis>
Thu, 12 Aug 2004 07:40:57 +0000 (07:40 +0000)
lib/editor/htmlarea.php

index 386f136434e1ab63f43bced3bf062cc865c5628d..cf167e6b1b2c7f4b570bb6af0ec10073c8746a03 100644 (file)
@@ -1002,7 +1002,7 @@ HTMLArea.prototype._wordClean = function() {
             replace(/<\/?span[^>]*>/gi,' ').
             replace(/<\/?div[^>]*>/gi,' ').
             replace(/<\/?pre[^>]*>/gi,' ').
-            replace(/<\/?h[1-6][^>]*>/gi,' ');
+            replace(/<(\/?)(h[1-6]+)[^>]*>/gi,'<$1$2>');
 
         //remove empty tags
         //D = D.replace(/<strong><\/strong>/gi,'').
@@ -2175,7 +2175,7 @@ HTMLArea.prototype.stripBaseURL = function(string) {
     // to path/#anchor which of course needs to be fixed
     var index = string.indexOf("/#")+1;
     if ((index > 0) && (string.indexOf(baseurl) > -1)) {
-        return string.substr(index);   
+        return string.substr(index);
     }
     return string; // Moodle doesn't use the code below because
                    // Moodle likes to keep absolute links