Class MarkdownParser.MarkdownHtmlParser

All Implemented Interfaces:
MacroExecutor, 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
A code block does not carry the source decoration on its verbatim event, unlike the APT and XDoc modules. The language of a fenced code block has to be conveyed anyway, and the inline event emitted for the nested CODE element carries both that and the code semantics, so the decoration would add nothing. See fencedCodeBlockSinkEvent in the module tests for the exact events.
  • Constructor Details

  • 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.