Hi Marius,
On Mar 26, 2009, at 12:26 AM, mflorea (SVN) wrote:
Author: mflorea
Date: 2009-03-26 00:26:55 +0100 (Thu, 26 Mar 2009)
New Revision: 18027
Modified:
platform/web/trunk/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/
client/plugin/macro/exec/RefreshExecutable.java
platform/web/trunk/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/
client/widget/rta/internal/IEBehaviorAdjuster.java
platform/web/trunk/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/
server/DefaultWysiwygService.java
platform/web/trunk/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/
server/cleaner/internal/DefaultHTMLCleaner.java
platform/web/trunk/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/
server/cleaner/internal/WysiwygCleaningFilter.java
platform/web/trunk/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/
server/converter/internal/EventsHTMLConverter.java
platform/web/trunk/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/
server/converter/internal/XWikiHTMLConverter.java
Log:
Updated the WYSIWYG code due to:
* XWIKI-3456: Provide way to control the HTML cleaning filters
executed by the HTML Cleaner
* XWIKI-3457: XHTML parser shouldn't run the HTML Cleaner
Also some minor IE fixes.
[snip]
import com.xpn.xwiki.web.Utils;
import com.xpn.xwiki.wysiwyg.server.cleaner.HTMLCleaner;
@@ -49,8 +53,12 @@
{
org.xwiki.xml.html.HTMLCleaner cleaner =
(org.xwiki.xml.html.HTMLCleaner)
Utils.getComponent(org.xwiki.xml.html.HTMLCleaner.ROLE);
- Document document = cleaner.clean(new
StringReader(dirtyHTML));
- filter.filter(document);
+ HTMLCleanerConfiguration config =
cleaner.getDefaultConfiguration();
+ List<HTMLFilter> filters = new ArrayList<HTMLFilter>();
+ filters.add(filter);
I think it would be good to add a good comment here explaining why you
have to run your filter first.
+ filters.addAll(config.getFilters());
+ config.setFilters(filters);
+ Document document = cleaner.clean(new
StringReader(dirtyHTML), config);
return XMLUtils.toString(document);
}
}
[snip]
Thanks
-Vincent