Interface HtmlProcessor
- All Superinterfaces:
Serializable
Processes HTML that is meant to be read from or written to the repository. It can be used to fix malformed HTML,
remove unwanted elements and attributes, and transform elements into a representation needed by the CMS, e.g. images
and internal links.
The process applied is:
1. Parse HTML into DOM tree
2. Apply visitors to DOM tree
3. Serialize DOM tree as string
-
Method Summary
Modifier and TypeMethodDescriptionread
(String html, List<TagVisitor> visitors) Process stored HTML.write
(String html, List<TagVisitor> visitors) Process HTML to store.
-
Method Details
-
read
Process stored HTML.- Parameters:
html
- The stored HTMLvisitors
- Visitors applied to the DOM tree- Returns:
- Processed HTML
- Throws:
IOException
- when the DOM tree cannot be serialized
-
write
Process HTML to store.- Parameters:
html
- The HTML to be storedvisitors
- Visitors applied to the DOM tree- Returns:
- Processed HTML
- Throws:
IOException
- when the DOM tree cannot be serialized
-