From: julmis Date: Thu, 12 Aug 2004 07:40:57 +0000 (+0000) Subject: Fix for wordClean. Don't strip all h -tags X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ad23e80a3beb849b8871e15b899b7f06949b42d8;p=moodle.git Fix for wordClean. Don't strip all h -tags --- diff --git a/lib/editor/htmlarea.php b/lib/editor/htmlarea.php index 386f136434..cf167e6b1b 100644 --- a/lib/editor/htmlarea.php +++ b/lib/editor/htmlarea.php @@ -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>/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