Package com.overzealous.remark.convert
Class InlineStyle
- java.lang.Object
-
- com.overzealous.remark.convert.AbstractNodeHandler
-
- com.overzealous.remark.convert.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 Summary
Constructors Constructor Description InlineStyle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleNode(NodeHandler parent, org.jsoup.nodes.Element node, DocumentConverter converter)Renders inline styling (bold, italics) for the given tag.voidhandleTextNode(org.jsoup.nodes.TextNode node, DocumentConverter converter)Handle a child text node.-
Methods inherited from class com.overzealous.remark.convert.AbstractNodeHandler
handleIgnoredHTMLElement, prependAndRecurse
-
-
-
-
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 thestyleattribute.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 handleconverter- Parent converter for this object.
-
handleTextNode
public void handleTextNode(org.jsoup.nodes.TextNode node, DocumentConverter converter)Description copied from class:AbstractNodeHandlerHandle a child text node. The default method, implemented here, is to simply write the cleaned text directly.- Specified by:
handleTextNodein interfaceNodeHandler- Overrides:
handleTextNodein classAbstractNodeHandler- Parameters:
node- Node to handleconverter- Parent converter for this object.
-
-