This transformer will ensure that:
- Containment rules are enforced. For example, a bold element may not contain a paragraph element (the bold element should be pushed down into the paragraph element.
- Redundant style information is removed and styles inverted
- Indivisible elements are preserved and styles pushed in appropriately
To illustrate 1 above: <body> <b> <p<Text 1</p> <-- p should not contain b --> Text 2 </b> </body>
should be transformed to:
<body> <p> <b>Text 1</b> </p> <b>Text 2</b> </body>
To illustrate 2 above: <b> This is some <anti-b> <!-- promoted up to counterpart and removed --> <anti-strike> <!-- redundant --> text <anti-strike> </anti-b> which is mainly, but not all, bold. </b>
should be transformed to:
<b> This is some </b> text <b> which is mainly, but not all, bold. </b>
To illustrate 3 above: <b> Block text before <a href=\"...\"> <!-- indivisible element --> Bold link text <anti-b> Normal link Text </anti-b> Bold link text </a> Bold text after </b>
should be transformed to:
<b> Block text before </b> <a href=\"...\"> <b> Bold link text </b> Normal link Text <b> Bold link text </b> </a> <b> Bold text after </b>
@see StyleEmulationVisitor