Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-619

Sink.sectionTitle1() creates <h2> instead of <h1>

    XMLWordPrintableJSON

Details

    Description

      Problem

      The below code in a Maven Report plugin:

      Sink mainSink = getSink();
      mainSink.section1();
      mainSink.sectionTitle1();
      mainSink.text("Release Notes");
      mainSink.sectionTitle1_();
      

      produces this HTML:

      <h2 id="Release_Notes">Release Notes</h2>
      

      Expected HTML was <h1> instead of <h2>:

      <h1 id="Release_Notes">Release Notes</h1>
      

      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.

      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.

      Doc

      N/A

      Tests

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

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              bertrandmartin Bertrand Martin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: