From ad23e80a3beb849b8871e15b899b7f06949b42d8 Mon Sep 17 00:00:00 2001 From: julmis Date: Thu, 12 Aug 2004 07:40:57 +0000 Subject: [PATCH] Fix for wordClean. Don't strip all h -tags --- lib/editor/htmlarea.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5