You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/05/29 09:07:29 UTC

[maven-doxia] 02/02: Remove/Disable XHTML(4)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch default-xhtml5
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit 1aac0b0725bed197f71c5d7b25de46b0311e539c
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat May 28 22:19:28 2022 +0200

    Remove/Disable XHTML(4)
---
 .../apache/maven/doxia/parser/XhtmlBaseParser.java | 1241 -----------
 .../maven/doxia/sink/impl/XhtmlBaseSink.java       | 2228 --------------------
 .../maven/doxia/parser/XhtmlBaseParserTest.java    |  779 -------
 .../maven/doxia/sink/impl/XhtmlBaseSinkTest.java   | 1061 ----------
 .../doxia/module/xhtml5/Xhtml5ParserModule.java    |    4 +-
 doxia-modules/pom.xml                              |    1 -
 6 files changed, 2 insertions(+), 5312 deletions(-)

diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
deleted file mode 100644
index c4f78ff4..00000000
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
+++ /dev/null
@@ -1,1241 +0,0 @@
-package org.apache.maven.doxia.parser;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.Reader;
-
-import javax.swing.text.html.HTML.Attribute;
-
-import org.apache.maven.doxia.macro.MacroExecutionException;
-import org.apache.maven.doxia.markup.HtmlMarkup;
-import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.SinkEventAttributes;
-import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
-import org.apache.maven.doxia.util.DoxiaUtils;
-
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.pull.XmlPullParser;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Common base parser for xhtml events.
- *
- * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @author ltheussl
- * @since 1.1
- */
-public class XhtmlBaseParser
-    extends AbstractXmlParser
-        implements HtmlMarkup
-{
-    private static final Logger LOGGER = LoggerFactory.getLogger( XhtmlBaseParser.class );
-
-    /**
-     * True if a &lt;script&gt;&lt;/script&gt; or &lt;style&gt;&lt;/style&gt; block is read. CDATA sections within are
-     * handled as rawText.
-     */
-    private boolean scriptBlock;
-
-    /** Used to distinguish &lt;a href=""&gt; from &lt;a name=""&gt;. */
-    private boolean isLink;
-
-    /** Used to distinguish &lt;a href=""&gt; from &lt;a name=""&gt;. */
-    private boolean isAnchor;
-
-    /** Used for nested lists. */
-    private int orderedListDepth = 0;
-
-    /** Counts section level. */
-    private int sectionLevel;
-
-    /** Verbatim flag, true whenever we are inside a &lt;pre&gt; tag. */
-    private boolean inVerbatim;
-
-    /** Used to recognize the case of img inside figure. */
-    private boolean inFigure;
-
-    /** Used to wrap the definedTerm with its definition, even when one is omitted */
-    boolean hasDefinitionListItem = false;
-
-    /** {@inheritDoc} */
-    @Override
-    public void parse( Reader source, Sink sink, String reference )
-        throws ParseException
-    {
-        init();
-
-        try
-        {
-            super.parse( source, sink, reference );
-        }
-        finally
-        {
-            setSecondParsing( false );
-            init();
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * Adds all XHTML (HTML 4.0) entities to the parser so that they can be recognized and resolved
-     * without additional DTD.
-     */
-    @Override
-    protected void initXmlParser( XmlPullParser parser )
-        throws XmlPullParserException
-    {
-        super.initXmlParser( parser );
-
-        // the entities taken from org.apache.maven.doxia.document.io.xpp3.DocumentXpp3Reader,
-        // which is generated automatically
-
-        // ----------------------------------------------------------------------
-        // Latin 1 entities
-        // ----------------------------------------------------------------------
-
-        parser.defineEntityReplacementText( "nbsp", "\u00a0" );
-        parser.defineEntityReplacementText( "iexcl", "\u00a1" );
-        parser.defineEntityReplacementText( "cent", "\u00a2" );
-        parser.defineEntityReplacementText( "pound", "\u00a3" );
-        parser.defineEntityReplacementText( "curren", "\u00a4" );
-        parser.defineEntityReplacementText( "yen", "\u00a5" );
-        parser.defineEntityReplacementText( "brvbar", "\u00a6" );
-        parser.defineEntityReplacementText( "sect", "\u00a7" );
-        parser.defineEntityReplacementText( "uml", "\u00a8" );
-        parser.defineEntityReplacementText( "copy", "\u00a9" );
-        parser.defineEntityReplacementText( "ordf", "\u00aa" );
-        parser.defineEntityReplacementText( "laquo", "\u00ab" );
-        parser.defineEntityReplacementText( "not", "\u00ac" );
-        parser.defineEntityReplacementText( "shy", "\u00ad" );
-        parser.defineEntityReplacementText( "reg", "\u00ae" );
-        parser.defineEntityReplacementText( "macr", "\u00af" );
-        parser.defineEntityReplacementText( "deg", "\u00b0" );
-        parser.defineEntityReplacementText( "plusmn", "\u00b1" );
-        parser.defineEntityReplacementText( "sup2", "\u00b2" );
-        parser.defineEntityReplacementText( "sup3", "\u00b3" );
-        parser.defineEntityReplacementText( "acute", "\u00b4" );
-        parser.defineEntityReplacementText( "micro", "\u00b5" );
-        parser.defineEntityReplacementText( "para", "\u00b6" );
-        parser.defineEntityReplacementText( "middot", "\u00b7" );
-        parser.defineEntityReplacementText( "cedil", "\u00b8" );
-        parser.defineEntityReplacementText( "sup1", "\u00b9" );
-        parser.defineEntityReplacementText( "ordm", "\u00ba" );
-        parser.defineEntityReplacementText( "raquo", "\u00bb" );
-        parser.defineEntityReplacementText( "frac14", "\u00bc" );
-        parser.defineEntityReplacementText( "frac12", "\u00bd" );
-        parser.defineEntityReplacementText( "frac34", "\u00be" );
-        parser.defineEntityReplacementText( "iquest", "\u00bf" );
-        parser.defineEntityReplacementText( "Agrave", "\u00c0" );
-        parser.defineEntityReplacementText( "Aacute", "\u00c1" );
-        parser.defineEntityReplacementText( "Acirc", "\u00c2" );
-        parser.defineEntityReplacementText( "Atilde", "\u00c3" );
-        parser.defineEntityReplacementText( "Auml", "\u00c4" );
-        parser.defineEntityReplacementText( "Aring", "\u00c5" );
-        parser.defineEntityReplacementText( "AElig", "\u00c6" );
-        parser.defineEntityReplacementText( "Ccedil", "\u00c7" );
-        parser.defineEntityReplacementText( "Egrave", "\u00c8" );
-        parser.defineEntityReplacementText( "Eacute", "\u00c9" );
-        parser.defineEntityReplacementText( "Ecirc", "\u00ca" );
-        parser.defineEntityReplacementText( "Euml", "\u00cb" );
-        parser.defineEntityReplacementText( "Igrave", "\u00cc" );
-        parser.defineEntityReplacementText( "Iacute", "\u00cd" );
-        parser.defineEntityReplacementText( "Icirc", "\u00ce" );
-        parser.defineEntityReplacementText( "Iuml", "\u00cf" );
-        parser.defineEntityReplacementText( "ETH", "\u00d0" );
-        parser.defineEntityReplacementText( "Ntilde", "\u00d1" );
-        parser.defineEntityReplacementText( "Ograve", "\u00d2" );
-        parser.defineEntityReplacementText( "Oacute", "\u00d3" );
-        parser.defineEntityReplacementText( "Ocirc", "\u00d4" );
-        parser.defineEntityReplacementText( "Otilde", "\u00d5" );
-        parser.defineEntityReplacementText( "Ouml", "\u00d6" );
-        parser.defineEntityReplacementText( "times", "\u00d7" );
-        parser.defineEntityReplacementText( "Oslash", "\u00d8" );
-        parser.defineEntityReplacementText( "Ugrave", "\u00d9" );
-        parser.defineEntityReplacementText( "Uacute", "\u00da" );
-        parser.defineEntityReplacementText( "Ucirc", "\u00db" );
-        parser.defineEntityReplacementText( "Uuml", "\u00dc" );
-        parser.defineEntityReplacementText( "Yacute", "\u00dd" );
-        parser.defineEntityReplacementText( "THORN", "\u00de" );
-        parser.defineEntityReplacementText( "szlig", "\u00df" );
-        parser.defineEntityReplacementText( "agrave", "\u00e0" );
-        parser.defineEntityReplacementText( "aacute", "\u00e1" );
-        parser.defineEntityReplacementText( "acirc", "\u00e2" );
-        parser.defineEntityReplacementText( "atilde", "\u00e3" );
-        parser.defineEntityReplacementText( "auml", "\u00e4" );
-        parser.defineEntityReplacementText( "aring", "\u00e5" );
-        parser.defineEntityReplacementText( "aelig", "\u00e6" );
-        parser.defineEntityReplacementText( "ccedil", "\u00e7" );
-        parser.defineEntityReplacementText( "egrave", "\u00e8" );
-        parser.defineEntityReplacementText( "eacute", "\u00e9" );
-        parser.defineEntityReplacementText( "ecirc", "\u00ea" );
-        parser.defineEntityReplacementText( "euml", "\u00eb" );
-        parser.defineEntityReplacementText( "igrave", "\u00ec" );
-        parser.defineEntityReplacementText( "iacute", "\u00ed" );
-        parser.defineEntityReplacementText( "icirc", "\u00ee" );
-        parser.defineEntityReplacementText( "iuml", "\u00ef" );
-        parser.defineEntityReplacementText( "eth", "\u00f0" );
-        parser.defineEntityReplacementText( "ntilde", "\u00f1" );
-        parser.defineEntityReplacementText( "ograve", "\u00f2" );
-        parser.defineEntityReplacementText( "oacute", "\u00f3" );
-        parser.defineEntityReplacementText( "ocirc", "\u00f4" );
-        parser.defineEntityReplacementText( "otilde", "\u00f5" );
-        parser.defineEntityReplacementText( "ouml", "\u00f6" );
-        parser.defineEntityReplacementText( "divide", "\u00f7" );
-        parser.defineEntityReplacementText( "oslash", "\u00f8" );
-        parser.defineEntityReplacementText( "ugrave", "\u00f9" );
-        parser.defineEntityReplacementText( "uacute", "\u00fa" );
-        parser.defineEntityReplacementText( "ucirc", "\u00fb" );
-        parser.defineEntityReplacementText( "uuml", "\u00fc" );
-        parser.defineEntityReplacementText( "yacute", "\u00fd" );
-        parser.defineEntityReplacementText( "thorn", "\u00fe" );
-        parser.defineEntityReplacementText( "yuml", "\u00ff" );
-
-        // ----------------------------------------------------------------------
-        // Special entities
-        // ----------------------------------------------------------------------
-
-        parser.defineEntityReplacementText( "OElig", "\u0152" );
-        parser.defineEntityReplacementText( "oelig", "\u0153" );
-        parser.defineEntityReplacementText( "Scaron", "\u0160" );
-        parser.defineEntityReplacementText( "scaron", "\u0161" );
-        parser.defineEntityReplacementText( "Yuml", "\u0178" );
-        parser.defineEntityReplacementText( "circ", "\u02c6" );
-        parser.defineEntityReplacementText( "tilde", "\u02dc" );
-        parser.defineEntityReplacementText( "ensp", "\u2002" );
-        parser.defineEntityReplacementText( "emsp", "\u2003" );
-        parser.defineEntityReplacementText( "thinsp", "\u2009" );
-        parser.defineEntityReplacementText( "zwnj", "\u200c" );
-        parser.defineEntityReplacementText( "zwj", "\u200d" );
-        parser.defineEntityReplacementText( "lrm", "\u200e" );
-        parser.defineEntityReplacementText( "rlm", "\u200f" );
-        parser.defineEntityReplacementText( "ndash", "\u2013" );
-        parser.defineEntityReplacementText( "mdash", "\u2014" );
-        parser.defineEntityReplacementText( "lsquo", "\u2018" );
-        parser.defineEntityReplacementText( "rsquo", "\u2019" );
-        parser.defineEntityReplacementText( "sbquo", "\u201a" );
-        parser.defineEntityReplacementText( "ldquo", "\u201c" );
-        parser.defineEntityReplacementText( "rdquo", "\u201d" );
-        parser.defineEntityReplacementText( "bdquo", "\u201e" );
-        parser.defineEntityReplacementText( "dagger", "\u2020" );
-        parser.defineEntityReplacementText( "Dagger", "\u2021" );
-        parser.defineEntityReplacementText( "permil", "\u2030" );
-        parser.defineEntityReplacementText( "lsaquo", "\u2039" );
-        parser.defineEntityReplacementText( "rsaquo", "\u203a" );
-        parser.defineEntityReplacementText( "euro", "\u20ac" );
-
-        // ----------------------------------------------------------------------
-        // Symbol entities
-        // ----------------------------------------------------------------------
-
-        parser.defineEntityReplacementText( "fnof", "\u0192" );
-        parser.defineEntityReplacementText( "Alpha", "\u0391" );
-        parser.defineEntityReplacementText( "Beta", "\u0392" );
-        parser.defineEntityReplacementText( "Gamma", "\u0393" );
-        parser.defineEntityReplacementText( "Delta", "\u0394" );
-        parser.defineEntityReplacementText( "Epsilon", "\u0395" );
-        parser.defineEntityReplacementText( "Zeta", "\u0396" );
-        parser.defineEntityReplacementText( "Eta", "\u0397" );
-        parser.defineEntityReplacementText( "Theta", "\u0398" );
-        parser.defineEntityReplacementText( "Iota", "\u0399" );
-        parser.defineEntityReplacementText( "Kappa", "\u039a" );
-        parser.defineEntityReplacementText( "Lambda", "\u039b" );
-        parser.defineEntityReplacementText( "Mu", "\u039c" );
-        parser.defineEntityReplacementText( "Nu", "\u039d" );
-        parser.defineEntityReplacementText( "Xi", "\u039e" );
-        parser.defineEntityReplacementText( "Omicron", "\u039f" );
-        parser.defineEntityReplacementText( "Pi", "\u03a0" );
-        parser.defineEntityReplacementText( "Rho", "\u03a1" );
-        parser.defineEntityReplacementText( "Sigma", "\u03a3" );
-        parser.defineEntityReplacementText( "Tau", "\u03a4" );
-        parser.defineEntityReplacementText( "Upsilon", "\u03a5" );
-        parser.defineEntityReplacementText( "Phi", "\u03a6" );
-        parser.defineEntityReplacementText( "Chi", "\u03a7" );
-        parser.defineEntityReplacementText( "Psi", "\u03a8" );
-        parser.defineEntityReplacementText( "Omega", "\u03a9" );
-        parser.defineEntityReplacementText( "alpha", "\u03b1" );
-        parser.defineEntityReplacementText( "beta", "\u03b2" );
-        parser.defineEntityReplacementText( "gamma", "\u03b3" );
-        parser.defineEntityReplacementText( "delta", "\u03b4" );
-        parser.defineEntityReplacementText( "epsilon", "\u03b5" );
-        parser.defineEntityReplacementText( "zeta", "\u03b6" );
-        parser.defineEntityReplacementText( "eta", "\u03b7" );
-        parser.defineEntityReplacementText( "theta", "\u03b8" );
-        parser.defineEntityReplacementText( "iota", "\u03b9" );
-        parser.defineEntityReplacementText( "kappa", "\u03ba" );
-        parser.defineEntityReplacementText( "lambda", "\u03bb" );
-        parser.defineEntityReplacementText( "mu", "\u03bc" );
-        parser.defineEntityReplacementText( "nu", "\u03bd" );
-        parser.defineEntityReplacementText( "xi", "\u03be" );
-        parser.defineEntityReplacementText( "omicron", "\u03bf" );
-        parser.defineEntityReplacementText( "pi", "\u03c0" );
-        parser.defineEntityReplacementText( "rho", "\u03c1" );
-        parser.defineEntityReplacementText( "sigmaf", "\u03c2" );
-        parser.defineEntityReplacementText( "sigma", "\u03c3" );
-        parser.defineEntityReplacementText( "tau", "\u03c4" );
-        parser.defineEntityReplacementText( "upsilon", "\u03c5" );
-        parser.defineEntityReplacementText( "phi", "\u03c6" );
-        parser.defineEntityReplacementText( "chi", "\u03c7" );
-        parser.defineEntityReplacementText( "psi", "\u03c8" );
-        parser.defineEntityReplacementText( "omega", "\u03c9" );
-        parser.defineEntityReplacementText( "thetasym", "\u03d1" );
-        parser.defineEntityReplacementText( "upsih", "\u03d2" );
-        parser.defineEntityReplacementText( "piv", "\u03d6" );
-        parser.defineEntityReplacementText( "bull", "\u2022" );
-        parser.defineEntityReplacementText( "hellip", "\u2026" );
-        parser.defineEntityReplacementText( "prime", "\u2032" );
-        parser.defineEntityReplacementText( "Prime", "\u2033" );
-        parser.defineEntityReplacementText( "oline", "\u203e" );
-        parser.defineEntityReplacementText( "frasl", "\u2044" );
-        parser.defineEntityReplacementText( "weierp", "\u2118" );
-        parser.defineEntityReplacementText( "image", "\u2111" );
-        parser.defineEntityReplacementText( "real", "\u211c" );
-        parser.defineEntityReplacementText( "trade", "\u2122" );
-        parser.defineEntityReplacementText( "alefsym", "\u2135" );
-        parser.defineEntityReplacementText( "larr", "\u2190" );
-        parser.defineEntityReplacementText( "uarr", "\u2191" );
-        parser.defineEntityReplacementText( "rarr", "\u2192" );
-        parser.defineEntityReplacementText( "darr", "\u2193" );
-        parser.defineEntityReplacementText( "harr", "\u2194" );
-        parser.defineEntityReplacementText( "crarr", "\u21b5" );
-        parser.defineEntityReplacementText( "lArr", "\u21d0" );
-        parser.defineEntityReplacementText( "uArr", "\u21d1" );
-        parser.defineEntityReplacementText( "rArr", "\u21d2" );
-        parser.defineEntityReplacementText( "dArr", "\u21d3" );
-        parser.defineEntityReplacementText( "hArr", "\u21d4" );
-        parser.defineEntityReplacementText( "forall", "\u2200" );
-        parser.defineEntityReplacementText( "part", "\u2202" );
-        parser.defineEntityReplacementText( "exist", "\u2203" );
-        parser.defineEntityReplacementText( "empty", "\u2205" );
-        parser.defineEntityReplacementText( "nabla", "\u2207" );
-        parser.defineEntityReplacementText( "isin", "\u2208" );
-        parser.defineEntityReplacementText( "notin", "\u2209" );
-        parser.defineEntityReplacementText( "ni", "\u220b" );
-        parser.defineEntityReplacementText( "prod", "\u220f" );
-        parser.defineEntityReplacementText( "sum", "\u2211" );
-        parser.defineEntityReplacementText( "minus", "\u2212" );
-        parser.defineEntityReplacementText( "lowast", "\u2217" );
-        parser.defineEntityReplacementText( "radic", "\u221a" );
-        parser.defineEntityReplacementText( "prop", "\u221d" );
-        parser.defineEntityReplacementText( "infin", "\u221e" );
-        parser.defineEntityReplacementText( "ang", "\u2220" );
-        parser.defineEntityReplacementText( "and", "\u2227" );
-        parser.defineEntityReplacementText( "or", "\u2228" );
-        parser.defineEntityReplacementText( "cap", "\u2229" );
-        parser.defineEntityReplacementText( "cup", "\u222a" );
-        parser.defineEntityReplacementText( "int", "\u222b" );
-        parser.defineEntityReplacementText( "there4", "\u2234" );
-        parser.defineEntityReplacementText( "sim", "\u223c" );
-        parser.defineEntityReplacementText( "cong", "\u2245" );
-        parser.defineEntityReplacementText( "asymp", "\u2248" );
-        parser.defineEntityReplacementText( "ne", "\u2260" );
-        parser.defineEntityReplacementText( "equiv", "\u2261" );
-        parser.defineEntityReplacementText( "le", "\u2264" );
-        parser.defineEntityReplacementText( "ge", "\u2265" );
-        parser.defineEntityReplacementText( "sub", "\u2282" );
-        parser.defineEntityReplacementText( "sup", "\u2283" );
-        parser.defineEntityReplacementText( "nsub", "\u2284" );
-        parser.defineEntityReplacementText( "sube", "\u2286" );
-        parser.defineEntityReplacementText( "supe", "\u2287" );
-        parser.defineEntityReplacementText( "oplus", "\u2295" );
-        parser.defineEntityReplacementText( "otimes", "\u2297" );
-        parser.defineEntityReplacementText( "perp", "\u22a5" );
-        parser.defineEntityReplacementText( "sdot", "\u22c5" );
-        parser.defineEntityReplacementText( "lceil", "\u2308" );
-        parser.defineEntityReplacementText( "rceil", "\u2309" );
-        parser.defineEntityReplacementText( "lfloor", "\u230a" );
-        parser.defineEntityReplacementText( "rfloor", "\u230b" );
-        parser.defineEntityReplacementText( "lang", "\u2329" );
-        parser.defineEntityReplacementText( "rang", "\u232a" );
-        parser.defineEntityReplacementText( "loz", "\u25ca" );
-        parser.defineEntityReplacementText( "spades", "\u2660" );
-        parser.defineEntityReplacementText( "clubs", "\u2663" );
-        parser.defineEntityReplacementText( "hearts", "\u2665" );
-        parser.defineEntityReplacementText( "diams", "\u2666" );
-    }
-
-    /**
-     * <p>
-     *   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.
-     * </p>
-     * <p>
-     *   The currently handled tags are:
-     * </p>
-     * <p>
-     *   <code>
-     *      &lt;h1&gt;, &lt;h2&gt;, &lt;h3&gt;, &lt;h4&gt;, &lt;h5&gt;, &lt;p&gt;, &lt;pre&gt;,
-     *      &lt;ul&gt;, &lt;ol&gt;, &lt;li&gt;, &lt;dl&gt;, &lt;dt&gt;, &lt;dd&gt;, &lt;b&gt;, &lt;strong&gt;,
-     *      &lt;i&gt;, &lt;em&gt;, &lt;code&gt;, &lt;samp&gt;, &lt;tt&gt;, &lt;a&gt;, &lt;table&gt;, &lt;tr&gt;,
-     *      &lt;th&gt;, &lt;td&gt;, &lt;caption&gt;, &lt;br/&gt;, &lt;hr/&gt;, &lt;img/&gt;.
-     *   </code>
-     * </p>
-     *
-     * @param parser A parser.
-     * @param sink the sink to receive the events.
-     * @return True if the event has been handled by this method, i.e. the tag was recognized, false otherwise.
-     */
-    protected boolean baseStartTag( XmlPullParser parser, Sink sink )
-    {
-        boolean visited = true;
-
-        SinkEventAttributeSet attribs = getAttributesFromParser( parser );
-
-        if ( parser.getName().equals( HtmlMarkup.H1.toString() ) )
-        {
-            handleSectionStart( sink, Sink.SECTION_LEVEL_1, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) )
-        {
-            handleSectionStart( sink, Sink.SECTION_LEVEL_2, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) )
-        {
-            handleSectionStart( sink, Sink.SECTION_LEVEL_3, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) )
-        {
-            handleSectionStart( sink, Sink.SECTION_LEVEL_4, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) )
-        {
-            handleSectionStart( sink, Sink.SECTION_LEVEL_5, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.U.toString() ) )
-        {
-            attribs.addAttributes( SinkEventAttributeSet.Semantics.ANNOTATION );
-            sink.inline( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.S.toString() )
-                || parser.getName().equals( HtmlMarkup.STRIKE.toString() )
-                || parser.getName().equals( "del" ) )
-        {
-            attribs.addAttributes( SinkEventAttributeSet.Semantics.LINE_THROUGH );
-            sink.inline( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.SUB.toString() ) )
-        {
-            attribs.addAttributes( SinkEventAttributeSet.Semantics.SUBSCRIPT );
-            sink.inline( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.SUP.toString() ) )
-        {
-            attribs.addAttributes( SinkEventAttributeSet.Semantics.SUPERSCRIPT );
-            sink.inline( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.P.toString() ) )
-        {
-            handlePStart( sink, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.DIV.toString() ) )
-        {
-            visited = handleDivStart( parser, attribs, sink );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.PRE.toString() ) )
-        {
-            handlePreStart( attribs, sink );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.UL.toString() ) )
-        {
-            sink.list( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.OL.toString() ) )
-        {
-            handleOLStart( parser, sink, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.LI.toString() ) )
-        {
-            handleLIStart( sink, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.DL.toString() ) )
-        {
-            sink.definitionList( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.DT.toString() ) )
-        {
-            if ( hasDefinitionListItem )
-            {
-                // close previous listItem
-                sink.definitionListItem_();
-            }
-            sink.definitionListItem( attribs );
-            hasDefinitionListItem = true;
-            sink.definedTerm( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.DD.toString() ) )
-        {
-            if ( !hasDefinitionListItem )
-            {
-                sink.definitionListItem( attribs );
-            }
-            sink.definition( attribs );
-        }
-        else if ( ( parser.getName().equals( HtmlMarkup.B.toString() ) )
-                || ( parser.getName().equals( HtmlMarkup.STRONG.toString() ) ) )
-        {
-            sink.inline( SinkEventAttributeSet.Semantics.BOLD );
-        }
-        else if ( ( parser.getName().equals( HtmlMarkup.I.toString() ) )
-                || ( parser.getName().equals( HtmlMarkup.EM.toString() ) ) )
-        {
-            handleFigureCaptionStart( sink, attribs );
-        }
-        else if ( ( parser.getName().equals( HtmlMarkup.CODE.toString() ) )
-                || ( parser.getName().equals( HtmlMarkup.SAMP.toString() ) )
-                || ( parser.getName().equals( HtmlMarkup.TT.toString() ) ) )
-        {
-            attribs.addAttributes( SinkEventAttributeSet.Semantics.CODE );
-            sink.inline( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.A.toString() ) )
-        {
-            handleAStart( parser, sink, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.TABLE.toString() ) )
-        {
-            handleTableStart( sink, attribs, parser );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.TR.toString() ) )
-        {
-            sink.tableRow( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.TH.toString() ) )
-        {
-            sink.tableHeaderCell( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.TD.toString() ) )
-        {
-            sink.tableCell( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.CAPTION.toString() ) )
-        {
-            sink.tableCaption( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.BR.toString() ) )
-        {
-            sink.lineBreak( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.HR.toString() ) )
-        {
-            sink.horizontalRule( attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.IMG.toString() ) )
-        {
-            handleImgStart( parser, sink, attribs );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.SCRIPT.toString() )
-            || parser.getName().equals( HtmlMarkup.STYLE.toString() ) )
-        {
-            handleUnknown( parser, sink, TAG_TYPE_START );
-            scriptBlock = true;
-        }
-        else
-        {
-            visited = false;
-        }
-
-        return visited;
-    }
-
-    /**
-     * <p>
-     *   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 {@link #baseStartTag(XmlPullParser,Sink)},
-     *   except for the empty elements ({@code <br/>, <hr/>, <img/>}).
-     * </p>
-     *
-     * @param parser A parser.
-     * @param sink the sink to receive the events.
-     * @return True if the event has been handled by this method, false otherwise.
-     */
-    protected boolean baseEndTag( XmlPullParser parser, Sink sink )
-    {
-        boolean visited = true;
-
-        if ( parser.getName().equals( HtmlMarkup.P.toString() ) )
-        {
-            if ( !inFigure )
-            {
-                sink.paragraph_();
-            }
-        }
-        else if ( parser.getName().equals( HtmlMarkup.U.toString() )
-                || parser.getName().equals( HtmlMarkup.S.toString() )
-                || parser.getName().equals( HtmlMarkup.STRIKE.toString() )
-                || parser.getName().equals( "del" ) )
-        {
-            sink.inline_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.SUB.toString() )
-                || parser.getName().equals( HtmlMarkup.SUP.toString() ) )
-        {
-            sink.inline_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.DIV.toString() ) )
-        {
-            if ( inFigure )
-            {
-                sink.figure_();
-                this.inFigure = false;
-            }
-            else
-            {
-                visited = false;
-            }
-        }
-        else if ( parser.getName().equals( HtmlMarkup.PRE.toString() ) )
-        {
-            verbatim_();
-
-            sink.verbatim_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.UL.toString() ) )
-        {
-            sink.list_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.OL.toString() ) )
-        {
-            sink.numberedList_();
-            orderedListDepth--;
-        }
-        else if ( parser.getName().equals( HtmlMarkup.LI.toString() ) )
-        {
-            handleListItemEnd( sink );
-        }
-        else if ( parser.getName().equals( HtmlMarkup.DL.toString() ) )
-        {
-            if ( hasDefinitionListItem )
-            {
-                sink.definitionListItem_();
-                hasDefinitionListItem = false;
-            }
-            sink.definitionList_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.DT.toString() ) )
-        {
-            sink.definedTerm_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.DD.toString() ) )
-        {
-            sink.definition_();
-            sink.definitionListItem_();
-            hasDefinitionListItem = false;
-        }
-        else if ( ( parser.getName().equals( HtmlMarkup.B.toString() ) )
-                || ( parser.getName().equals( HtmlMarkup.STRONG.toString() ) ) )
-        {
-            sink.inline_();
-        }
-        else if ( ( parser.getName().equals( HtmlMarkup.I.toString() ) )
-                || ( parser.getName().equals( HtmlMarkup.EM.toString() ) ) )
-        {
-            handleFigureCaptionEnd( sink );
-        }
-        else if ( ( parser.getName().equals( HtmlMarkup.CODE.toString() ) )
-                || ( parser.getName().equals( HtmlMarkup.SAMP.toString() ) )
-                || ( parser.getName().equals( HtmlMarkup.TT.toString() ) ) )
-        {
-            sink.inline_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.A.toString() ) )
-        {
-            handleAEnd( sink );
-        }
-
-        // ----------------------------------------------------------------------
-        // Tables
-        // ----------------------------------------------------------------------
-
-        else if ( parser.getName().equals( HtmlMarkup.TABLE.toString() ) )
-        {
-            sink.tableRows_();
-
-            sink.table_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.TR.toString() ) )
-        {
-            sink.tableRow_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.TH.toString() ) )
-        {
-            sink.tableHeaderCell_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.TD.toString() ) )
-        {
-            sink.tableCell_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.CAPTION.toString() ) )
-        {
-            sink.tableCaption_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H1.toString() ) )
-        {
-            sink.sectionTitle1_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H2.toString() ) )
-        {
-            sink.sectionTitle2_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H3.toString() ) )
-        {
-            sink.sectionTitle3_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H4.toString() ) )
-        {
-            sink.sectionTitle4_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.H5.toString() ) )
-        {
-            sink.sectionTitle5_();
-        }
-        else if ( parser.getName().equals( HtmlMarkup.SCRIPT.toString() )
-            || parser.getName().equals( HtmlMarkup.STYLE.toString() ) )
-        {
-            handleUnknown( parser, sink, TAG_TYPE_END );
-
-            scriptBlock = false;
-        }
-        else
-        {
-            visited = false;
-        }
-
-        return visited;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * Just calls {@link #baseStartTag(XmlPullParser,Sink)}, this should be
-     * overridden by implementing parsers to include additional tags.
-     */
-    protected void handleStartTag( XmlPullParser parser, Sink sink )
-        throws XmlPullParserException, MacroExecutionException
-    {
-        if ( !baseStartTag( parser, sink ) )
-        {
-            LOGGER.warn( "Unrecognized xml tag <{}> at [{}:{}]", parser.getName(),
-                    parser.getLineNumber(), parser.getColumnNumber() );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * Just calls {@link #baseEndTag(XmlPullParser,Sink)}, this should be
-     * overridden by implementing parsers to include additional tags.
-     */
-    protected void handleEndTag( XmlPullParser parser, Sink sink )
-        throws XmlPullParserException, MacroExecutionException
-    {
-        if ( !baseEndTag( parser, sink ) )
-        {
-            // unrecognized tag is already logged in StartTag
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void handleText( XmlPullParser parser, Sink sink )
-        throws XmlPullParserException
-    {
-        String text = getText( parser );
-
-        /*
-         * NOTE: Don't do any whitespace trimming here. Whitespace normalization has already been performed by the
-         * parser so any whitespace that makes it here is significant.
-         *
-         * NOTE: text within script tags is ignored, scripting code should be embedded in CDATA.
-         */
-        if ( StringUtils.isNotEmpty( text ) && !isScriptBlock() )
-        {
-            sink.text( text );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void handleComment( XmlPullParser parser, Sink sink )
-        throws XmlPullParserException
-    {
-        String text = getText( parser );
-
-        if ( "PB".equals( text.trim() ) )
-        {
-            sink.pageBreak();
-        }
-        else
-        {
-            if ( isEmitComments() )
-            {
-                sink.comment( text );
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void handleCdsect( XmlPullParser parser, Sink sink )
-        throws XmlPullParserException
-    {
-        String text = getText( parser );
-
-        if ( isScriptBlock() )
-        {
-            sink.unknown( CDATA, new Object[] { CDATA_TYPE, text }, null );
-        }
-        else
-        {
-            sink.text( text );
-        }
-    }
-
-    /**
-     * Make sure sections are nested consecutively.
-     *
-     * <p>
-     * HTML doesn't have any sections, only sectionTitles (&lt;h2&gt; etc), that means we have to
-     * open close any sections that are missing in between.
-     * </p>
-     *
-     * <p>
-     * For instance, if the following sequence is parsed:
-     * </p>
-     * <pre>
-     * &lt;h2&gt;&lt;/h2&gt;
-     * &lt;h5&gt;&lt;/h5&gt;
-     * </pre>
-     * <p>
-     * we have to insert two section starts before we open the <code>&lt;h5&gt;</code>.
-     * In the following sequence
-     * </p>
-     * <pre>
-     * &lt;h5&gt;&lt;/h5&gt;
-     * &lt;h2&gt;&lt;/h2&gt;
-     * </pre>
-     * <p>
-     * we have to close two sections before we open the <code>&lt;h2&gt;</code>.
-     * </p>
-     *
-     * <p>The current level is set to newLevel afterwards.</p>
-     *
-     * @param newLevel the new section level, all upper levels have to be closed.
-     * @param sink the sink to receive the events.
-     */
-    protected void consecutiveSections( int newLevel, Sink sink )
-    {
-        closeOpenSections( newLevel, sink );
-        openMissingSections( newLevel, sink );
-
-        this.sectionLevel = newLevel;
-    }
-
-    /**
-     * Close open sections.
-     *
-     * @param newLevel the new section level, all upper levels have to be closed.
-     * @param sink the sink to receive the events.
-     */
-    private void closeOpenSections( int newLevel, Sink sink )
-    {
-        while ( this.sectionLevel >= newLevel )
-        {
-            if ( sectionLevel == Sink.SECTION_LEVEL_5 )
-            {
-                sink.section5_();
-            }
-            else if ( sectionLevel == Sink.SECTION_LEVEL_4 )
-            {
-                sink.section4_();
-            }
-            else if ( sectionLevel == Sink.SECTION_LEVEL_3 )
-            {
-                sink.section3_();
-            }
-            else if ( sectionLevel == Sink.SECTION_LEVEL_2 )
-            {
-                sink.section2_();
-            }
-            else if ( sectionLevel == Sink.SECTION_LEVEL_1 )
-            {
-                sink.section1_();
-            }
-
-            this.sectionLevel--;
-        }
-    }
-
-    /**
-     * Open missing sections.
-     *
-     * @param newLevel the new section level, all lower levels have to be opened.
-     * @param sink the sink to receive the events.
-     */
-    private void openMissingSections( int newLevel, Sink sink )
-    {
-        while ( this.sectionLevel < newLevel - 1 )
-        {
-            this.sectionLevel++;
-
-            if ( sectionLevel == Sink.SECTION_LEVEL_5 )
-            {
-                sink.section5();
-            }
-            else if ( sectionLevel == Sink.SECTION_LEVEL_4 )
-            {
-                sink.section4();
-            }
-            else if ( sectionLevel == Sink.SECTION_LEVEL_3 )
-            {
-                sink.section3();
-            }
-            else if ( sectionLevel == Sink.SECTION_LEVEL_2 )
-            {
-                sink.section2();
-            }
-            else if ( sectionLevel == Sink.SECTION_LEVEL_1 )
-            {
-                sink.section1();
-            }
-        }
-    }
-
-    /**
-     * Return the current section level.
-     *
-     * @return the current section level.
-     */
-    protected int getSectionLevel()
-    {
-        return this.sectionLevel;
-    }
-
-    /**
-     * Set the current section level.
-     *
-     * @param newLevel the new section level.
-     */
-    protected void setSectionLevel( int newLevel )
-    {
-        this.sectionLevel = newLevel;
-    }
-
-    /**
-     * Stop verbatim mode.
-     */
-    protected void verbatim_()
-    {
-        this.inVerbatim = false;
-    }
-
-    /**
-     * Start verbatim mode.
-     */
-    protected void verbatim()
-    {
-        this.inVerbatim = true;
-    }
-
-    /**
-     * Checks if we are currently inside a &lt;pre&gt; tag.
-     *
-     * @return true if we are currently in verbatim mode.
-     */
-    protected boolean isVerbatim()
-    {
-        return this.inVerbatim;
-    }
-
-    /**
-     * Checks if we are currently inside a &lt;script&gt; tag.
-     *
-     * @return true if we are currently inside <code>&lt;script&gt;</code> tags.
-     * @since 1.1.1.
-     */
-    protected boolean isScriptBlock()
-    {
-        return this.scriptBlock;
-    }
-
-    /**
-     * Checks if the given id is a valid Doxia id and if not, returns a transformed one.
-     *
-     * @param id The id to validate.
-     * @return A transformed id or the original id if it was already valid.
-     * @see DoxiaUtils#encodeId(String)
-     */
-    protected String validAnchor( String id )
-    {
-        if ( !DoxiaUtils.isValidId( id ) )
-        {
-            String linkAnchor = DoxiaUtils.encodeId( id, true );
-
-            LOGGER.debug( "Modified invalid link '{}' to '{}'", id, linkAnchor );
-
-            return linkAnchor;
-        }
-
-        return id;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void init()
-    {
-        super.init();
-
-        this.scriptBlock = false;
-        this.isLink = false;
-        this.isAnchor = false;
-        this.orderedListDepth = 0;
-        this.sectionLevel = 0;
-        this.inVerbatim = false;
-        this.inFigure = false;
-    }
-
-    private void handleAEnd( Sink sink )
-    {
-        if ( isLink )
-        {
-            sink.link_();
-            isLink = false;
-        }
-        else if ( isAnchor )
-        {
-            sink.anchor_();
-            isAnchor = false;
-        }
-    }
-
-    private void handleAStart( XmlPullParser parser, Sink sink, SinkEventAttributeSet attribs )
-    {
-        String href = parser.getAttributeValue( null, Attribute.HREF.toString() );
-
-        if ( href != null )
-        {
-            int hashIndex = href.indexOf( '#' );
-            if ( hashIndex != -1 && !DoxiaUtils.isExternalLink( href ) )
-            {
-                String hash = href.substring( hashIndex + 1 );
-
-                if ( !DoxiaUtils.isValidId( hash ) )
-                {
-                    href = href.substring( 0, hashIndex ) + "#" + DoxiaUtils.encodeId( hash, true );
-
-                    LOGGER.debug( "Modified invalid link '{}' to '{}'", hash, href );
-                }
-            }
-            sink.link( href, attribs );
-            isLink = true;
-        }
-        else
-        {
-            String name = parser.getAttributeValue( null, Attribute.NAME.toString() );
-
-            if ( name != null )
-            {
-                sink.anchor( validAnchor( name ), attribs );
-                isAnchor = true;
-            }
-            else
-            {
-                String id = parser.getAttributeValue( null, Attribute.ID.toString() );
-                if ( id != null )
-                {
-                    sink.anchor( validAnchor( id ), attribs );
-                    isAnchor = true;
-                }
-            }
-        }
-    }
-
-    private boolean handleDivStart( XmlPullParser parser, SinkEventAttributeSet attribs, Sink sink )
-    {
-        boolean visited = true;
-
-        String divclass = parser.getAttributeValue( null, Attribute.CLASS.toString() );
-
-        if ( "figure".equals( divclass ) )
-        {
-            this.inFigure = true;
-            SinkEventAttributeSet atts = new SinkEventAttributeSet( attribs );
-            atts.removeAttribute( SinkEventAttributes.CLASS );
-            sink.figure( atts );
-        }
-        else
-        {
-            visited = false;
-        }
-
-        return visited;
-    }
-
-    private void handleFigureCaptionEnd( Sink sink )
-    {
-        if ( inFigure )
-        {
-            sink.figureCaption_();
-        }
-        else
-        {
-            sink.inline_();
-        }
-    }
-
-    private void handleFigureCaptionStart( Sink sink, SinkEventAttributeSet attribs )
-    {
-        if ( inFigure )
-        {
-            sink.figureCaption( attribs );
-        }
-        else
-        {
-            sink.inline( SinkEventAttributeSet.Semantics.ITALIC );
-        }
-    }
-
-    private void handleImgStart( XmlPullParser parser, Sink sink, SinkEventAttributeSet attribs )
-    {
-        String src = parser.getAttributeValue( null, Attribute.SRC.toString() );
-
-        if ( src != null )
-        {
-            sink.figureGraphics( src, attribs );
-        }
-    }
-
-    private void handleLIStart( Sink sink, SinkEventAttributeSet attribs )
-    {
-        if ( orderedListDepth == 0 )
-        {
-            sink.listItem( attribs );
-        }
-        else
-        {
-            sink.numberedListItem( attribs );
-        }
-    }
-
-    private void handleListItemEnd( Sink sink )
-    {
-        if ( orderedListDepth == 0 )
-        {
-            sink.listItem_();
-        }
-        else
-        {
-            sink.numberedListItem_();
-        }
-    }
-
-    private void handleOLStart( XmlPullParser parser, Sink sink, SinkEventAttributeSet attribs )
-    {
-        int numbering = Sink.NUMBERING_DECIMAL;
-        // this will have to be generalized if we handle styles
-        String style = parser.getAttributeValue( null, Attribute.STYLE.toString() );
-
-        if ( style != null )
-        {
-            switch ( style )
-            {
-                case "list-style-type: upper-alpha":
-                    numbering = Sink.NUMBERING_UPPER_ALPHA;
-                    break;
-                case "list-style-type: lower-alpha":
-                    numbering = Sink.NUMBERING_LOWER_ALPHA;
-                    break;
-                case "list-style-type: upper-roman":
-                    numbering = Sink.NUMBERING_UPPER_ROMAN;
-                    break;
-                case "list-style-type: lower-roman":
-                    numbering = Sink.NUMBERING_LOWER_ROMAN;
-                    break;
-                case "list-style-type: decimal":
-                    numbering = Sink.NUMBERING_DECIMAL;
-                    break;
-                default:
-                    // ignore all other
-            }
-        }
-
-        sink.numberedList( numbering, attribs );
-        orderedListDepth++;
-    }
-
-    private void handlePStart( Sink sink, SinkEventAttributeSet attribs )
-    {
-        if ( !inFigure )
-        {
-            sink.paragraph( attribs );
-        }
-    }
-
-    /*
-     * The PRE element tells visual user agents that the enclosed text is
-     * "preformatted". When handling preformatted text, visual user agents:
-     * - May leave white space intact.
-     * - May render text with a fixed-pitch font.
-     * - May disable automatic word wrap.
-     * - Must not disable bidirectional processing.
-     * Non-visual user agents are not required to respect extra white space
-     * in the content of a PRE element.
-     */
-    private void handlePreStart( SinkEventAttributeSet attribs, Sink sink )
-    {
-        verbatim();
-        sink.verbatim( attribs );
-    }
-
-    private void handleSectionStart( Sink sink, int level, SinkEventAttributeSet attribs )
-    {
-        consecutiveSections( level, sink );
-        sink.section( level, attribs );
-        sink.sectionTitle( level, attribs );
-    }
-
-    private void handleTableStart( Sink sink, SinkEventAttributeSet attribs, XmlPullParser parser )
-    {
-        sink.table( attribs );
-        String border = parser.getAttributeValue( null, Attribute.BORDER.toString() );
-        boolean grid = true;
-
-        if ( border == null || "0".equals( border ) )
-        {
-            grid = false;
-        }
-
-        String align = parser.getAttributeValue( null, Attribute.ALIGN.toString() );
-        int[] justif = {Sink.JUSTIFY_LEFT};
-
-        if ( "center".equals( align ) )
-        {
-            justif[0] = Sink.JUSTIFY_CENTER;
-        }
-        else if ( "right".equals( align ) )
-        {
-            justif[0] = Sink.JUSTIFY_RIGHT;
-        }
-
-        sink.tableRows( justif, grid );
-    }
-}
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java
deleted file mode 100644
index bc7ca83f..00000000
--- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java
+++ /dev/null
@@ -1,2228 +0,0 @@
-package org.apache.maven.doxia.sink.impl;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Stack;
-
-import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.html.HTML.Attribute;
-import javax.swing.text.html.HTML.Tag;
-
-import org.apache.maven.doxia.markup.HtmlMarkup;
-import org.apache.maven.doxia.markup.Markup;
-import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.SinkEventAttributes;
-import org.apache.maven.doxia.util.DoxiaUtils;
-import org.apache.maven.doxia.util.HtmlTools;
-
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Abstract base xhtml sink implementation.
- *
- * @author Jason van Zyl
- * @author ltheussl
- * @since 1.1
- */
-public class XhtmlBaseSink
-    extends AbstractXmlSink
-    implements HtmlMarkup
-{
-    private static final Logger LOGGER = LoggerFactory.getLogger( XhtmlBaseSink.class );
-
-    // ----------------------------------------------------------------------
-    // Instance fields
-    // ----------------------------------------------------------------------
-
-    /** The PrintWriter to write the result. */
-    private final PrintWriter writer;
-
-    /** Used to collect text events mainly for the head events. */
-    private StringBuffer textBuffer = new StringBuffer();
-
-    /** An indication on if we're inside a head. */
-    private boolean headFlag;
-
-    /** An indication on if we're inside an image caption flag. */
-    private boolean figureCaptionFlag;
-
-    /** An indication on if we're inside a paragraph flag. */
-    private boolean paragraphFlag;
-
-    /** An indication on if we're in verbatim mode. */
-    private boolean verbatimFlag;
-
-    /** Stack of alignment int[] of table cells. */
-    private final LinkedList<int[]> cellJustifStack;
-
-    /** Stack of justification of table cells. */
-    private final LinkedList<Boolean> isCellJustifStack;
-
-    /** Stack of current table cell. */
-    private final LinkedList<Integer> cellCountStack;
-
-    /** Used to style successive table rows differently. */
-    private boolean evenTableRow = true;
-
-    /** The stack of StringWriter to write the table result temporary, so we could play with the output DOXIA-177. */
-    private final LinkedList<StringWriter> tableContentWriterStack;
-
-    private final LinkedList<StringWriter> tableCaptionWriterStack;
-
-    private final LinkedList<PrettyPrintXMLWriter> tableCaptionXMLWriterStack;
-
-    /** The stack of table caption */
-    private final LinkedList<String> tableCaptionStack;
-
-    /** used to store attributes passed to table(). */
-    protected MutableAttributeSet tableAttributes;
-
-    /** Used to distinguish old-style figure handling. */
-    private boolean legacyFigure;
-
-    /** Used to distinguish old-style figure handling. */
-    private boolean legacyFigureCaption;
-
-    /** Indicates that an image is part of a figure. */
-    private boolean inFigure;
-
-    /** Flag to know if {@link #tableRows(int[], boolean)} is called or not. It is mainly to be backward compatible
-     * with some plugins (like checkstyle) which uses:
-     * <pre>
-     * sink.table();
-     * sink.tableRow();
-     * </pre>
-     * instead of
-     * <pre>
-     * sink.table();
-     * sink.tableRows( justify, true );
-     * sink.tableRow();
-     * </pre>
-     * */
-    protected boolean tableRows = false;
-
-    /** Keep track of the closing tags for inline events. */
-    protected Stack<List<Tag>> inlineStack = new Stack<>();
-
-    // ----------------------------------------------------------------------
-    // Constructor
-    // ----------------------------------------------------------------------
-
-    /**
-     * Constructor, initialize the PrintWriter.
-     *
-     * @param out The writer to write the result.
-     */
-    public XhtmlBaseSink( Writer out )
-    {
-        this.writer = new PrintWriter( out );
-
-        this.cellJustifStack = new LinkedList<>();
-        this.isCellJustifStack = new LinkedList<>();
-        this.cellCountStack = new LinkedList<>();
-        this.tableContentWriterStack = new LinkedList<>();
-        this.tableCaptionWriterStack = new LinkedList<>();
-        this.tableCaptionXMLWriterStack = new LinkedList<>();
-        this.tableCaptionStack = new LinkedList<>();
-
-        init();
-    }
-
-    // ----------------------------------------------------------------------
-    // Accessor methods
-    // ----------------------------------------------------------------------
-
-    /**
-     * To use mainly when playing with the head events.
-     *
-     * @return the current buffer of text events.
-     */
-    protected StringBuffer getTextBuffer()
-    {
-        return this.textBuffer;
-    }
-
-    /**
-     * <p>Setter for the field <code>headFlag</code>.</p>
-     *
-     * @param headFlag an header flag.
-     */
-    protected void setHeadFlag( boolean headFlag )
-    {
-        this.headFlag = headFlag;
-    }
-
-    /**
-     * <p>isHeadFlag.</p>
-     *
-     * @return the current headFlag.
-     */
-    protected boolean isHeadFlag()
-    {
-        return this.headFlag ;
-    }
-
-    /**
-     * <p>Setter for the field <code>verbatimFlag</code>.</p>
-     *
-     * @param verb a verbatim flag.
-     */
-    protected void setVerbatimFlag( boolean verb )
-    {
-        this.verbatimFlag = verb;
-    }
-
-    /**
-     * <p>isVerbatimFlag.</p>
-     *
-     * @return the current verbatim flag.
-     */
-    protected boolean isVerbatimFlag()
-    {
-        return this.verbatimFlag ;
-    }
-
-    /**
-     * <p>Setter for the field <code>cellJustif</code>.</p>
-     *
-     * @param justif the new cell justification array.
-     */
-    protected void setCellJustif( int[] justif )
-    {
-        this.cellJustifStack.addLast( justif );
-        this.isCellJustifStack.addLast( Boolean.TRUE );
-    }
-
-    /**
-     * <p>Getter for the field <code>cellJustif</code>.</p>
-     *
-     * @return the current cell justification array.
-     */
-    protected int[] getCellJustif()
-    {
-        return this.cellJustifStack.getLast();
-    }
-
-    /**
-     * <p>Setter for the field <code>cellCount</code>.</p>
-     *
-     * @param count the new cell count.
-     */
-    protected void setCellCount( int count )
-    {
-        this.cellCountStack.addLast( count );
-    }
-
-    /**
-     * <p>Getter for the field <code>cellCount</code>.</p>
-     *
-     * @return the current cell count.
-     */
-    protected int getCellCount()
-    {
-        return Integer.parseInt( this.cellCountStack.getLast().toString() );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void init()
-    {
-        super.init();
-
-        resetTextBuffer();
-
-        this.cellJustifStack.clear();
-        this.isCellJustifStack.clear();
-        this.cellCountStack.clear();
-        this.tableContentWriterStack.clear();
-        this.tableCaptionWriterStack.clear();
-        this.tableCaptionXMLWriterStack.clear();
-        this.tableCaptionStack.clear();
-
-        this.headFlag = false;
-        this.figureCaptionFlag = false;
-        this.paragraphFlag = false;
-        this.verbatimFlag = false;
-
-        this.evenTableRow = true;
-        this.tableAttributes = null;
-        this.legacyFigure = false;
-        this.legacyFigureCaption = false;
-        this.inFigure = false;
-        this.tableRows = false;
-    }
-
-    /**
-     * Reset the text buffer.
-     */
-    protected void resetTextBuffer()
-    {
-        this.textBuffer = new StringBuffer();
-    }
-
-    // ----------------------------------------------------------------------
-    // Sections
-    // ----------------------------------------------------------------------
-
-    /** {@inheritDoc} */
-    @Override
-    public void section( int level, SinkEventAttributes attributes )
-    {
-        onSection( level, attributes );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle( int level, SinkEventAttributes attributes )
-    {
-        onSectionTitle( level, attributes );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle_( int level )
-    {
-        onSectionTitle_( level );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section_( int level )
-    {
-        onSection_( level );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section1()
-    {
-        onSection( SECTION_LEVEL_1, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle1()
-    {
-        onSectionTitle( SECTION_LEVEL_1, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle1_()
-    {
-        onSectionTitle_( SECTION_LEVEL_1 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section1_()
-    {
-        onSection_( SECTION_LEVEL_1 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section2()
-    {
-        onSection( SECTION_LEVEL_2, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle2()
-    {
-        onSectionTitle( SECTION_LEVEL_2, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle2_()
-    {
-        onSectionTitle_( SECTION_LEVEL_2 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section2_()
-    {
-        onSection_( SECTION_LEVEL_2 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section3()
-    {
-        onSection( SECTION_LEVEL_3, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle3()
-    {
-        onSectionTitle( SECTION_LEVEL_3, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle3_()
-    {
-        onSectionTitle_( SECTION_LEVEL_3 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section3_()
-    {
-        onSection_( SECTION_LEVEL_3 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section4()
-    {
-        onSection( SECTION_LEVEL_4, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle4()
-    {
-        onSectionTitle( SECTION_LEVEL_4, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle4_()
-    {
-        onSectionTitle_( SECTION_LEVEL_4 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section4_()
-    {
-        onSection_( SECTION_LEVEL_4 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section5()
-    {
-        onSection( SECTION_LEVEL_5, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle5()
-    {
-        onSectionTitle( SECTION_LEVEL_5, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void sectionTitle5_()
-    {
-        onSectionTitle_( SECTION_LEVEL_5 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void section5_()
-    {
-        onSection_( SECTION_LEVEL_5 );
-    }
-
-    /**
-     * Starts a section. The default class style is <code>section</code>.
-     *
-     * @param depth The level of the section.
-     * @param attributes some attributes. May be null.
-     * @see javax.swing.text.html.HTML.Tag#DIV
-     */
-    protected void onSection( int depth, SinkEventAttributes attributes )
-    {
-        if ( depth >= SECTION_LEVEL_1 && depth <= SECTION_LEVEL_5 )
-        {
-            MutableAttributeSet att = new SinkEventAttributeSet();
-            att.addAttribute( Attribute.CLASS, "section" );
-            // NOTE: any class entry in attributes will overwrite the above
-            att.addAttributes( SinkUtils.filterAttributes(
-                    attributes, SinkUtils.SINK_BASE_ATTRIBUTES  ) );
-
-            writeStartTag( HtmlMarkup.DIV, att );
-        }
-    }
-
-    /**
-     * Ends a section.
-     *
-     * @param depth The level of the section.
-     * @see javax.swing.text.html.HTML.Tag#DIV
-     */
-    protected void onSection_( int depth )
-    {
-        if ( depth >= SECTION_LEVEL_1 && depth <= SECTION_LEVEL_5 )
-        {
-            writeEndTag( HtmlMarkup.DIV );
-        }
-    }
-
-    /**
-     * Starts a section title.
-     *
-     * @param depth The level of the section title.
-     * @param attributes some attributes. May be null.
-     * @see javax.swing.text.html.HTML.Tag#H1
-     * @see javax.swing.text.html.HTML.Tag#H2
-     * @see javax.swing.text.html.HTML.Tag#H3
-     * @see javax.swing.text.html.HTML.Tag#H4
-     * @see javax.swing.text.html.HTML.Tag#H5
-     */
-    protected void onSectionTitle( int depth, SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_SECTION_ATTRIBUTES  );
-
-        if ( depth == SECTION_LEVEL_1 )
-        {
-            writeStartTag( HtmlMarkup.H1, atts );
-        }
-        else if ( depth == SECTION_LEVEL_2 )
-        {
-            writeStartTag( HtmlMarkup.H2, atts );
-        }
-        else if ( depth == SECTION_LEVEL_3 )
-        {
-            writeStartTag( HtmlMarkup.H3, atts );
-        }
-        else if ( depth == SECTION_LEVEL_4 )
-        {
-            writeStartTag( HtmlMarkup.H4, atts );
-        }
-        else if ( depth == SECTION_LEVEL_5 )
-        {
-            writeStartTag( HtmlMarkup.H5, atts );
-        }
-    }
-
-    /**
-     * Ends a section title.
-     *
-     * @param depth The level of the section title.
-     * @see javax.swing.text.html.HTML.Tag#H1
-     * @see javax.swing.text.html.HTML.Tag#H2
-     * @see javax.swing.text.html.HTML.Tag#H3
-     * @see javax.swing.text.html.HTML.Tag#H4
-     * @see javax.swing.text.html.HTML.Tag#H5
-     */
-    protected void onSectionTitle_( int depth )
-    {
-        if ( depth == SECTION_LEVEL_1 )
-        {
-            writeEndTag( HtmlMarkup.H1 );
-        }
-        else if ( depth == SECTION_LEVEL_2 )
-        {
-            writeEndTag( HtmlMarkup.H2 );
-        }
-        else if ( depth == SECTION_LEVEL_3 )
-        {
-            writeEndTag( HtmlMarkup.H3 );
-        }
-        else if ( depth == SECTION_LEVEL_4 )
-        {
-            writeEndTag( HtmlMarkup.H4 );
-        }
-        else if ( depth == SECTION_LEVEL_5 )
-        {
-            writeEndTag( HtmlMarkup.H5 );
-        }
-    }
-
-    // -----------------------------------------------------------------------
-    //
-    // -----------------------------------------------------------------------
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#UL
-     */
-    @Override
-    public void list()
-    {
-        list( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#UL
-     */
-    @Override
-    public void list( SinkEventAttributes attributes )
-    {
-        if ( paragraphFlag )
-        {
-            // The content of element type "p" must match
-            // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
-            // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
-            paragraph_();
-        }
-
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.UL, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#UL
-     */
-    @Override
-    public void list_()
-    {
-        writeEndTag( HtmlMarkup.UL );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#LI
-     */
-    @Override
-    public void listItem()
-    {
-        listItem( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#LI
-     */
-    @Override
-    public void listItem( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.LI, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#LI
-     */
-    @Override
-    public void listItem_()
-    {
-        writeEndTag( HtmlMarkup.LI );
-    }
-
-    /**
-     * The default list style depends on the numbering.
-     *
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#OL
-     */
-    @Override
-    public void numberedList( int numbering )
-    {
-        numberedList( numbering, null );
-    }
-
-    /**
-     * The default list style depends on the numbering.
-     *
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#OL
-     */
-    @Override
-    public void numberedList( int numbering, SinkEventAttributes attributes )
-    {
-        if ( paragraphFlag )
-        {
-            // The content of element type "p" must match
-            // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
-            // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
-            paragraph_();
-        }
-
-        String style;
-        switch ( numbering )
-        {
-            case NUMBERING_UPPER_ALPHA:
-                style = "upper-alpha";
-                break;
-            case NUMBERING_LOWER_ALPHA:
-                style = "lower-alpha";
-                break;
-            case NUMBERING_UPPER_ROMAN:
-                style = "upper-roman";
-                break;
-            case NUMBERING_LOWER_ROMAN:
-                style = "lower-roman";
-                break;
-            case NUMBERING_DECIMAL:
-            default:
-                style = "decimal";
-        }
-
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_SECTION_ATTRIBUTES  );
-
-        if ( atts == null )
-        {
-            atts = new SinkEventAttributeSet( 1 );
-        }
-
-        atts.addAttribute( Attribute.STYLE, "list-style-type: " + style );
-
-        writeStartTag( HtmlMarkup.OL, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#OL
-     */
-    @Override
-    public void numberedList_()
-    {
-        writeEndTag( HtmlMarkup.OL );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#LI
-     */
-    @Override
-    public void numberedListItem()
-    {
-        numberedListItem( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#LI
-     */
-    @Override
-    public void numberedListItem( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.LI, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#LI
-     */
-    @Override
-    public void numberedListItem_()
-    {
-        writeEndTag( HtmlMarkup.LI );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DL
-     */
-    @Override
-    public void definitionList()
-    {
-        definitionList( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DL
-     */
-    @Override
-    public void definitionList( SinkEventAttributes attributes )
-    {
-        if ( paragraphFlag )
-        {
-            // The content of element type "p" must match
-            // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
-            // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
-            paragraph_();
-        }
-
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.DL, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DL
-     */
-    @Override
-    public void definitionList_()
-    {
-        writeEndTag( HtmlMarkup.DL );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DT
-     */
-    @Override
-    public void definedTerm( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.DT, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DT
-     */
-    @Override
-    public void definedTerm()
-    {
-        definedTerm( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DT
-     */
-    @Override
-    public void definedTerm_()
-    {
-        writeEndTag( HtmlMarkup.DT );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DD
-     */
-    @Override
-    public void definition()
-    {
-        definition( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DD
-     */
-    @Override
-    public void definition( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.DD, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DD
-     */
-    @Override
-    public void definition_()
-    {
-        writeEndTag( HtmlMarkup.DD );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#IMG
-     * @deprecated Use {@link #figure(SinkEventAttributes)}, this method is only kept for
-     * backward compatibility. Note that the behavior is different though, as this method
-     * writes an img tag, while correctly the img tag should be written by  figureGraphics().
-     */
-    @Override
-    public void figure()
-    {
-        write( String.valueOf( LESS_THAN ) + HtmlMarkup.IMG );
-        legacyFigure = true;
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#IMG
-     */
-    @Override
-    public void figure( SinkEventAttributes attributes )
-    {
-        inFigure = true;
-
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  );
-
-        if ( atts == null )
-        {
-            atts = new SinkEventAttributeSet( 1 );
-        }
-
-        if ( !atts.isDefined( SinkEventAttributes.CLASS ) )
-        {
-            atts.addAttribute( SinkEventAttributes.CLASS, "figure" );
-        }
-
-        writeStartTag( HtmlMarkup.DIV, atts );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void figure_()
-    {
-        if ( legacyFigure )
-        {
-            if ( !figureCaptionFlag )
-            {
-                // Attribute "alt" is required and must be specified for element type "img".
-                write( String.valueOf( SPACE ) + Attribute.ALT + EQUAL + QUOTE + QUOTE );
-            }
-            write( String.valueOf( SPACE ) + SLASH + GREATER_THAN );
-            legacyFigure = false;
-        }
-        else
-        {
-            writeEndTag( HtmlMarkup.DIV );
-            inFigure = false;
-        }
-
-        figureCaptionFlag = false;
-    }
-
-    /**
-     * {@inheritDoc}
-     * @deprecated Use {@link #figureGraphics(String,SinkEventAttributes)},
-     * this method is only kept for backward compatibility. Note that the behavior is
-     * different though, as this method does not write the img tag, only the src attribute.
-     */
-    @Override
-    public void figureGraphics( String name )
-    {
-        write( String.valueOf( SPACE ) + Attribute.SRC + EQUAL + QUOTE + escapeHTML( name ) + QUOTE );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void figureGraphics( String src, SinkEventAttributes attributes )
-    {
-        if ( inFigure )
-        {
-            MutableAttributeSet atts = new SinkEventAttributeSet( 1 );
-            atts.addAttribute( SinkEventAttributes.ALIGN, "center" );
-
-            writeStartTag( HtmlMarkup.P, atts );
-        }
-
-        MutableAttributeSet filtered = SinkUtils.filterAttributes( attributes, SinkUtils.SINK_IMG_ATTRIBUTES );
-        if ( filtered != null )
-        {
-            filtered.removeAttribute( Attribute.SRC.toString() );
-        }
-
-        int count = ( attributes == null ? 1 : attributes.getAttributeCount() + 1 );
-
-        MutableAttributeSet atts = new SinkEventAttributeSet( count );
-
-        atts.addAttribute( Attribute.SRC, HtmlTools.escapeHTML( src, true ) );
-        atts.addAttributes( filtered );
-
-        if ( atts.getAttribute( Attribute.ALT.toString() ) == null )
-        {
-            atts.addAttribute( Attribute.ALT.toString(), "" );
-        }
-
-        writeStartTag( HtmlMarkup.IMG, atts, true );
-
-        if ( inFigure )
-        {
-            writeEndTag( HtmlMarkup.P );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @deprecated Use {@link #figureCaption(SinkEventAttributes)},
-     * this method is only kept for backward compatibility. Note that the behavior is
-     * different though, as this method only writes an alt attribute.
-     */
-    @Override
-    public void figureCaption()
-    {
-        figureCaptionFlag = true;
-        write( String.valueOf( SPACE ) + Attribute.ALT + EQUAL + QUOTE );
-        legacyFigureCaption = true;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void figureCaption( SinkEventAttributes attributes )
-    {
-        if ( legacyFigureCaption )
-        {
-            write( String.valueOf( SPACE ) + Attribute.ALT + EQUAL + QUOTE );
-            legacyFigureCaption = false;
-            figureCaptionFlag = true;
-        }
-        else
-        {
-            SinkEventAttributeSet atts = new SinkEventAttributeSet( 1 );
-            atts.addAttribute( SinkEventAttributes.ALIGN, "center" );
-            atts.addAttributes( SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  ) );
-
-            paragraph( atts );
-            inline( SinkEventAttributeSet.Semantics.ITALIC );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void figureCaption_()
-    {
-        if ( legacyFigureCaption )
-        {
-            write( String.valueOf( QUOTE ) );
-        }
-        else
-        {
-            inline_();
-            paragraph_();
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#P
-     */
-    @Override
-    public void paragraph()
-    {
-        paragraph( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#P
-     */
-    @Override
-    public void paragraph( SinkEventAttributes attributes )
-    {
-        paragraphFlag = true;
-
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_SECTION_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.P, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#P
-     */
-    @Override
-    public void paragraph_()
-    {
-        if ( paragraphFlag )
-        {
-            writeEndTag( HtmlMarkup.P );
-            paragraphFlag = false;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#ADDRESS
-     */
-    @Override
-    public void address()
-    {
-        address( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#ADDRESS
-     */
-    @Override
-    public void address( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_SECTION_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.ADDRESS, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#ADDRESS
-     */
-    @Override
-    public void address_()
-    {
-        writeEndTag( HtmlMarkup.ADDRESS );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#BLOCKQUOTE
-     */
-    @Override
-    public void blockquote()
-    {
-        blockquote( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#BLOCKQUOTE
-     */
-    @Override
-    public void blockquote( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_SECTION_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.BLOCKQUOTE, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#BLOCKQUOTE
-     */
-    @Override
-    public void blockquote_()
-    {
-        writeEndTag( HtmlMarkup.BLOCKQUOTE );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DIV
-     */
-    @Override
-    public void division()
-    {
-        division( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DIV
-     */
-    @Override
-    public void division( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_SECTION_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.DIV, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DIV
-     */
-    @Override
-    public void division_()
-    {
-        writeEndTag( HtmlMarkup.DIV );
-    }
-
-    /**
-     * The default class style for boxed is <code>source</code>.
-     *
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DIV
-     * @see javax.swing.text.html.HTML.Tag#PRE
-     */
-    @Override
-    public void verbatim( SinkEventAttributes attributes )
-    {
-        if ( paragraphFlag )
-        {
-            // The content of element type "p" must match
-            // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
-            // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
-            paragraph_();
-        }
-
-        verbatimFlag = true;
-
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_VERBATIM_ATTRIBUTES  );
-
-        if ( atts == null )
-        {
-            atts = new SinkEventAttributeSet();
-        }
-
-        boolean boxed = false;
-
-        if ( atts.isDefined( SinkEventAttributes.DECORATION ) )
-        {
-            boxed =
-                "boxed".equals( atts.getAttribute( SinkEventAttributes.DECORATION ).toString() );
-        }
-
-        SinkEventAttributes divAtts = null;
-
-        if ( boxed )
-        {
-            divAtts = new SinkEventAttributeSet( Attribute.CLASS.toString(), "source" );
-        }
-
-        atts.removeAttribute( SinkEventAttributes.DECORATION );
-
-        writeStartTag( HtmlMarkup.DIV, divAtts );
-        writeStartTag( HtmlMarkup.PRE, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#DIV
-     * @see javax.swing.text.html.HTML.Tag#PRE
-     */
-    @Override
-    public void verbatim_()
-    {
-        writeEndTag( HtmlMarkup.PRE );
-        writeEndTag( HtmlMarkup.DIV );
-
-        verbatimFlag = false;
-
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#HR
-     */
-    @Override
-    public void horizontalRule()
-    {
-        horizontalRule( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#HR
-     */
-    @Override
-    public void horizontalRule( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_HR_ATTRIBUTES  );
-
-        writeSimpleTag( HtmlMarkup.HR, atts );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void table()
-    {
-        // start table with tableRows
-        table( null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void table( SinkEventAttributes attributes )
-    {
-        this.tableContentWriterStack.addLast( new StringWriter() );
-        this.tableRows = false;
-
-        if ( paragraphFlag )
-        {
-            // The content of element type "p" must match
-            // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
-            // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
-            paragraph_();
-        }
-
-        // start table with tableRows
-        if ( attributes == null )
-        {
-            this.tableAttributes = new SinkEventAttributeSet( 0 );
-        }
-        else
-        {
-            this.tableAttributes = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_TABLE_ATTRIBUTES  );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#TABLE
-     */
-    @Override
-    public void table_()
-    {
-        this.tableRows = false;
-
-        writeEndTag( HtmlMarkup.TABLE );
-
-        if ( !this.cellCountStack.isEmpty() )
-        {
-            this.cellCountStack.removeLast().toString();
-        }
-
-        if ( this.tableContentWriterStack.isEmpty() )
-        {
-            LOGGER.warn( "No table content" );
-            return;
-        }
-
-        String tableContent = this.tableContentWriterStack.removeLast().toString();
-
-        String tableCaption = null;
-        if ( !this.tableCaptionStack.isEmpty() && this.tableCaptionStack.getLast() != null )
-        {
-            tableCaption = this.tableCaptionStack.removeLast();
-        }
-
-        if ( tableCaption != null )
-        {
-            // DOXIA-177
-            StringBuilder sb = new StringBuilder();
-            sb.append( tableContent, 0, tableContent.indexOf( Markup.GREATER_THAN ) + 1 );
-            sb.append( tableCaption );
-            sb.append( tableContent.substring( tableContent.indexOf( Markup.GREATER_THAN ) + 1 ) );
-
-            write( sb.toString() );
-        }
-        else
-        {
-            write( tableContent );
-        }
-    }
-
-    /**
-     * The default class style is <code>bodyTable</code>.
-     * The default align is <code>center</code>.
-     *
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#TABLE
-     */
-    @Override
-    public void tableRows( int[] justification, boolean grid )
-    {
-        this.tableRows = true;
-
-        setCellJustif( justification );
-
-        if ( this.tableAttributes == null )
-        {
-            this.tableAttributes = new SinkEventAttributeSet( 0 );
-        }
-
-        MutableAttributeSet att = new SinkEventAttributeSet();
-        if ( !this.tableAttributes.isDefined( Attribute.BORDER.toString() ) )
-        {
-            att.addAttribute( Attribute.BORDER, ( grid ? "1" : "0" ) );
-        }
-
-        if ( !this.tableAttributes.isDefined( Attribute.CLASS.toString() ) )
-        {
-            att.addAttribute( Attribute.CLASS, "bodyTable" );
-        }
-
-        att.addAttributes( this.tableAttributes );
-        this.tableAttributes.removeAttributes( this.tableAttributes );
-
-        writeStartTag( HtmlMarkup.TABLE, att );
-
-        this.cellCountStack.addLast( 0 );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void tableRows_()
-    {
-        this.tableRows = false;
-        if ( !this.cellJustifStack.isEmpty() )
-        {
-            this.cellJustifStack.removeLast();
-        }
-        if ( !this.isCellJustifStack.isEmpty() )
-        {
-            this.isCellJustifStack.removeLast();
-        }
-
-        this.evenTableRow = true;
-    }
-
-    /**
-     * The default class style is <code>a</code> or <code>b</code> depending the row id.
-     *
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#TR
-     */
-    @Override
-    public void tableRow()
-    {
-        // To be backward compatible
-        if ( !this.tableRows )
-        {
-            tableRows( null, false );
-        }
-        tableRow( null );
-    }
-
-    /**
-     * The default class style is <code>a</code> or <code>b</code> depending the row id.
-     *
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#TR
-     */
-    @Override
-    public void tableRow( SinkEventAttributes attributes )
-    {
-        MutableAttributeSet att = new SinkEventAttributeSet();
-
-        if ( evenTableRow )
-        {
-            att.addAttribute( Attribute.CLASS, "a" );
-        }
-        else
-        {
-            att.addAttribute( Attribute.CLASS, "b" );
-        }
-
-        att.addAttributes( SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_TR_ATTRIBUTES  ) );
-
-        writeStartTag( HtmlMarkup.TR, att );
-
-        evenTableRow = !evenTableRow;
-
-        if ( !this.cellCountStack.isEmpty() )
-        {
-            this.cellCountStack.removeLast();
-            this.cellCountStack.addLast( 0 );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#TR
-     */
-    @Override
-    public void tableRow_()
-    {
-        writeEndTag( HtmlMarkup.TR );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void tableCell()
-    {
-        tableCell( (SinkEventAttributeSet) null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void tableHeaderCell()
-    {
-        tableHeaderCell( (SinkEventAttributeSet) null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void tableCell( SinkEventAttributes attributes )
-    {
-        tableCell( false, attributes );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void tableHeaderCell( SinkEventAttributes attributes )
-    {
-        tableCell( true, attributes );
-    }
-
-    /**
-     * @param headerRow true if it is an header row
-     * @param attributes the cell attributes
-     * @see javax.swing.text.html.HTML.Tag#TH
-     * @see javax.swing.text.html.HTML.Tag#TD
-     */
-    private void tableCell( boolean headerRow, MutableAttributeSet attributes )
-    {
-        Tag t = ( headerRow ? HtmlMarkup.TH : HtmlMarkup.TD );
-
-        if ( !headerRow && cellCountStack != null && !cellCountStack.isEmpty()
-            && cellJustifStack != null && !cellJustifStack.isEmpty() && getCellJustif() != null )
-        {
-            int cellCount = getCellCount();
-            if ( cellCount < getCellJustif().length )
-            {
-                Map<Integer, MutableAttributeSet> hash = new HashMap<>();
-                hash.put( Sink.JUSTIFY_CENTER, SinkEventAttributeSet.CENTER );
-                hash.put( Sink.JUSTIFY_LEFT, SinkEventAttributeSet.LEFT );
-                hash.put( Sink.JUSTIFY_RIGHT, SinkEventAttributeSet.RIGHT );
-                MutableAttributeSet atts = hash.get( getCellJustif()[cellCount] );
-
-                if ( attributes == null )
-                {
-                    attributes = new SinkEventAttributeSet();
-                }
-                if ( atts != null )
-                {
-                    attributes.addAttributes( atts );
-                }
-            }
-        }
-
-        if ( attributes == null )
-        {
-            writeStartTag( t, null );
-        }
-        else
-        {
-            writeStartTag( t,
-                SinkUtils.filterAttributes( attributes, SinkUtils.SINK_TD_ATTRIBUTES ) );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void tableCell_()
-    {
-        tableCell_( false );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void tableHeaderCell_()
-    {
-        tableCell_( true );
-    }
-
-    /**
-     * Ends a table cell.
-     *
-     * @param headerRow true if it is an header row
-     * @see javax.swing.text.html.HTML.Tag#TH
-     * @see javax.swing.text.html.HTML.Tag#TD
-     */
-    private void tableCell_( boolean headerRow )
-    {
-        Tag t = ( headerRow ? HtmlMarkup.TH : HtmlMarkup.TD );
-
-        writeEndTag( t );
-
-        if ( !this.isCellJustifStack.isEmpty() && this.isCellJustifStack.getLast().equals( Boolean.TRUE )
-            && !this.cellCountStack.isEmpty() )
-        {
-            int cellCount = Integer.parseInt( this.cellCountStack.removeLast().toString() );
-            this.cellCountStack.addLast( ++cellCount );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#CAPTION
-     */
-    @Override
-    public void tableCaption()
-    {
-        tableCaption( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#CAPTION
-     */
-    @Override
-    public void tableCaption( SinkEventAttributes attributes )
-    {
-        StringWriter sw = new StringWriter();
-        this.tableCaptionWriterStack.addLast( sw );
-        this.tableCaptionXMLWriterStack.addLast( new PrettyPrintXMLWriter( sw ) );
-
-        // TODO: tableCaption should be written before tableRows (DOXIA-177)
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_SECTION_ATTRIBUTES  );
-
-        writeStartTag( HtmlMarkup.CAPTION, atts );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#CAPTION
-     */
-    @Override
-    public void tableCaption_()
-    {
-        writeEndTag( HtmlMarkup.CAPTION );
-
-        if ( !this.tableCaptionXMLWriterStack.isEmpty() && this.tableCaptionXMLWriterStack.getLast() != null )
-        {
-            this.tableCaptionStack.addLast( this.tableCaptionWriterStack.removeLast().toString() );
-            this.tableCaptionXMLWriterStack.removeLast();
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#A
-     */
-    @Override
-    public void anchor( String name )
-    {
-        anchor( name, null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#A
-     */
-    @Override
-    public void anchor( String name, SinkEventAttributes attributes )
-    {
-        Objects.requireNonNull( name, "name cannot be null" );
-
-        if ( headFlag )
-        {
-            return;
-        }
-
-        MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BASE_ATTRIBUTES  );
-
-        String id = name;
-
-        if ( !DoxiaUtils.isValidId( id ) )
-        {
-            id = DoxiaUtils.encodeId( name, true );
-
-            LOGGER.debug( "Modified invalid anchor name '{}' to '{}'", name, id );
-        }
-
-        MutableAttributeSet att = new SinkEventAttributeSet();
-        att.addAttribute( Attribute.NAME, id );
-        att.addAttributes( atts );
-
-        writeStartTag( HtmlMarkup.A, att );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#A
-     */
-    @Override
-    public void anchor_()
-    {
-        if ( !headFlag )
-        {
-            writeEndTag( HtmlMarkup.A );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void link( String name )
-    {
-        link( name, null );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void link( String name, SinkEventAttributes attributes )
-    {
-        if ( attributes == null )
-        {
-            link( name, null, null );
-        }
-        else
-        {
-            String target = (String) attributes.getAttribute( Attribute.TARGET.toString() );
-            MutableAttributeSet atts = SinkUtils.filterAttributes(
-                    attributes, SinkUtils.SINK_LINK_ATTRIBUTES  );
-
-            link( name, target, atts );
-        }
-    }
-
-    /**
-     * Adds a link with an optional target.
-     * The default style class for external link is <code>externalLink</code>.
-     *
-     * @param href the link href.
-     * @param target the link target, may be null.
-     * @param attributes an AttributeSet, may be null.
-     *      This is supposed to be filtered already.
-     * @see javax.swing.text.html.HTML.Tag#A
-     */
-    private void link( String href, String target, MutableAttributeSet attributes )
-    {
-        Objects.requireNonNull( href, "href cannot be null" );
-
-        if ( headFlag )
-        {
-            return;
-        }
-
-        MutableAttributeSet att = new SinkEventAttributeSet();
-
-        if ( DoxiaUtils.isExternalLink( href  ) )
-        {
-            att.addAttribute( Attribute.CLASS, "externalLink" );
-        }
-
-        att.addAttribute( Attribute.HREF, HtmlTools.escapeHTML( href  ) );
-
-        if ( target != null )
-        {
-            att.addAttribute( Attribute.TARGET, target );
-        }
-
-        if ( attributes != null )
-        {
-            attributes.removeAttribute( Attribute.HREF.toString() );
-            attributes.removeAttribute( Attribute.TARGET.toString() );
-            att.addAttributes( attributes );
-        }
-
-        writeStartTag( HtmlMarkup.A, att );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#A
-     */
-    @Override
-    public void link_()
-    {
-        if ( !headFlag )
-        {
-            writeEndTag( HtmlMarkup.A );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void inline()
-    {
-        inline( null );
-    }
-
-    private void inlineSemantics( SinkEventAttributes attributes, String semantic,
-            List<Tag> tags, Tag tag )
-    {
-        if ( attributes.containsAttribute( SinkEventAttributes.SEMANTICS, semantic ) )
-        {
-            SinkEventAttributes attributesNoSemantics = ( SinkEventAttributes ) attributes.copyAttributes();
-            attributesNoSemantics.removeAttribute( SinkEventAttributes.SEMANTICS );
-            writeStartTag( tag, attributesNoSemantics );
-            tags.add( 0, tag );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void inline( SinkEventAttributes attributes )
-    {
-        if ( !headFlag )
-        {
-            List<Tag> tags = new ArrayList<>();
-
-            if ( attributes != null )
-            {
-                inlineSemantics( attributes, "emphasis", tags, HtmlMarkup.EM );
-                inlineSemantics( attributes, "strong", tags, HtmlMarkup.STRONG );
-                inlineSemantics( attributes, "small", tags, HtmlMarkup.SMALL );
-                inlineSemantics( attributes, "line-through", tags, HtmlMarkup.S );
-                inlineSemantics( attributes, "citation", tags, HtmlMarkup.CITE );
-                inlineSemantics( attributes, "quote", tags, HtmlMarkup.Q );
-                inlineSemantics( attributes, "definition", tags, HtmlMarkup.DFN );
-                inlineSemantics( attributes, "abbreviation", tags, HtmlMarkup.ABBR );
-                inlineSemantics( attributes, "italic", tags, HtmlMarkup.I );
-                inlineSemantics( attributes, "bold", tags, HtmlMarkup.B );
-                inlineSemantics( attributes, "monospaced", tags, HtmlMarkup.TT );
-                inlineSemantics( attributes, "code", tags, HtmlMarkup.CODE );
-                inlineSemantics( attributes, "variable", tags, HtmlMarkup.VAR );
-                inlineSemantics( attributes, "sample", tags, HtmlMarkup.SAMP );
-                inlineSemantics( attributes, "keyboard", tags, HtmlMarkup.KBD );
-                inlineSemantics( attributes, "superscript", tags, HtmlMarkup.SUP );
-                inlineSemantics( attributes, "subscript", tags, HtmlMarkup.SUB );
-                inlineSemantics( attributes, "annotation", tags, HtmlMarkup.U );
-                inlineSemantics( attributes, "bidirectionalOverride", tags, HtmlMarkup.BDO );
-                inlineSemantics( attributes, "phrase", tags, HtmlMarkup.SPAN );
-                inlineSemantics( attributes, "insert", tags, HtmlMarkup.INS );
-                inlineSemantics( attributes, "delete", tags, HtmlMarkup.DEL );
-            }
-
-            inlineStack.push( tags );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void inline_()
-    {
-        if ( !headFlag )
-        {
-            for ( Tag tag: inlineStack.pop() )
-            {
-                writeEndTag( tag );
-            }
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#I
-     */
-    @Override
-    public void italic()
-    {
-        inline( SinkEventAttributeSet.Semantics.ITALIC );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#I
-     */
-    @Override
-    public void italic_()
-    {
-        inline_();
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#B
-     */
-    @Override
-    public void bold()
-    {
-        inline( SinkEventAttributeSet.Semantics.BOLD );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#B
-     */
-    @Override
-    public void bold_()
-    {
-        inline_();
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#TT
-     */
-    @Override
-    public void monospaced()
-    {
-        inline( SinkEventAttributeSet.Semantics.MONOSPACED );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#TT
-     */
-    @Override
-    public void monospaced_()
-    {
-        inline_();
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#BR
-     */
-    @Override
-    public void lineBreak()
-    {
-        lineBreak( null );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @see javax.swing.text.html.HTML.Tag#BR
-     */
-    @Override
-    public void lineBreak( SinkEventAttributes attributes )
-    {
-        if ( headFlag || isVerbatimFlag() )
-        {
-            getTextBuffer().append( EOL );
-        }
-        else
-        {
-            MutableAttributeSet atts = SinkUtils.filterAttributes(
-                attributes, SinkUtils.SINK_BR_ATTRIBUTES  );
-
-            writeSimpleTag( HtmlMarkup.BR, atts );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void pageBreak()
-    {
-        comment( " PB " );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void nonBreakingSpace()
-    {
-        if ( headFlag )
-        {
-            getTextBuffer().append( ' ' );
-        }
-        else
-        {
-            write( "&#160;" );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void text( String text )
-    {
-        if ( headFlag )
-        {
-            getTextBuffer().append( text );
-        }
-        else if ( verbatimFlag )
-        {
-            verbatimContent( text );
-        }
-        else
-        {
-            content( text );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void text( String text, SinkEventAttributes attributes )
-    {
-        text( text );
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void rawText( String text )
-    {
-        if ( headFlag )
-        {
-            getTextBuffer().append( text );
-        }
-        else
-        {
-            write( text );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void comment( String comment )
-    {
-        if ( comment != null )
-        {
-            final String originalComment = comment;
-
-            // http://www.w3.org/TR/2000/REC-xml-20001006#sec-comments
-            while ( comment.contains( "--" ) )
-            {
-                comment = comment.replace( "--", "- -" );
-            }
-
-            if ( comment.endsWith( "-" ) )
-            {
-                comment += " ";
-            }
-
-            if ( !originalComment.equals( comment ) )
-            {
-                LOGGER.warn( "Modified invalid comment '{}' to '{}'", originalComment, comment );
-            }
-
-            final StringBuilder buffer = new StringBuilder( comment.length() + 7 );
-
-            buffer.append( LESS_THAN ).append( BANG ).append( MINUS ).append( MINUS );
-            buffer.append( comment );
-            buffer.append( MINUS ).append( MINUS ).append( GREATER_THAN );
-
-            write( buffer.toString() );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * Add an unknown event.
-     * This can be used to generate html tags for which no corresponding sink event exists.
-     *
-     * <p>
-     * If {@link org.apache.maven.doxia.util.HtmlTools#getHtmlTag(String) HtmlTools.getHtmlTag( name )}
-     * does not return null, the corresponding tag will be written.
-     * </p>
-     *
-     * <p>For example, the div block</p>
-     *
-     * <pre>
-     *  &lt;div class="detail" style="display:inline"&gt;text&lt;/div&gt;
-     * </pre>
-     *
-     * <p>can be generated via the following event sequence:</p>
-     *
-     * <pre>
-     *  SinkEventAttributeSet atts = new SinkEventAttributeSet();
-     *  atts.addAttribute( SinkEventAttributes.CLASS, "detail" );
-     *  atts.addAttribute( SinkEventAttributes.STYLE, "display:inline" );
-     *  sink.unknown( "div", new Object[]{new Integer( HtmlMarkup.TAG_TYPE_START )}, atts );
-     *  sink.text( "text" );
-     *  sink.unknown( "div", new Object[]{new Integer( HtmlMarkup.TAG_TYPE_END )}, null );
-     * </pre>
-     *
-     * @param name the name of the event. If this is not a valid xhtml tag name
-     *      as defined in {@link org.apache.maven.doxia.markup.HtmlMarkup} then the event is ignored.
-     * @param requiredParams If this is null or the first argument is not an Integer then the event is ignored.
-     *      The first argument should indicate the type of the unknown event, its integer value should be one of
-     *      {@link org.apache.maven.doxia.markup.HtmlMarkup#TAG_TYPE_START TAG_TYPE_START},
-     *      {@link org.apache.maven.doxia.markup.HtmlMarkup#TAG_TYPE_END TAG_TYPE_END},
-     *      {@link org.apache.maven.doxia.markup.HtmlMarkup#TAG_TYPE_SIMPLE TAG_TYPE_SIMPLE},
-     *      {@link org.apache.maven.doxia.markup.HtmlMarkup#ENTITY_TYPE ENTITY_TYPE}, or
-     *      {@link org.apache.maven.doxia.markup.HtmlMarkup#CDATA_TYPE CDATA_TYPE},
-     *      otherwise the event will be ignored.
-     * @param attributes a set of attributes for the event. May be null.
-     *      The attributes will always be written, no validity check is performed.
-     */
-    @Override
-    public void unknown( String name, Object[] requiredParams, SinkEventAttributes attributes )
-    {
-        if ( requiredParams == null || !( requiredParams[0] instanceof Integer ) )
-        {
-            LOGGER.warn( "No type information for unknown event '{}', ignoring!", name );
-
-            return;
-        }
-
-        int tagType = (Integer) requiredParams[0];
-
-        if ( tagType == ENTITY_TYPE )
-        {
-            rawText( name );
-
-            return;
-        }
-
-        if ( tagType == CDATA_TYPE )
-        {
-            rawText( EOL + "//<![CDATA[" + requiredParams[1] + "]]>" + EOL );
-
-            return;
-        }
-
-        Tag tag = HtmlTools.getHtmlTag( name );
-
-        if ( tag == null )
-        {
-            LOGGER.warn( "No HTML tag found for unknown event '{}', ignoring!", name );
-        }
-        else
-        {
-            if ( tagType == TAG_TYPE_SIMPLE )
-            {
-                writeSimpleTag( tag, escapeAttributeValues( attributes ) );
-            }
-            else if ( tagType == TAG_TYPE_START )
-            {
-                writeStartTag( tag, escapeAttributeValues( attributes ) );
-            }
-            else if ( tagType == TAG_TYPE_END )
-            {
-                writeEndTag( tag );
-            }
-            else
-            {
-                LOGGER.warn( "No type information for unknown event '{}', ignoring!", name );
-            }
-        }
-    }
-
-    private SinkEventAttributes escapeAttributeValues( SinkEventAttributes attributes )
-    {
-        SinkEventAttributeSet set = new SinkEventAttributeSet( attributes.getAttributeCount() );
-
-        Enumeration<?> names = attributes.getAttributeNames();
-
-        while ( names.hasMoreElements() )
-        {
-            Object name = names.nextElement();
-
-            set.addAttribute( name, escapeHTML( attributes.getAttribute( name ).toString() ) );
-        }
-
-        return set;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void flush()
-    {
-        writer.flush();
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void close()
-    {
-        writer.close();
-
-        init();
-    }
-
-    // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
-
-    /**
-     * Write HTML escaped text to output.
-     *
-     * @param text The text to write.
-     */
-    protected void content( String text )
-    {
-        // small hack due to DOXIA-314
-        String txt = escapeHTML( text );
-        txt = StringUtils.replace( txt, "&amp;#", "&#" );
-        write( txt );
-    }
-
-    /**
-     * Write HTML escaped text to output.
-     *
-     * @param text The text to write.
-     */
-    protected void verbatimContent( String text )
-    {
-        write( escapeHTML( text ) );
-    }
-
-    /**
-     * Forward to HtmlTools.escapeHTML( text ).
-     *
-     * @param text the String to escape, may be null
-     * @return the text escaped, "" if null String input
-     * @see org.apache.maven.doxia.util.HtmlTools#escapeHTML(String)
-     */
-    protected static String escapeHTML( String text )
-    {
-        return HtmlTools.escapeHTML( text, false );
-    }
-
-    /**
-     * Forward to HtmlTools.encodeURL( text ).
-     *
-     * @param text the String to encode, may be null.
-     * @return the text encoded, null if null String input.
-     * @see org.apache.maven.doxia.util.HtmlTools#encodeURL(String)
-     */
-    protected static String encodeURL( String text )
-    {
-        return HtmlTools.encodeURL( text );
-    }
-
-    /** {@inheritDoc} */
-    protected void write( String text )
-    {
-        if ( !this.tableCaptionXMLWriterStack.isEmpty() && this.tableCaptionXMLWriterStack.getLast() != null )
-        {
-            this.tableCaptionXMLWriterStack.getLast().writeMarkup( unifyEOLs( text ) );
-        }
-        else if ( !this.tableContentWriterStack.isEmpty() && this.tableContentWriterStack.getLast() != null )
-        {
-            this.tableContentWriterStack.getLast().write( unifyEOLs( text ) );
-        }
-        else
-        {
-            writer.write( unifyEOLs( text ) );
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void writeStartTag( Tag t, MutableAttributeSet att, boolean isSimpleTag )
-    {
-        if ( this.tableCaptionXMLWriterStack.isEmpty() )
-        {
-            super.writeStartTag ( t, att, isSimpleTag );
-        }
-        else
-        {
-            String tag = ( getNameSpace() != null ? getNameSpace() + ":" : "" ) + t.toString();
-            this.tableCaptionXMLWriterStack.getLast().startElement( tag );
-
-            if ( att != null )
-            {
-                Enumeration<?> names = att.getAttributeNames();
-                while ( names.hasMoreElements() )
-                {
-                    Object key = names.nextElement();
-                    Object value = att.getAttribute( key );
-
-                    this.tableCaptionXMLWriterStack.getLast().addAttribute( key.toString(), value.toString() );
-                }
-            }
-
-            if ( isSimpleTag )
-            {
-                this.tableCaptionXMLWriterStack.getLast().endElement();
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void writeEndTag( Tag t )
-    {
-        if ( this.tableCaptionXMLWriterStack.isEmpty() )
-        {
-            super.writeEndTag( t );
-        }
-        else
-        {
-            this.tableCaptionXMLWriterStack.getLast().endElement();
-        }
-    }
-}
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
deleted file mode 100644
index b25a28d8..00000000
--- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
+++ /dev/null
@@ -1,779 +0,0 @@
-package org.apache.maven.doxia.parser;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.Iterator;
-
-import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
-import org.apache.maven.doxia.sink.impl.SinkEventElement;
-import org.apache.maven.doxia.sink.impl.SinkEventTestingSink;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-/**
- * Test for XhtmlBaseParser.
- *
- * @author ltheussl
- * @since 1.1
- */
-public class XhtmlBaseParserTest
-    extends AbstractParserTest
-{
-    private XhtmlBaseParser parser;
-    private final SinkEventTestingSink sink = new SinkEventTestingSink();
-
-
-    @Override
-    protected Parser createParser()
-    {
-        parser = new XhtmlBaseParser();
-        return parser;
-    }
-
-    @Override
-    protected String outputExtension()
-    {
-        return "xhtml";
-    }
-
-    @BeforeEach
-    protected void setUp() throws Exception
-    {
-        parser = new XhtmlBaseParser();
-        sink.reset();
-    }
-
-    /** Test Doxia version. */
-    @Test
-    public void testDoxiaVersion()
-    {
-        assertNotNull( XhtmlBaseParser.doxiaVersion() );
-        assertNotEquals( "unknown", XhtmlBaseParser.doxiaVersion() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testHeadingEventsList()
-        throws Exception
-    {
-        String text = "<p><h1></h1><h2></h2><h3></h3><h4></h4><h5></h5><h1></h1></p>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "paragraph", it.next().getName() );
-        assertEquals( "section1", it.next().getName() );
-        assertEquals( "sectionTitle1", it.next().getName() );
-        assertEquals( "sectionTitle1_", it.next().getName() );
-        assertEquals( "section2", it.next().getName() );
-        assertEquals( "sectionTitle2", it.next().getName() );
-        assertEquals( "sectionTitle2_", it.next().getName() );
-        assertEquals( "section3", it.next().getName() );
-        assertEquals( "sectionTitle3", it.next().getName() );
-        assertEquals( "sectionTitle3_", it.next().getName() );
-        assertEquals( "section4", it.next().getName() );
-        assertEquals( "sectionTitle4", it.next().getName() );
-        assertEquals( "sectionTitle4_", it.next().getName() );
-        assertEquals( "section5", it.next().getName() );
-        assertEquals( "sectionTitle5", it.next().getName() );
-        assertEquals( "sectionTitle5_", it.next().getName() );
-        assertEquals( "section5_", it.next().getName() );
-        assertEquals( "section4_", it.next().getName() );
-        assertEquals( "section3_", it.next().getName() );
-        assertEquals( "section2_", it.next().getName() );
-        assertEquals( "section1_", it.next().getName() );
-        assertEquals( "section1", it.next().getName() );
-        assertEquals( "sectionTitle1", it.next().getName() );
-        assertEquals( "sectionTitle1_", it.next().getName() );
-        // this one is missing because we enclose everything in <p> which is not valid xhtml,
-        // needs to be tested in overriding parser, eg XhtmlParser, XdocParser.
-        //assertEquals( "section1_", it.next().getName() );
-        assertEquals( "paragraph_", it.next().getName() );
-        assertFalse( it.hasNext() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testNestedHeadingEventsList()
-        throws Exception
-    {
-        // DOXIA-241
-        String text = "<p><h1></h1><h5></h5><h2></h2></p>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "paragraph", it.next().getName() );
-        assertEquals( "section1", it.next().getName() );
-        assertEquals( "sectionTitle1", it.next().getName() );
-        assertEquals( "sectionTitle1_", it.next().getName() );
-
-        assertEquals( "section2", it.next().getName() );
-        assertEquals( "section3", it.next().getName() );
-        assertEquals( "section4", it.next().getName() );
-
-        assertEquals( "section5", it.next().getName() );
-        assertEquals( "sectionTitle5", it.next().getName() );
-        assertEquals( "sectionTitle5_", it.next().getName() );
-        assertEquals( "section5_", it.next().getName() );
-
-        assertEquals( "section4_", it.next().getName() );
-        assertEquals( "section3_", it.next().getName() );
-        assertEquals( "section2_", it.next().getName() );
-
-        assertEquals( "section2", it.next().getName() );
-        assertEquals( "sectionTitle2", it.next().getName() );
-        assertEquals( "sectionTitle2_", it.next().getName() );
-        // these two are missing because we enclose everything in <p> which is not valid xhtml,
-        // needs to be tested in overriding parser, eg XhtmlParser, XdocParser.
-        //assertEquals( "section2_", it.next().getName() );
-        //assertEquals( "section1_", it.next().getName() );
-        assertEquals( "paragraph_", it.next().getName() );
-        assertFalse( it.hasNext() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testFigureEventsList()
-        throws Exception
-    {
-        String text = "<img src=\"source\" title=\"caption\" />";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "figureGraphics", it.next().getName() );
-        assertFalse( it.hasNext() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testTableEventsList()
-        throws Exception
-    {
-        // TODO: table caption, see DOXIA-177
-
-        String text = "<table align=\"center\"><tr><th>Header</th></tr><tr><td>cell</td></tr></table>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "table", it.next().getName() );
-        assertEquals( "tableRows", it.next().getName() );
-        assertEquals( "tableRow", it.next().getName() );
-        assertEquals( "tableHeaderCell", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "tableHeaderCell_", it.next().getName() );
-        assertEquals( "tableRow_", it.next().getName() );
-        assertEquals( "tableRow", it.next().getName() );
-        assertEquals( "tableCell", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "tableCell_", it.next().getName() );
-        assertEquals( "tableRow_", it.next().getName() );
-        assertEquals( "tableRows_", it.next().getName() );
-        assertEquals( "table_", it.next().getName() );
-
-        assertFalse( it.hasNext() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testSignificantWhiteSpace()
-        throws Exception
-    {
-        // NOTE significant white space
-        String text = "<p><b>word</b> <i>word</i></p>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "paragraph", it.next().getName() );
-        assertEquals( "inline", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-
-        SinkEventElement el = it.next();
-        assertEquals( "text", el.getName() );
-        assertEquals( " ",  (String) el.getArgs()[0] );
-
-        assertEquals( "inline", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "paragraph_", it.next().getName() );
-        assertFalse( it.hasNext() );
-
-
-        // same test with EOL
-        String eol = System.getProperty( "line.separator" );
-        text = "<p><b>word</b>" + eol + "<i>word</i></p>";
-
-        sink.reset();
-        parser.parse( text, sink );
-        it = sink.getEventList().iterator();
-
-        assertEquals( "paragraph", it.next().getName() );
-        assertEquals( "inline", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-
-        el = it.next();
-        assertEquals( "text", el.getName() );
-        // according to section 2.11 of the XML spec, parsers must normalize line breaks to "\n"
-        assertEquals( "\n",  (String) el.getArgs()[0] );
-
-        assertEquals( "inline", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "paragraph_", it.next().getName() );
-        assertFalse( it.hasNext() );
-
-
-        // DOXIA-189: there should be no EOL after closing tag
-        text = "<p>There should be no space after the last <i>word</i>.</p>";
-
-        sink.reset();
-        parser.parse( text, sink );
-        it = sink.getEventList().iterator();
-
-        assertEquals( "paragraph", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "inline", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-
-        el = it.next();
-        assertEquals( "text", el.getName() );
-        assertEquals( ".",  (String) el.getArgs()[0] );
-
-        assertEquals( "paragraph_", it.next().getName() );
-        assertFalse( it.hasNext() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testPreFormattedText()
-        throws Exception
-    {
-        String text = "<pre><a href=\"what.html\">what</a></pre>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-        assertEquals( "verbatim", it.next().getName() );
-        assertEquals( "link", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "link_", it.next().getName() );
-        assertEquals( "verbatim_", it.next().getName() );
-        assertFalse( it.hasNext() );
-
-        text = "<pre><![CDATA[<a href=\"what.html\">what</a>]]></pre>";
-        sink.reset();
-        parser.parse( text, sink );
-
-        it = sink.getEventList().iterator();
-        assertEquals( "verbatim", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "verbatim_", it.next().getName() );
-        assertFalse( it.hasNext() );
-
-        text = "<pre><![CDATA[<pre>what</pre>]]></pre>";
-        sink.reset();
-        parser.parse( text, sink );
-
-        it = sink.getEventList().iterator();
-        assertEquals( "verbatim", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "verbatim_", it.next().getName() );
-        assertFalse( it.hasNext() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testPreEOL()
-        throws Exception
-    {
-        // test EOLs within <pre>: the sink MUST receive a text event for the EOL
-        String text = "<pre><a href=\"what.html\">what</a>" + XhtmlBaseParser.EOL
-                + "<a href=\"what.html\">what</a></pre>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "verbatim", it.next().getName() );
-        assertEquals( "link", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "link_", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "link", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "link_", it.next().getName() );
-        assertEquals( "verbatim_", it.next().getName() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testDoxia250()
-        throws Exception
-    {
-        StringBuilder sb = new StringBuilder();
-        sb.append( "<!DOCTYPE test [" ).append( XhtmlBaseParser.EOL );
-        sb.append( "<!ENTITY foo \"&#x159;\">" ).append( XhtmlBaseParser.EOL );
-        sb.append( "<!ENTITY foo1 \"&nbsp;\">" ).append( XhtmlBaseParser.EOL );
-        sb.append( "<!ENTITY foo2 \"&#x161;\">" ).append( XhtmlBaseParser.EOL );
-        sb.append( "<!ENTITY tritPos \"&#x1d7ed;\">" ).append( XhtmlBaseParser.EOL );
-        sb.append( "]>" ).append( XhtmlBaseParser.EOL );
-        sb.append( "<b>&foo;&foo1;&foo2;&tritPos;</b>" );
-
-        parser.setValidate( false );
-        parser.parse( sb.toString(), sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        SinkEventElement event = it.next();
-        assertEquals( "inline", event.getName() );
-
-        event = it.next();
-        assertEquals( "text", event.getName() );
-        assertEquals( "\u0159",  (String) event.getArgs()[0] );
-
-        event = it.next();
-        assertEquals( "text", event.getName() );
-        assertEquals( "\u00A0",  (String) event.getArgs()[0] );
-
-        event = it.next();
-        assertEquals( "text", event.getName() );
-        assertEquals( "\u0161",  (String) event.getArgs()[0] );
-
-        event = it.next();
-        assertEquals( "text", event.getName() );
-        assertEquals( "\uD835\uDFED",  (String) event.getArgs()[0] );
-
-        event = it.next();
-        assertEquals( "inline_", event.getName() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testEntities()
-        throws Exception
-    {
-        final String text = "<!DOCTYPE test [<!ENTITY flo \"&#x159;\"><!ENTITY tritPos \"&#x1d7ed;\"><!ENTITY fo \"&#65;\"><!ENTITY myCustom \"&fo;\">]>"
-                + "<body><h1>&amp;&flo;&#x159;&tritPos;&#x1d7ed;</h1><p>&amp;&flo;&#x159;&tritPos;&#x1d7ed;&myCustom;</p></body>";
-
-        parser.setValidate( false );
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "section1", it.next().getName() );
-        assertEquals( "sectionTitle1", it.next().getName() );
-
-        SinkEventElement textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "&", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u0159", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u0159", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\uD835\uDFED",  (String) textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\uD835\uDFED", textEvt.getArgs()[0] );
-
-        assertEquals( "sectionTitle1_", it.next().getName() );
-        assertEquals( "paragraph", it.next().getName() );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "&", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u0159", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u0159", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\uD835\uDFED",  (String) textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\uD835\uDFED", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "A", textEvt.getArgs()[0] );
-
-        assertEquals( "paragraph_", it.next().getName() );
-
-        assertFalse( it.hasNext() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testXhtmlEntities()
-        throws Exception
-    {
-        final String text = "<body><h1>&laquo;&reg;</h1><p>&ldquo;&rsquo;&Phi;&larr;</p></body>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "section1", it.next().getName() );
-        assertEquals( "sectionTitle1", it.next().getName() );
-
-        // Couple symbols from Latin-1:
-        // http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Latin-1_characters
-
-        SinkEventElement textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u00AB", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u00AE", textEvt.getArgs()[0] );
-
-        assertEquals( "sectionTitle1_", it.next().getName() );
-        assertEquals( "paragraph", it.next().getName() );
-
-        // Couple symbols from Special characters:
-        // http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u201C", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u2019", textEvt.getArgs()[0] );
-
-        // Couple symbols from Symbols:
-        // http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Symbols
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u03A6", textEvt.getArgs()[0] );
-
-        textEvt = it.next();
-        assertEquals( "text", textEvt.getName() );
-        assertEquals( "\u2190", textEvt.getArgs()[0] );
-
-        assertEquals( "paragraph_", it.next().getName() );
-
-        assertFalse( it.hasNext() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testLists()
-        throws Exception
-    {
-        String text = "<div><ul><li></li></ul><ol><li></li></ol><dl><dt></dt><dd></dd></dl></div>";
-        parser.parse( text, sink );
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "list", it.next().getName() );
-        assertEquals( "listItem", it.next().getName() );
-        assertEquals( "listItem_", it.next().getName() );
-        assertEquals( "list_", it.next().getName() );
-
-        assertEquals( "numberedList", it.next().getName() );
-        assertEquals( "numberedListItem", it.next().getName() );
-        assertEquals( "numberedListItem_", it.next().getName() );
-        assertEquals( "numberedList_", it.next().getName() );
-
-        assertEquals( "definitionList", it.next().getName() );
-        assertEquals( "definitionListItem", it.next().getName() );
-        assertEquals( "definedTerm", it.next().getName() );
-        assertEquals( "definedTerm_", it.next().getName() );
-        assertEquals( "definition", it.next().getName() );
-        assertEquals( "definition_", it.next().getName() );
-        assertEquals( "definitionListItem_", it.next().getName() );
-        assertEquals( "definitionList_", it.next().getName() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testSimpleTags()
-        throws Exception
-    {
-        String text = "<div><br/><hr/><img src=\"img.src\"/></div>";
-        parser.parse( text, sink );
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "lineBreak", it.next().getName() );
-        assertEquals( "horizontalRule", it.next().getName() );
-        assertEquals( "figureGraphics", it.next().getName() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testSemanticTags()
-        throws Exception
-    {
-        String text = "<s><i><b><code><samp><sup><sub><u>a text &amp; &#xc6;</u></sub></sup></samp></code></b></i></s>";
-        parser.parse( text, sink );
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        SinkEventElement event = it.next();
-        assertEquals( "inline", event.getName() );
-        assertEquals( "semantics=line-through",  event.getArgs()[0].toString().trim() );
-
-        event = it.next();
-        assertEquals( "inline", event.getName() );
-        assertEquals( "semantics=italic",  event.getArgs()[0].toString().trim() );
-
-        event = it.next();
-        assertEquals( "inline", event.getName() );
-        assertEquals( "semantics=bold",  event.getArgs()[0].toString().trim() );
-
-        event = it.next();
-        assertEquals( "inline", event.getName() );
-        assertEquals( "semantics=code",  event.getArgs()[0].toString().trim() );
-
-        event = it.next();
-        assertEquals( "inline", event.getName() );
-        assertEquals( "semantics=code",  event.getArgs()[0].toString().trim() );
-
-        event = it.next();
-        assertEquals( "inline", event.getName() );
-        assertEquals( "semantics=superscript",  event.getArgs()[0].toString().trim() );
-
-        event = it.next();
-        assertEquals( "inline", event.getName() );
-        assertEquals( "semantics=subscript",  event.getArgs()[0].toString().trim() );
-
-        event = it.next();
-        assertEquals( "inline", event.getName() );
-        assertEquals( "semantics=annotation",  event.getArgs()[0].toString().trim() );
-
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-        assertEquals( "text", it.next().getName() );
-
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-        assertEquals( "inline_", it.next().getName() );
-
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testSpecial()
-        throws Exception
-    {
-        String text = "<p><!-- a pagebreak: --><!-- PB -->&nbsp;&#160;<unknown /></p>";
-        parser.parse( text, sink );
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "paragraph", it.next().getName() );
-        assertEquals( "comment", it.next().getName() );
-        assertEquals( "pageBreak", it.next().getName() );
-        assertEquals( "nonBreakingSpace", it.next().getName() );
-        assertEquals( "nonBreakingSpace", it.next().getName() );
-        // unknown events are not reported by the base parser
-        assertEquals( "paragraph_", it.next().getName() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testTable()
-        throws Exception
-    {
-        String text = "<table><caption></caption><tr><th></th></tr><tr><td></td></tr></table>";
-        parser.parse( text, sink );
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "table", it.next().getName() );
-
-        // DOXIA-374
-        SinkEventElement el = it.next();
-        assertEquals( "tableRows", el.getName() );
-        assertFalse( (Boolean) el.getArgs()[1] );
-
-        assertEquals( "tableCaption", it.next().getName() );
-        assertEquals( "tableCaption_", it.next().getName() );
-        assertEquals( "tableRow", it.next().getName() );
-        assertEquals( "tableHeaderCell", it.next().getName() );
-        assertEquals( "tableHeaderCell_", it.next().getName() );
-        assertEquals( "tableRow_", it.next().getName() );
-        assertEquals( "tableRow", it.next().getName() );
-        assertEquals( "tableCell", it.next().getName() );
-        assertEquals( "tableCell_", it.next().getName() );
-        assertEquals( "tableRow_", it.next().getName() );
-        assertEquals( "tableRows_", it.next().getName() );
-        assertEquals( "table_", it.next().getName() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testFigure()
-        throws Exception
-    {
-        String text = "<div class=\"figure\"><p><img src=\"src.jpg\"/></p><p><i></i></p></div>";
-        parser.parse( text, sink );
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        assertEquals( "figure", it.next().getName() );
-        assertEquals( "figureGraphics", it.next().getName() );
-        assertEquals( "figureCaption", it.next().getName() );
-        assertEquals( "figureCaption_", it.next().getName() );
-        assertEquals( "figure_", it.next().getName() );
-    }
-
-    /** @throws Exception  */
-    @Test
-    public void testAnchorLink()
-        throws Exception
-    {
-        String text = "<div><a href=\"\"></a>" +
-                "<a href=\"valid\"></a>" +
-                "<a href=\"#1invalid\"></a>" +
-                "<a href=\"http://www.fo.com/index.html#1invalid\"></a>" +
-                "<a name=\"valid\"></a>" +
-                "<a name=\"1invalid\"></a>" +
-                "<a id=\"1invalid\"></a></div>";
-
-        parser.parse( text, sink );
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        SinkEventElement element = it.next();
-        assertEquals( "link", element.getName() );
-        assertEquals( "", element.getArgs()[0] );
-        assertEquals( "link_", it.next().getName() );
-
-        element = it.next();
-        assertEquals( "link", element.getName() );
-        assertEquals( "valid", element.getArgs()[0] );
-        assertEquals( "link_", it.next().getName() );
-
-        element = it.next();
-        assertEquals( "link", element.getName() );
-        assertEquals( "#a1invalid", element.getArgs()[0] );
-        assertEquals( "link_", it.next().getName() );
-
-        element = it.next();
-        assertEquals( "link", element.getName() );
-        assertEquals( "http://www.fo.com/index.html#1invalid", element.getArgs()[0] );
-        assertEquals( "link_", it.next().getName() );
-
-        element = it.next();
-        assertEquals( "anchor", element.getName() );
-        assertEquals( "valid", element.getArgs()[0] );
-        assertEquals( "anchor_", it.next().getName() );
-
-        element = it.next();
-        assertEquals( "anchor", element.getName() );
-        assertEquals( "a1invalid", element.getArgs()[0] );
-        assertEquals( "anchor_", it.next().getName() );
-
-        element = it.next();
-        assertEquals( "anchor", element.getName() );
-        assertEquals( "a1invalid", element.getArgs()[0] );
-        assertEquals( "anchor_", it.next().getName() );
-    }
-
-    /**
-     * Test entities in attributes.
-     *
-     * @throws java.lang.Exception if any.
-     */
-    @Test
-    public void testAttributeEntities()
-        throws Exception
-    {
-        String text = "<script type=\"text/javascript\" src=\"http://ex.com/ex.js?v=l&amp;l=e\"></script>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-
-        SinkEventElement event = it.next();
-
-        assertEquals( "unknown", event.getName() );
-        assertEquals( "script", event.getArgs()[0] );
-        SinkEventAttributeSet attribs = (SinkEventAttributeSet) event.getArgs()[2];
-        // ampersand should be un-escaped
-        assertEquals( "http://ex.com/ex.js?v=l&l=e", attribs.getAttribute( "src" ) );
-        assertEquals( "unknown", it.next().getName() );
-        assertFalse( it.hasNext() );
-
-        sink.reset();
-        text = "<img src=\"http://ex.com/ex.jpg?v=l&amp;l=e\" alt=\"image\"/>";
-        parser.parse( text, sink );
-
-        it = sink.getEventList().iterator();
-        event = it.next();
-        assertEquals( "figureGraphics", event.getName() );
-        attribs = (SinkEventAttributeSet) event.getArgs()[1];
-        // ampersand should be un-escaped
-        assertEquals( "http://ex.com/ex.jpg?v=l&l=e", attribs.getAttribute( "src" ) );
-    }
-
-    @Test
-    public void testUnbalancedDefinitionListItem() throws Exception
-    {
-        String text = "<body><dl><dt>key</dt><dd>value</dd></dl>" +
-                        "<dl><dd>value</dd></dl>" +
-                        "<dl><dt>key</dt></dl>" +
-                        "<dl></dl>" +
-                        "<dl><dd>value</dd><dt>key</dt></dl></body>";
-
-        parser.parse( text, sink );
-
-        Iterator<SinkEventElement> it = sink.getEventList().iterator();
-        assertSinkStartsWith( it, "definitionList", "definitionListItem", "definedTerm", "text", "definedTerm_",
-                          "definition", "text", "definition_", "definitionListItem_", "definitionList_" );
-        assertSinkStartsWith( it, "definitionList", "definitionListItem", "definition", "text", "definition_",
-                          "definitionListItem_", "definitionList_" );
-        assertSinkStartsWith( it, "definitionList", "definitionListItem", "definedTerm", "text", "definedTerm_",
-                          "definitionListItem_", "definitionList_" );
-        assertSinkStartsWith( it, "definitionList", "definitionList_" );
-        assertSinkEquals( it, "definitionList", "definitionListItem", "definition", "text", "definition_",
-                          "definitionListItem_", "definitionListItem", "definedTerm", "text", "definedTerm_",
-                          "definitionListItem_", "definitionList_" );
-    }
-}
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java
deleted file mode 100644
index bea64e93..00000000
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java
+++ /dev/null
@@ -1,1061 +0,0 @@
-package org.apache.maven.doxia.sink.impl;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.StringWriter;
-import java.io.Writer;
-
-import javax.swing.text.html.HTML.Attribute;
-
-import org.apache.maven.doxia.markup.Markup;
-import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.SinkEventAttributes;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-/**
- * Test for XhtmlBaseSink.
- *
- * @author ltheussl
- * @since 1.1
- */
-public class XhtmlBaseSinkTest
-{
-    protected static final String LS = Markup.EOL;
-    private final SinkEventAttributes attributes = SinkEventAttributeSet.BOLD;
-    private XhtmlBaseSink sink;
-    private Writer writer;
-
-    @BeforeEach
-    public void setUp()
-    {
-        writer =  new StringWriter();
-    }
-
-    @Test
-    public void testSpaceAfterClosingTag()
-    {
-        // DOXIA-189
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.paragraph();
-            sink.text( "There should be no space before the " );
-            sink.inline( SinkEventAttributeSet.Semantics.ITALIC );
-            sink.text( "period" );
-            sink.inline_();
-            sink.text( "." );
-            sink.paragraph_();
-        }
-        finally
-        {
-            if ( sink != null )
-            {
-                sink.close();
-            }
-        }
-
-        String actual = writer.toString();
-        String expected = "<p>There should be no space before the <i>period</i>.</p>";
-
-        assertEquals( expected, actual );
-    }
-
-    /**
-     */
-    @Test
-    public void testNestedTables()
-    {
-        // DOXIA-177
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.table();
-            sink.tableRows( new int[] { Sink.JUSTIFY_CENTER, Sink.JUSTIFY_LEFT }, false );
-            sink.tableRow();
-            sink.tableCell();
-            sink.text( "cell11" );
-            sink.tableCell_();
-            sink.tableCell();
-            sink.text( "cell12" );
-            sink.tableCell_();
-            sink.tableRow_();
-
-            sink.tableRow();
-            sink.tableCell();
-            sink.table( SinkEventAttributeSet.LEFT );
-            sink.tableRows( new int[] { Sink.JUSTIFY_LEFT, Sink.JUSTIFY_RIGHT }, false );
-            sink.tableRow();
-            sink.tableCell();
-            sink.text( "nestedTable1Cell11" );
-            sink.tableCell_();
-            sink.tableCell();
-            sink.text( "nestedTable1Cell12" );
-            sink.tableCell_();
-            sink.tableRow_();
-            sink.tableRow();
-            sink.tableCell();
-
-            sink.table( SinkEventAttributeSet.RIGHT );
-            sink.tableRows( new int[] { Sink.JUSTIFY_RIGHT, Sink.JUSTIFY_CENTER }, false );
-            sink.tableRow();
-            sink.tableCell();
-            sink.text( "nestedTable2Cell11" );
-            sink.tableCell_();
-            sink.tableCell();
-            sink.text( "nestedTable2Cell12" );
-            sink.tableCell_();
-            sink.tableRow_();
-            sink.tableRow();
-            sink.tableCell();
-            sink.text( "nestedTable2Cell21" );
-            sink.tableCell_();
-            sink.tableCell();
-            sink.text( "nestedTable2Cell22" );
-            sink.tableCell_();
-            sink.tableRow_();
-            sink.tableRows_();
-            sink.tableCaption();
-            sink.text( "caption3" );
-            sink.tableCaption_();
-            sink.table_();
-
-            sink.tableCell_();
-            sink.tableCell();
-            sink.text( "nestedTable1Cell22" );
-            sink.tableCell_();
-            sink.tableRow_();
-            sink.tableRows_();
-            sink.tableCaption();
-            sink.text( "caption2" );
-            sink.tableCaption_();
-            sink.table_();
-
-            sink.tableCell_();
-            sink.tableCell();
-            sink.text( "cell22" );
-            sink.tableCell_();
-            sink.tableRow_();
-            sink.tableRows_();
-            sink.tableCaption();
-            sink.text( "caption&1" );
-            sink.tableCaption_();
-            sink.table_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        String actual = writer.toString();
-        assertTrue(
-                actual.contains( "<table border=\"0\" class=\"bodyTable\">" + "<caption>caption&amp;1</caption>" ) );
-        assertTrue( actual.contains(
-                "<table border=\"0\" class=\"bodyTable\" align=\"left\">" + "<caption>caption2</caption>" ) );
-        assertTrue( actual.contains(
-                "<table border=\"0\" class=\"bodyTable\" align=\"right\">" + "<caption>caption3</caption>" ) );
-
-        assertTrue( actual.contains( "<td align=\"center\">cell11</td>" ) );
-        assertTrue( actual.contains( "<td align=\"right\">nestedTable2Cell11</td>" ) );
-        assertTrue( actual.contains( "<td align=\"right\">nestedTable1Cell22</td>" ) );
-        assertTrue( actual.contains( "<td align=\"left\">cell22</td>" ) );
-    }
-
-    /**
-     * Test of section method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testSection()
-    {
-        final int level = XhtmlBaseSink.SECTION_LEVEL_1;
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.section( level, attributes );
-            sink.sectionTitle( level, attributes );
-            sink.sectionTitle_( level );
-            sink.section_( level );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<div class=\"section\" style=\"bold\">" + LS + "<h1 style=\"bold\"></h1></div>",
-                writer.toString() );
-    }
-
-    /**
-     * Test of section method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testSectionAttributes()
-    {
-        final int level = XhtmlBaseSink.SECTION_LEVEL_1;
-        final SinkEventAttributeSet set = new SinkEventAttributeSet( "name", "section name", "class", "foo", "id",
-                "bar" );
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.section( level, set );
-            sink.sectionTitle( level, null );
-            sink.sectionTitle_( level );
-            sink.section_( level );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<div class=\"foo\" id=\"bar\">" + LS + "<h1></h1></div>", writer.toString() );
-    }
-
-    /**
-     * Test of section1 method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testSection1()
-    {
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.section1();
-            sink.sectionTitle1();
-            sink.sectionTitle1_();
-            sink.section1_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<div class=\"section\">" + LS + "<h1></h1></div>", writer.toString() );
-    }
-
-    /**
-     * Test of section2 method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testSection2()
-    {
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.section2();
-            sink.sectionTitle2();
-            sink.sectionTitle2_();
-            sink.section2_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<div class=\"section\">" + LS + "<h2></h2></div>", writer.toString() );
-    }
-
-    /**
-     * Test of section3 method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testSection3()
-    {
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.section3();
-            sink.sectionTitle3();
-            sink.sectionTitle3_();
-            sink.section3_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<div class=\"section\">" + LS + "<h3></h3></div>", writer.toString() );
-    }
-
-    /**
-     * Test of section4 method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testSection4()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.section4();
-            sink.sectionTitle4();
-            sink.sectionTitle4_();
-            sink.section4_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<div class=\"section\">" + LS + "<h4></h4></div>", writer.toString() );
-    }
-
-    /**
-     * Test of section5 method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testSection5()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.section5();
-            sink.sectionTitle5();
-            sink.sectionTitle5_();
-            sink.section5_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<div class=\"section\">" + LS + "<h5></h5></div>", writer.toString() );
-    }
-
-    /**
-     * Test of list method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testList()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.list();
-            sink.listItem();
-            sink.listItem_();
-            sink.list_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<ul>" + LS + "<li></li></ul>", writer.toString() );
-
-        writer =  new StringWriter();
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.list( attributes );
-            sink.listItem( attributes );
-            sink.listItem_();
-            sink.list_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<ul style=\"bold\">" + LS + "<li style=\"bold\"></li></ul>", writer.toString() );
-    }
-
-    /**
-     * Test of numberedList method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testNumberedList()
-    {
-        final int numbering = XhtmlBaseSink.NUMBERING_DECIMAL;
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.numberedList( numbering );
-            sink.numberedListItem();
-            sink.numberedListItem_();
-            sink.numberedList_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<ol style=\"list-style-type: decimal\">" + LS + "<li></li></ol>", writer.toString() );
-
-        writer =  new StringWriter();
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.numberedList( numbering, attributes );
-            sink.numberedListItem( attributes );
-            sink.numberedListItem_();
-            sink.numberedList_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<ol style=\"list-style-type: decimal\">" + LS + "<li style=\"bold\"></li></ol>",
-                writer.toString() );
-    }
-
-    /**
-     * Test of definitionList method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testDefinitionList()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.definitionList();
-            sink.definedTerm();
-            sink.definedTerm_();
-            sink.definition();
-            sink.definition_();
-            sink.definitionList_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<dl>" + LS + "<dt></dt>" + LS + "<dd></dd></dl>", writer.toString() );
-
-        writer =  new StringWriter();
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.definitionList( attributes );
-            sink.definedTerm( attributes );
-            sink.definedTerm_();
-            sink.definition( attributes );
-            sink.definition_();
-            sink.definitionList_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals(
-                "<dl style=\"bold\">" + LS + "<dt style=\"bold\"></dt>" + LS + "<dd style=\"bold\"></dd></dl>",
-                writer.toString() );
-    }
-
-    /**
-     * Test of figure method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testFigure()
-    {
-        final String src = "src.jpg";
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.figure( attributes );
-            sink.figureGraphics( src, attributes );
-            sink.figureCaption( attributes );
-            sink.figureCaption_();
-            sink.figure_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals(
-                "<div style=\"bold\" class=\"figure\">" + "" + LS + "<p align=\"center\"><img src=\"src.jpg\" style=\"bold\" alt=\"\" /></p>" + "" + LS + "<p align=\"center\" style=\"bold\"><i></i></p></div>",
-                writer.toString() );
-    }
-
-    /**
-     * Test of figureGraphics method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testFigureGraphics()
-    {
-        String src = "source.png";
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.figureGraphics( src, attributes );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<img src=\"source.png\" style=\"bold\" alt=\"\" />", writer.toString() );
-    }
-
-    /**
-     * Test of paragraph method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testParagraph()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.paragraph();
-            sink.paragraph_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<p></p>", writer.toString() );
-
-        writer =  new StringWriter();
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.paragraph( attributes );
-            sink.paragraph_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<p style=\"bold\"></p>", writer.toString() );
-    }
-
-    /**
-     * Test of verbatim method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testVerbatim()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.verbatim( SinkEventAttributeSet.BOXED );
-            sink.verbatim_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<div class=\"source\">" + LS + "<pre></pre></div>", writer.toString() );
-
-        checkVerbatimAttributes( attributes, "<div>" + LS + "<pre style=\"bold\"></pre></div>" );
-
-        final SinkEventAttributes att =
-            new SinkEventAttributeSet( SinkEventAttributes.ID, "id" );
-        checkVerbatimAttributes( att, "<div>" + LS + "<pre id=\"id\"></pre></div>" );
-
-        att.addAttribute( Attribute.CLASS, "class" );
-        checkVerbatimAttributes( att, "<div>" + LS + "<pre id=\"id\" class=\"class\"></pre></div>" );
-
-        att.addAttribute( SinkEventAttributes.DECORATION, "boxed" );
-        checkVerbatimAttributes( att, "<div class=\"source\">" + LS + "<pre id=\"id\" class=\"class\"></pre></div>" );
-
-        att.removeAttribute( Attribute.CLASS.toString() );
-        checkVerbatimAttributes( att, "<div class=\"source\">" + LS + "<pre id=\"id\"></pre></div>" );
-    }
-
-    private void checkVerbatimAttributes( final SinkEventAttributes att, final String expected )
-    {
-
-        writer =  new StringWriter();
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.verbatim( att );
-            sink.verbatim_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( expected, writer.toString() );
-    }
-
-    /**
-     * Test of horizontalRule method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testHorizontalRule()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.horizontalRule();
-            sink.horizontalRule( attributes );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<hr /><hr style=\"bold\" />", writer.toString() );
-    }
-
-    /**
-     * Test of table method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testTable()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.table( attributes );
-            sink.table_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "</table>", writer.toString() );
-    }
-
-    /**
-     * Test of tableRows method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testTableRows()
-    {
-        final int[] justification = null;
-        final boolean grid = false;
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.tableRows( justification, grid );
-            sink.tableRows_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<table border=\"0\" class=\"bodyTable\">", writer.toString() );
-    }
-
-    /**
-     * Test of tableRow method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testTableRow()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.tableRow( attributes );
-            sink.tableRow_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<tr class=\"a\" style=\"bold\"></tr>", writer.toString() );
-    }
-
-    /**
-     * Test of tableCell method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testTableCell()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.tableCell( attributes );
-            sink.tableCell_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<td style=\"bold\"></td>", writer.toString() );
-    }
-
-    /**
-     * Test of tableHeaderCell method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testTableHeaderCell()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.tableHeaderCell( attributes );
-            sink.tableHeaderCell_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<th style=\"bold\"></th>", writer.toString() );
-    }
-
-    /**
-     * Test of tableCaption method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testTableCaption()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.table();
-            sink.tableRows( null, false );
-            sink.tableCaption( attributes );
-            sink.text( "caption" );
-            sink.tableCaption_();
-            sink.tableRows_();
-            sink.table_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals(
-                "<table border=\"0\" class=\"bodyTable\">" + "<caption style=\"bold\">caption</caption></table>",
-                writer.toString() );
-    }
-
-    /**
-     * Test of anchor method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testAnchor()
-    {
-        String name = "anchor";
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.anchor( name, attributes );
-            sink.anchor_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<a name=\"anchor\" style=\"bold\"></a>", writer.toString() );
-    }
-
-    /**
-     * Test of link method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testLink()
-    {
-        final String name = "link.html";
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.link( name, attributes );
-            sink.link_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<a href=\"link.html\" style=\"bold\"></a>", writer.toString() );
-    }
-
-    /**
-     * Test of italic/bold/monospaced method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testItalic()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.inline( SinkEventAttributeSet.Semantics.ITALIC );
-            sink.inline_();
-            sink.inline( SinkEventAttributeSet.Semantics.BOLD );
-            sink.inline_();
-            sink.inline( SinkEventAttributeSet.Semantics.MONOSPACED );
-            sink.inline_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<i></i><b></b><tt></tt>", writer.toString() );
-    }
-
-    /**
-     * Test of lineBreak/pageBreak/nonBreakingSpace method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testLineBreak()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.lineBreak( attributes );
-            sink.pageBreak();
-            sink.nonBreakingSpace();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<br style=\"bold\" /><!-- PB -->&#160;", writer.toString() );
-    }
-
-    /**
-     * Test of text method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testText()
-    {
-        String text = "a text & \u00c6";
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.text( text );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "a text &amp; &#xc6;", writer.toString() );
-
-        writer =  new StringWriter();
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.text( text, attributes );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "a text &amp; &#xc6;", writer.toString() );
-    }
-
-    /**
-     * Test of rawText method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testRawText()
-    {
-        String text = "raw text";
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.rawText( text );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "raw text", writer.toString() );
-    }
-
-    /**
-     * Test of comment method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testComment()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.comment( "a comment" );
-            sink.comment( " a comment" );
-            sink.comment( "a comment " );
-            sink.comment( " a comment " );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "<!--a comment--><!-- a comment--><!--a comment --><!-- a comment -->",
-                writer.toString() );
-    }
-
-    /**
-     * Test of unknown method, of class XhtmlBaseSink.
-     */
-    @Test
-    public void testUnknown()
-    {
-        final String name = "unknown";
-        final Object[] requiredParams = null;
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.unknown( name, requiredParams, attributes );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "", writer.toString() );
-    }
-
-    /**
-     * Test entities in attribute values.
-     */
-    @Test
-    public void testAttributeEntities()
-    {
-        final Object[] startTag = new Object[] { XhtmlBaseSink.TAG_TYPE_START };
-        final Object[] endTag = new Object[] { XhtmlBaseSink.TAG_TYPE_END };
-        final String script = XhtmlBaseSink.SCRIPT.toString();
-        final SinkEventAttributes src = new SinkEventAttributeSet( SinkEventAttributes.SRC,
-                "http://ex.com/ex.js?v=l&l=e" );
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-
-            sink.unknown( script, startTag, src );
-            sink.unknown( script, endTag, null );
-
-            sink.figureGraphics( "http://ex.com/ex.jpg?v=l&l=e", src );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        String result = writer.toString();
-
-        assertTrue( result.contains( "ex.js?v=l&amp;l=e" ) );
-        assertTrue( result.contains( "ex.jpg?v=l&amp;l=e" ) );
-    }
-
-    /**
-     * Test of entity.
-     */
-    @Test
-    public void testEntity()
-    {
-        // DOXIA-314
-        String text = "a text '&#x1d7ed;'";
-
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.text( text );
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        assertEquals( "a text '&#x1d7ed;'", writer.toString() );
-    }
-
-    /**
-     * Test unicode chracters in tables. DOXIA-433.
-     */
-    @Test
-    public void testSpecialCharacters()
-    {
-        try
-        {
-            sink = new XhtmlBaseSink( writer );
-            sink.table( null );
-            sink.tableRows( null, true );
-            sink.tableRow( null );
-            sink.tableCell();
-            sink.text( "\u2713", null );
-            sink.tableCell_();
-            sink.tableRow_();
-            sink.tableRows_();
-            sink.table_();
-        }
-        finally
-        {
-            sink.close();
-        }
-
-        final String result = writer.toString();
-
-        assertTrue( result.contains( "&#x2713;" ) );
-    }
-}
diff --git a/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5ParserModule.java b/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5ParserModule.java
index 6bc58b2b..2ee5c2bb 100644
--- a/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5ParserModule.java
+++ b/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5ParserModule.java
@@ -28,7 +28,7 @@ import org.apache.maven.doxia.parser.module.AbstractParserModule;
  * <p>Xhtml5ParserModule class.</p>
  */
 @Singleton
-@Named( "xhtml5" )
+@Named( "xhtml" )
 public class Xhtml5ParserModule
     extends AbstractParserModule
 {
@@ -37,6 +37,6 @@ public class Xhtml5ParserModule
      */
     public Xhtml5ParserModule()
     {
-        super( "xhtml5" );
+        super( "xhtml" );
     }
 }
diff --git a/doxia-modules/pom.xml b/doxia-modules/pom.xml
index 574772f2..3352dc6c 100644
--- a/doxia-modules/pom.xml
+++ b/doxia-modules/pom.xml
@@ -37,7 +37,6 @@ under the License.
     <module>doxia-module-apt</module>
     <module>doxia-module-fml</module>
     <module>doxia-module-xdoc</module>
-    <module>doxia-module-xhtml</module>
     <module>doxia-module-xhtml5</module>
     <module>doxia-module-markdown</module>
   </modules>