Class MarkdownParser.MarkdownHtmlParser

All Implemented Interfaces:
LogEnabled, HtmlMarkup, Markup, XmlMarkup, XhtmlMarkup, Parser
Enclosing class:
MarkdownParser

@Component(role=MarkdownHtmlParser.class) public static class MarkdownParser.MarkdownHtmlParser extends XhtmlParser
Internal parser for HTML generated by the Markdown library. 2 special things:
  • DIV elements are translated as Unknown Sink events
  • PRE elements are all considered as boxed
PRE elements need to be "boxed" because the XhtmlSink will surround the corresponding verbatim() Sink event with a DIV element with class="source", which is how most Maven Skin (incl. Fluido) recognize a block of code, which needs to be highlighted accordingly.
  • Constructor Details

    • MarkdownHtmlParser

      public MarkdownHtmlParser()
  • Method Details

    • init

      protected void init()
      Description copied from class: XhtmlParser
      Initialize the parser. This is called first by AbstractParser.parse(java.io.Reader, org.apache.maven.doxia.sink.Sink) and can be used to set the parser into a clear state so it can be re-used.
      Overrides:
      init in class XhtmlParser
    • baseEndTag

      protected boolean baseEndTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Sink sink)
      Description copied from class: XhtmlBaseParser

      Goes through a common list of possible html end tags. These should be re-usable by different xhtml-based parsers. The tags handled here are the same as for XhtmlBaseParser.baseStartTag(XmlPullParser,Sink), except for the empty elements (<br/>, <hr/>, <img/>).

      Overrides:
      baseEndTag in class XhtmlBaseParser
      Parameters:
      parser - A parser.
      sink - the sink to receive the events.
      Returns:
      True if the event has been handled by this method, false otherwise.
    • baseStartTag

      protected boolean baseStartTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Sink sink)
      Description copied from class: XhtmlBaseParser

      Goes through a common list of possible html start tags. These include only tags that can go into the body of a xhtml document and so should be re-usable by different xhtml-based parsers.

      The currently handled tags are:

      <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <pre>, <ul>, <ol>, <li>, <dl>, <dt>, <dd>, <b>, <strong>, <i>, <em>, <code>, <samp>, <tt>, <a>, <table>, <tr>, <th>, <td>, <caption>, <br/>, <hr/>, <img/>.

      Overrides:
      baseStartTag in class XhtmlBaseParser
      Parameters:
      parser - A parser.
      sink - the sink to receive the events.
      Returns:
      True if the event has been handled by this method, i.e. the tag was recognized, false otherwise.