maven-doxia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hervé BOUTEMY <herve.bout...@free.fr>
Subject Re: svn commit: r598803 - in /maven/doxia/doxia/trunk: doxia-core/src/main/java/org/apache/maven/doxia/sink/ doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/ doxia-modules/doxia-module-fo/src/main/java/or
Date Wed, 28 Nov 2007 22:42:26 GMT
Le mercredi 28 novembre 2007, Dennis Lundberg a écrit :
> Vincent Siveton wrote:
> > Hi Hervé,
> >
> > 2007/11/27, hboutemy@apache.org <hboutemy@apache.org>:
> >> Author: hboutemy
> >> Date: Tue Nov 27 15:02:47 2007
> >> New Revision: 598803
> >>
> >> URL: http://svn.apache.org/viewvc?rev=598803&view=rev
> >> Log:
> >> [DOXIA-189] removed newline added after anchor, link, bold, italic and
> >> monospaced tags
> >>
> >> Modified:
> >>    
> >> maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/
> >>sink/AbstractXmlSink.java
> >> maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/
> >>sink/XhtmlBaseSink.java
> >> maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/ma
> >>in/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
> >> maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/
> >>apache/maven/doxia/module/fo/FoSink.java
> >> maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/o
> >>rg/apache/maven/doxia/module/latex/LatexSinkTest.java
> >>
> >> Modified:
> >> maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/
> >>sink/AbstractXmlSink.java URL:
> >> http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main
> >>/java/org/apache/maven/doxia/sink/AbstractXmlSink.java?rev=598803&r1=5988
> >>02&r2=598803&view=diff
> >> ========================================================================
> >>====== ---
> >> maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/
> >>sink/AbstractXmlSink.java (original) +++
> >> maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/
> >>sink/AbstractXmlSink.java Tue Nov 27 15:02:47 2007 @@ -166,9 +166,8 @@
> >>      }
> >>
> >>      /**
> >> -     * Ends a Tag. For instance:
> >> -     * <pre>
> >> -     * &lt;/tag&gt;
> >> +     * Ends a Tag followed by an EOL. For instance:
> >> +     * <pre>&lt;/tag&gt;
> >>       * </pre>
> >>       *
> >>       * @param t a tag
> >> @@ -188,6 +187,29 @@
> >>          sb.append( String.valueOf( GREATER_THAN ) );
> >>
> >>          sb.append( EOL );
> >> +
> >> +        write( sb.toString() );
> >> +    }
> >> +
> >> +    /**
> >> +     * Ends a Tag without an EOL. For instance:
> >> +     * <pre>&lt;/tag&gt;</pre>
> >> +     *
> >> +     * @param t a tag
> >> +     */
> >> +    protected void writeEndTagWithoutEOL( Tag t )
> >> +    {
> >> +        StringBuffer sb = new StringBuffer();
> >> +        sb.append( String.valueOf( LESS_THAN ) );
> >> +        sb.append( String.valueOf( SLASH ) );
> >> +
> >> +        if ( nameSpace != null )
> >> +        {
> >> +            sb.append( nameSpace ).append( ":" );
> >> +        }
> >> +
> >> +        sb.append( t.toString() );
> >> +        sb.append( String.valueOf( GREATER_THAN ) );
> >>
> >>          write( sb.toString() );
> >>      }
> >
> > Instead of copy/past and to improve the maintenance, it could be better
> > to have: protected void writeEndTag( Tag t ){ writeEndTag( t, true ); }
> > protected void writeEndTag( Tag t, boolean withoutEOL ){...}
> > WDYT?
> >
> > Cheers,
> >
> > Vincent
> >
> > [SNIP]
>
> Either that, or have one method call the other:
>
> protected void writeEndTag( Tag t )
> {
>      writeEndTagWithoutEOL( t );
>      write( EOL );
> }

true, I was lazy
I was really angry to discover that simply removing every EOL didn't work, or 
more precisely broke test-cases
I had several tries to find that only inline elements needed to be changed, 
and it wouldn't require too much changes...

I'll fix this tonight :)

Hervé

Mime
View raw message