maven-doxia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Theussl <ltheu...@apache.org>
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/org/apac...
Date Wed, 28 Nov 2007 13:11:49 GMT
Herve,

Thanks for fixing this! Just two questions:

Why do we need a separate method in AbstractXmlSink, can't we just 
remove the EOL from writeEndTag()?

And what's the reason for selecting only special tags to write no 
newline? Just because they are inline elements? This doesn't solve the 
issue of EOLs within <pre> tags, right?

Cheers,
-Lukas


hboutemy@apache.org wrote:
> 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/main/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/org/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=598802&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() );
>      }
> 
> Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
> URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java?rev=598803&r1=598802&r2=598803&view=diff
> ==============================================================================
> --- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
(original)
> +++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
Tue Nov 27 15:02:47 2007
> @@ -907,7 +907,7 @@
>      {
>          if ( !headFlag )
>          {
> -            writeEndTag( Tag.A );
> +            writeEndTagWithoutEOL( Tag.A );
>          }
>      }
>  
> @@ -990,7 +990,7 @@
>      {
>          if ( !headFlag )
>          {
> -            writeEndTag( Tag.A );
> +            writeEndTagWithoutEOL( Tag.A );
>          }
>      }
>  
> @@ -1014,7 +1014,7 @@
>      {
>          if ( !headFlag )
>          {
> -            writeEndTag( Tag.I );
> +            writeEndTagWithoutEOL( Tag.I );
>          }
>      }
>  
> @@ -1038,7 +1038,7 @@
>      {
>          if ( !headFlag )
>          {
> -            writeEndTag( Tag.B );
> +            writeEndTagWithoutEOL( Tag.B );
>          }
>      }
>  
> @@ -1062,7 +1062,7 @@
>      {
>          if ( !headFlag )
>          {
> -            writeEndTag( Tag.TT );
> +            writeEndTagWithoutEOL( Tag.TT );
>          }
>      }
>  
> 
> Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
> URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java?rev=598803&r1=598802&r2=598803&view=diff
> ==============================================================================
> --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
(original)
> +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
Tue Nov 27 15:02:47 2007
> @@ -1478,7 +1478,7 @@
>          {
>              if ( !xmlMode )
>              {
> -                writeEndTag( ANCHOR_TAG );
> +                writeEndTagWithoutEOL( ANCHOR_TAG );
>              }
>          }
>      }
> @@ -1521,12 +1521,12 @@
>      {
>          if ( externalLinkFlag )
>          {
> -            writeEndTag( ULINK_TAG );
> +            writeEndTagWithoutEOL( ULINK_TAG );
>              externalLinkFlag = false;
>          }
>          else
>          {
> -            writeEndTag( LINK_TAG );
> +            writeEndTagWithoutEOL( LINK_TAG );
>          }
>      }
>  
> 
> Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
> URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java?rev=598803&r1=598802&r2=598803&view=diff
> ==============================================================================
> --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
(original)
> +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
Tue Nov 27 15:02:47 2007
> @@ -780,7 +780,7 @@
>      /** {@inheritDoc} */
>      public void anchor_()
>      {
> -        writeEndTag( INLINE_TAG );
> +        writeEndTagWithoutEOL( INLINE_TAG );
>      }
>  
>      /** {@inheritDoc} */
> @@ -815,8 +815,8 @@
>      /** {@inheritDoc} */
>      public void link_()
>      {
> -        writeEndTag( INLINE_TAG );
> -        writeEndTag( BASIC_LINK_TAG );
> +        writeEndTagWithoutEOL( INLINE_TAG );
> +        writeEndTagWithoutEOL( BASIC_LINK_TAG );
>      }
>  
>      /** {@inheritDoc} */
> @@ -828,7 +828,7 @@
>      /** {@inheritDoc} */
>      public void italic_()
>      {
> -        writeEndTag( INLINE_TAG );
> +        writeEndTagWithoutEOL( INLINE_TAG );
>      }
>  
>      /** {@inheritDoc} */
> @@ -840,7 +840,7 @@
>      /** {@inheritDoc} */
>      public void bold_()
>      {
> -        writeEndTag( INLINE_TAG );
> +        writeEndTagWithoutEOL( INLINE_TAG );
>      }
>  
>      /** {@inheritDoc} */
> @@ -852,7 +852,7 @@
>      /** {@inheritDoc} */
>      public void monospaced_()
>      {
> -        writeEndTag( INLINE_TAG );
> +        writeEndTagWithoutEOL( INLINE_TAG );
>      }
>  
>      /** {@inheritDoc} */
> 
> Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java
> URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java?rev=598803&r1=598802&r2=598803&view=diff
> ==============================================================================
> --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java
(original)
> +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java
Tue Nov 27 15:02:47 2007
> @@ -142,7 +142,7 @@
>      protected String getTableBlock( String cell, String caption )
>      {
>          // TODO: something's wrong
> -        return "\\begin{ptable}\\begin{ptablerows}{c}\\begin{pcell}{c}cell\\end{pcell}\\\\\\end{ptablerows}\\ptablecaption{Table
caption}\\end{ptable}";
> +        return "\\begin{ptable}\\begin{ptablerows}{c}\\begin{pcell}{c}cell\\end{pcell}\\\\\\end{ptablerows}\\ptablecaption{"
+ caption + "}\\end{ptable}";
>      }
>  
>      /** {@inheritDoc} */
> 
> 
> 

Mime
View raw message