Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format.js (révision 7097)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format.js (copie de travail)
@@ -1,7 +1,7 @@
/***************************************************************
* Copyright notice
*
-* (c) 2005-2008 Stanislas Rolland
+* (c) 2005-2010 Stanislas Rolland
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
@@ -46,10 +46,10 @@
var pluginInformation = {
version : "1.6",
developer : "Stanislas Rolland",
- developerUrl : "http://www.fructifor.ca/",
+ developerUrl : "http://www.sjbr.ca/",
copyrightOwner : "Stanislas Rolland",
- sponsor : "Fructifor Inc.",
- sponsorUrl : "http://www.fructifor.ca/",
+ sponsor : "SJBR",
+ sponsorUrl : "http://www.sjbr.ca/",
license : "GPL"
};
this.registerPluginInformation(pluginInformation);
@@ -113,13 +113,10 @@
}
if (param["formatting"] == true) {
- // remove font, b, strong, i, em, u, strike, span and other tags
- var regF1 = new RegExp("<\/?(abbr|acronym|b[^a-zA-Z]|big|cite|code|em[^a-zA-Z]|font|i[^a-zA-Z]|q|s[^a-zA-Z]|samp|small|span|strike|strong|sub|sup|u[^a-zA-Z]|var)[^>]*>", "gi");
- html = html.replace(regF1, "");
- // keep tags, strip attributes
- var regF2 = new RegExp(" style=\"[^>\"]*\"", "gi");
- var regF3 = new RegExp(" (class|align|cellpadding|cellspacing|frame|bgcolor)=(([^>\s\"]+)|(\"[^>\"]*\"))", "gi");
- html = html.replace(regF2, "").replace(regF3, "");
+ // Remove font, b, strong, i, em, u, strike, span and other inline tags
+ html = html.replace(/<\/?(abbr|acronym|b[^a-zA-Z]|big|cite|code|em[^a-zA-Z]|font|i[^a-zA-Z]|q|s[^a-zA-Z]|samp|small|span|strike|strong|sub|sup|tt|u[^a-zA-Z]|var)[^>]*>/gi, "");
+ // Keep tags, strip attributes
+ html = html.replace(/ style=\"[^>\"]*\"/gi, "").replace(/ (class|align|cellpadding|cellspacing|frame|bgcolor)=(([^>\s\"]+)|(\"[^>\"]*\"))/gi, "");
}
if (param["images"] == true) {
@@ -128,18 +125,12 @@
}
if (param["ms_formatting"] == true) {
- // make one line
- var regMS1 = new RegExp("(\r\n|\n|\r)", "g");
- html = html.replace(regMS1, " ");
- //clean up tags
- var regMS2 = new RegExp("<(b[^r]|strong|i|em|p|li|ul) [^>]*>", "gi");
- html = html.replace(regMS2, "<$1>");
- // keep tags, strip attributes
- var regMS3 = new RegExp(" style=\"[^>\"]*\"", "gi");
- var regMS4 = new RegExp(" (class|align)=(([^>\s\"]+)|(\"[^>\"]*\"))", "gi");
- html = html.replace(regMS3, "").replace(regMS4, "");
- // mozilla doesn't like tags
- html = html.replace(//gi, "").replace(/<\/em>/gi, "");
+ // Make one line
+ html = html.replace(/(\r\n|\n|\r)/g, " ");
+ // Clean up tags
+ html = html.replace(/<(b|strong|i|em|p|li|ul) [^>]*>/gi, "<$1>");
+ // Keep tags, strip attributes
+ html = html.replace(/ style=\"[^>\"]*\"/gi, "").replace(/ (class|align)=(([^>\s\"]+)|(\"[^>\"]*\"))/gi, "");
// kill unwanted tags: span, div, ?xml:, st1:, [a-z]:, meta, link
html = html.replace(/<\/?span[^>]*>/gi, "").
replace(/<\/?div[^>]*>/gi, "").
@@ -153,21 +144,18 @@
replace(/]*>.*<\/title[^>]*>/gi, "");
// remove comments
html = html.replace(/