Class InlineStyle

  • All Implemented Interfaces:
    NodeHandler

    public class InlineStyle
    extends AbstractNodeHandler
    Handles various inline styling (italics and bold), such as em, i, strong, b, span, and font tags.
    Author:
    Phil DeJarnett
    • Constructor Detail

      • InlineStyle

        public InlineStyle()
    • Method Detail

      • handleNode

        public void handleNode​(NodeHandler parent,
                               org.jsoup.nodes.Element node,
                               DocumentConverter converter)
        Renders inline styling (bold, italics) for the given tag. It handles implicit styling (em, strong) as well as explicit styling via the style attribute.

        This object keeps track of the depth of the styling, to prevent recursive situations like this:

        <em>hello <em>world</em></em>

        A naive method would be render the example incorrectly (the output would be *hello **world*)

        Parameters:
        parent - The previous node walker, in case we just want to remove an element.
        node - Node to handle
        converter - Parent converter for this object.