Search in sources :

Example 11 with HTMLCleanerConfiguration

use of org.xwiki.xml.html.HTMLCleanerConfiguration in project xwiki-platform by xwiki.

the class WysiwygHTMLCleaner method getDefaultConfiguration.

@Override
public HTMLCleanerConfiguration getDefaultConfiguration() {
    HTMLCleanerConfiguration configuration = this.defaultHtmlCleaner.getDefaultConfiguration();
    // Add office cleaning filters after the default filters.
    List<HTMLFilter> filters = new ArrayList<HTMLFilter>(configuration.getFilters());
    filters.addAll(Arrays.asList(this.stripperFilter, this.styleFilter, this.redundancyFilter, this.paragraphFilter, this.imageFilter, this.listFilter, this.tableFilter));
    configuration.setFilters(filters);
    return configuration;
}
Also used : ArrayList(java.util.ArrayList) HTMLFilter(org.xwiki.xml.html.filter.HTMLFilter) HTMLCleanerConfiguration(org.xwiki.xml.html.HTMLCleanerConfiguration)

Aggregations

HTMLCleanerConfiguration (org.xwiki.xml.html.HTMLCleanerConfiguration)11 Document (org.w3c.dom.Document)7 StringReader (java.io.StringReader)5 ArrayList (java.util.ArrayList)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 InputStream (java.io.InputStream)3 Reader (java.io.Reader)3 HashMap (java.util.HashMap)3 Test (org.junit.Test)3 DocumentReference (org.xwiki.model.reference.DocumentReference)3 HTMLFilter (org.xwiki.xml.html.filter.HTMLFilter)3 NodeList (org.w3c.dom.NodeList)2 XDOMOfficeDocument (org.xwiki.officeimporter.document.XDOMOfficeDocument)2 XHTMLOfficeDocument (org.xwiki.officeimporter.document.XHTMLOfficeDocument)2 InputStreamReader (java.io.InputStreamReader)1 Map (java.util.Map)1 Expectations (org.jmock.Expectations)1 DocumentAccessBridge (org.xwiki.bridge.DocumentAccessBridge)1 DocumentModelBridge (org.xwiki.bridge.DocumentModelBridge)1 OfficeImporterException (org.xwiki.officeimporter.OfficeImporterException)1