maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r771654 - in /maven/doxia/doxia/trunk: doxia-core/src/main/java/org/apache/maven/doxia/sink/ doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/ doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/d...
Date Tue, 05 May 2009 10:20:36 GMT
Author: ltheussl
Date: Tue May  5 10:20:36 2009
New Revision: 771654

URL: http://svn.apache.org/viewvc?rev=771654&view=rev
Log:
[DOXIA-312] comments in meta properties end up in author content

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java

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=771654&r1=771653&r2=771654&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 May  5 10:20:36 2009
@@ -1786,7 +1786,7 @@
 
         buf.append( "" + SPACE + MINUS + MINUS + GREATER_THAN );
 
-        rawText( buf.toString() );
+        write( buf.toString() );
     }
 
     /**

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java?rev=771654&r1=771653&r2=771654&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
Tue May  5 10:20:36 2009
@@ -152,7 +152,9 @@
         throws Exception
     {
         String text = "<document>"
-                + "<properties><title>title</title><author email=\"a@b.c\">John
Doe</author></properties>"
+                + "<properties><title>title</title>"
+                + "<!-- Test comment: DOXIA-312 -->"
+                + "<author email=\"a@b.c\">John Doe</author></properties>"
                 + "<head><meta name=\"security\" content=\"low\"/></head><body></body></document>";
 
         SinkEventTestingSink sink = new SinkEventTestingSink();
@@ -165,6 +167,7 @@
         assertEquals( "title", ( (SinkEventElement) it.next() ).getName() );
         assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
         assertEquals( "title_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "comment", ( (SinkEventElement) it.next() ).getName() );
         assertEquals( "author", ( (SinkEventElement) it.next() ).getName() );
         assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
         assertEquals( "author_", ( (SinkEventElement) it.next() ).getName() );

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java?rev=771654&r1=771653&r2=771654&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
Tue May  5 10:20:36 2009
@@ -302,4 +302,33 @@
         assertEquals( "<div class=\"section\"><h2>&amp;</h2><p>&amp;</p></div>",
writer.toString() );
     }
 
+    /**
+     * Test head events.
+     */
+    public void testHead()
+    {
+        XhtmlSink sink = null;
+        Writer writer =  new StringWriter();
+
+        try
+        {
+            sink = new XhtmlSink( writer );
+            sink.head();
+            sink.title();
+            sink.text( "Title" );
+            sink.title_();
+            sink.comment( "A comment" );
+            sink.author();
+            sink.text( "Author" );
+            sink.author_();
+            sink.head_();
+        }
+        finally
+        {
+            sink.close();
+        }
+
+        String exp = "<head><title>Title</title><!-- A comment --><meta
name=\"author\" content=\"Author\" /></head>";
+        assertTrue( writer.toString().indexOf( exp ) != -1 );
+    }
 }



Mime
View raw message