com.overzealous.remark.convert
Class InlineStyle

java.lang.Object
  extended by com.overzealous.remark.convert.AbstractNodeHandler
      extended by 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
InlineStyle()
           
 
Method Summary
 void handleNode(NodeHandler parent, Element node, DocumentConverter converter)
          Renders inline styling (bold, italics) for the given tag.
 void handleTextNode(TextNode node, DocumentConverter converter)
          Handle a child text node.
 
Methods inherited from class com.overzealous.remark.convert.AbstractNodeHandler
handleIgnoredHTMLElement, prependAndRecurse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InlineStyle

public InlineStyle()
Method Detail

handleNode

public void handleNode(NodeHandler parent,
                       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.

handleTextNode

public void handleTextNode(TextNode node,
                           DocumentConverter converter)
Description copied from class: AbstractNodeHandler
Handle a child text node. The default method, implemented here, is to simply write the cleaned text directly.

Specified by:
handleTextNode in interface NodeHandler
Overrides:
handleTextNode in class AbstractNodeHandler
Parameters:
node - Node to handle
converter - Parent converter for this object.


© 2011 OverZealous Creations, LLC - BitBucket Repository