Bertrand Martin created DOXIA-619:
-------------------------------------

             Summary: Sink.sectionTitle1() creates <h2> instead of <h1>
                 Key: DOXIA-619
                 URL: https://issues.apache.org/jira/browse/DOXIA-619
             Project: Maven Doxia
          Issue Type: Bug
          Components: Module - Xhtml, Sink API
            Reporter: Bertrand Martin


h1. Problem
The below code in a Maven Report plugin:
{code:java}
Sink mainSink = getSink();
mainSink.section1();
mainSink.sectionTitle1();
mainSink.text("Release Notes");
mainSink.sectionTitle1_();
{code}

produces this HTML:
{code:html}
<h2 id="Release_Notes">Release Notes</h2>
{code}

Expected HTML was {{<h1>}} instead of {{<h2>}}:
{code:html}
<h1 id="Release_Notes">Release Notes</h1>
{code}

As a consequence, documents produced using the *Sink* API in a Maven Report 
plugin do not have any {{<h1>}} headings and start directly with {{<h2>}}, 
which is not recommended for SEO, and most importantly [for 
accessibility|https://www.w3.org/WAI/tutorials/page-structure/headings/].

h1. Specification
Fix the mapping of section levels to HTML heading levels in _Xhtml5BaseSink_ 
and _XhtmlBaseSink_ (see {{protected void onSectionTitle( int depth, 
SinkEventAttributes attributes )}}).

Similarly (and this is riskier), update _baseStartTag()_ and _baseEndTag()_ 
methods in _Xhtml5BaseParser_ and _XhtmlBaseParser_ classes.

h1. Doc
N/A

h1. Tests
Add corresponding unit and integration tests. This should not break 
*maven-site-plugin*'s own integration tests.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to