Class MarkdownParser.MarkdownHtmlParser

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

@Named public static class MarkdownParser.MarkdownHtmlParser extends Xhtml5Parser
Internal parser for HTML generated by the Markdown library. 2 special things:
  • DIV elements are translated as Unknown Sink events
PRE elements need to be "source" because the Xhtml5Sink 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: Xhtml5Parser
      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 Xhtml5Parser
    • baseEndTag

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

      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 Xhtml5BaseParser.baseStartTag(XmlPullParser,Sink), except for the empty elements (<br/>, <hr/>, <img/>).

      Overrides:
      baseEndTag in class Xhtml5BaseParser
      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: Xhtml5BaseParser

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

      The currently handled tags are:

      <article>, <nav>, <aside>, <section>, <h1>, <h2>, <h3>, <h4>, <h5>, <header>, <main>, <footer>, <em>, <strong>, <small>, <s>, <cite>, <q>, <dfn>, <abbr>, <i>, <b>, <code>, <samp>, <kbd>, <sub>, <sup>, <u>, <mark>, <ruby>, <rb>, <rt>, <rtc>, <rp>, <bdi>, <bdo>, <span>, <ins>, <del>, <p>, <pre>, <ul>, <ol>, <li>, <dl>, <dt>, <dd>, <a>, <table>, <tr>, <th>, <td>, <caption>, <br/>, <wbr/>, <hr/>, <img/>.

      Overrides:
      baseStartTag in class Xhtml5BaseParser
      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.