Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/SuperClean/filters/word.js
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/SuperClean/filters/word.js,v
diff -u -r1.1.1.1 -r1.1.1.1.8.1
--- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/SuperClean/filters/word.js 2 Nov 2005 08:56:29 -0000 1.1.1.1
+++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/SuperClean/filters/word.js 16 May 2008 17:04:43 -0000 1.1.1.1.8.1
@@ -1,53 +1,30 @@
-function(html) {
- // Remove HTML comments
- html = html.replace(//gi, "" );
- html = html.replace(//gi, '');
- // Remove all HTML tags
- html = html.replace(/<\/?\s*HTML[^>]*>/gi, "" );
- // Remove all BODY tags
- html = html.replace(/<\/?\s*BODY[^>]*>/gi, "" );
- // Remove all META tags
- html = html.replace(/<\/?\s*META[^>]*>/gi, "" );
- // Remove all SPAN tags
- html = html.replace(/<\/?\s*SPAN[^>]*>/gi, "" );
- // Remove all FONT tags
- html = html.replace(/<\/?\s*FONT[^>]*>/gi, "");
- // Remove all IFRAME tags.
- html = html.replace(/<\/?\s*IFRAME[^>]*>/gi, "");
- // Remove all STYLE tags & content
- html = html.replace(/<\/?\s*STYLE[^>]*>(.|[\n\r\t])*<\/\s*STYLE\s*>/gi, "" );
- // Remove all TITLE tags & content
- html = html.replace(/<\s*TITLE[^>]*>(.|[\n\r\t])*<\/\s*TITLE\s*>/gi, "" );
- // Remove javascript
- html = html.replace(/<\s*SCRIPT[^>]*>[^\0]*<\/\s*SCRIPT\s*>/gi, "");
- // Remove all HEAD tags & content
- html = html.replace(/<\s*HEAD[^>]*>(.|[\n\r\t])*<\/\s*HEAD\s*>/gi, "" );
- // Remove Class attributes
- html = html.replace(/<\s*(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
- // Remove Style attributes
- html = html.replace(/<\s*(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
- // Remove Lang attributes
- html = html.replace(/<\s*(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
- // Remove XML elements and declarations
- html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
- // Remove Tags with XML namespace declarations:
");
+_1=_1.replace(/<\s*p[^>]*>/gi,"");
+_1=_1.replace(/<\/\s*p[^>]*>/gi,"
");
+_1=_1.replace(/(\s*
\s*)*$/,"");
+_1=_1.trim();
+return _1;
+}
- // Transform
- html = html.replace(/<\s*p[^>]*>/gi, ""); - - // Replace
with