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/07/27 15:51:15 UTC

[maven-doxia] branch DOXIA-666 created (now d32ab08b)

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

michaelo pushed a change to branch DOXIA-666
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git


      at d32ab08b [DOXIA-666] Remove code duplication Xhtml5Sink

This branch includes the following new commits:

     new d32ab08b [DOXIA-666] Remove code duplication Xhtml5Sink

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-doxia] 01/01: [DOXIA-666] Remove code duplication Xhtml5Sink

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d32ab08b036c51206670a4db273bf2d4425c786a
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Jul 27 17:50:59 2022 +0200

    [DOXIA-666] Remove code duplication Xhtml5Sink
---
 .../maven/doxia/module/xhtml5/Xhtml5Sink.java      | 106 ---------------------
 1 file changed, 106 deletions(-)

diff --git a/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Sink.java b/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Sink.java
index 8c570bfe..86dec4c1 100644
--- a/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Sink.java
+++ b/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Sink.java
@@ -24,10 +24,7 @@ import java.io.Writer;
 import javax.swing.text.MutableAttributeSet;
 import javax.swing.text.html.HTML.Attribute;
 
-import org.apache.maven.doxia.markup.HtmlMarkup;
-import org.apache.maven.doxia.sink.SinkEventAttributes;
 import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
-import org.apache.maven.doxia.sink.impl.SinkUtils;
 import org.apache.maven.doxia.sink.impl.Xhtml5BaseSink;
 import org.apache.maven.doxia.util.HtmlTools;
 import org.codehaus.plexus.util.StringUtils;
@@ -243,109 +240,6 @@ public class Xhtml5Sink
         init();
     }
 
-    /**
-     * {@inheritDoc}
-     *
-     * Starts a section..
-     * @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.addAttributes( SinkUtils.filterAttributes(
-                    attributes, SinkUtils.SINK_BASE_ATTRIBUTES  ) );
-
-            writeStartTag( HtmlMarkup.SECTION, att );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * Ends a 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.SECTION );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * Starts a 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, 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 );
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * Ends a 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 );
-        }
-    }
-
     // ----------------------------------------------------------------------
     // Public protected methods
     // ----------------------------------------------------------------------