Summary
Filter to cleaning up malformed and faulty HTML via the JSoup lib.
Requirements
Magnolia CE/EE 5.3+
Dependencies
<dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.7.2</version> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency>
This Module will not work with Magnolia 5.4.x until you bypass DAM and imaging. Download settings below or add it by yourself. Magnolia 5.4.x versions will be available at the magnolia marketplace.
or add it by yourself:
What is getting installed
The module installs a new Filter below the Cache Filter.
By Default the Filter is not enabled
Screenshots
Without Tidy Filter | With Tidy Filter enabled |
---|---|
Download
Maven
<dependency> <groupId>de.lemonize.magnolia.tidyfilter</groupId> <artifactId>magnolia-tidyfilter</artifactId> <version>1.0.2</version> </dependency>
Nexus
Version History
1.0.0
- First Release
1.0.1
- Tested with Magnolia 5.3. The Module is now not anymore depend on Magnolia 5.3.6+
1.0.2
EscapeMode changed from base to xhmtl. TIDYFILTER-3
Credits
- Vivian Steller from lemonize: he originally programmed this filter
- Gregory Joseph from Magnolia for helping with Maven and Forge
9 Comments
Vivian Steller
@tomwespi thanks for your efforts releasing the module!
Jan Christian Haddorp
Hi Vivian Steller, thanks for the module. Trying to install using Magnolia 5.5.5.
So far everything logs good. But got the problem that the content type of the response is null. Means your filter does not do anything. The sequence of my filters looks same as in your documentation. Any idea what may go wrong? Ever tested with Magnolia 5.5?
Tom Wespi
Hi
Is the filter enabled? Not tested with 5.5.x
Jan Christian Haddorp
Yes, filter is enabled. Problem is that response.getContentType() resolves to null.
If modifying the code filter works fine and HTML gets well formatted.
Tom Wespi
Ah yes, there was some change, I did also some local changes but its not committed:
Jan Christian Haddorp
Thanks! First view - it works. Can you please update Maven/Nexus repo?
Jan Christian Haddorp
Hi Tom Wespi, another point... We actived the filter; basically everything fine and working.
But then I recognized that specials chars (e.g. äöü) become corrupt. We use normal UTF-8 settings. Without filter all chars are fine. Any idea?
Tom Wespi
It has probably something to do with your JVM or your system setting, check if everywhere UTF-8 is set. I will also ask my hosting provider, we had this problem but solved it quite a time ago
Christopher Zimmermann
Hi Tom Wespiis this module still active? Which Magnolia versions does it support? I'd like to add support badges to it - like in the other modules if it is still active.