maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r1137879 - in /maven/doxia/doxia/trunk: doxia-core/src/test/java/org/apache/maven/doxia/sink/ doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/ doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxi...
Date Tue, 21 Jun 2011 06:48:28 GMT
Author: ltheussl
Date: Tue Jun 21 06:48:28 2011
New Revision: 1137879

URL: http://svn.apache.org/viewvc?rev=1137879&view=rev
Log:
[DOXIA-433] Regression: Unicode characters not rendered in table cells

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java?rev=1137879&r1=1137878&r2=1137879&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
Tue Jun 21 06:48:28 2011
@@ -948,4 +948,32 @@ public class XhtmlBaseSinkTest
 
         assertEquals( "a text '𝟭'", writer.toString() );
     }
+
+    /**
+     * Test unicode chracters in tables. DOXIA-433.
+     */
+    public void testSpecialCharacters()
+    {
+        try
+        {
+            sink = new XhtmlBaseSink( writer );
+            sink.table( null );
+            sink.tableRows( null, true );
+            sink.tableRow( null );
+            sink.tableCell();
+            sink.text( "\u2713", null );
+            sink.tableCell_();
+            sink.tableRow_();
+            sink.tableRows_();
+            sink.table_();
+        }
+        finally
+        {
+            sink.close();
+        }
+
+        final String result = writer.toString();
+
+        assertTrue( result.indexOf( "✓" ) != -1 );
+    }
 }

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java?rev=1137879&r1=1137878&r2=1137879&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
Tue Jun 21 06:48:28 2011
@@ -2482,6 +2482,7 @@ public class AptParser
                         cellLine = replaceAll( cellLine, "\\u00A0>", "\\>" );
                         cellLine = replaceAll( cellLine, "\\u00A0{", "\\{" );
                         cellLine = replaceAll( cellLine, "\\u00A0}", "\\}" );
+                        cellLine = replaceAll( cellLine, "\\u00A0u", "\\u" );
                         cellLine = replaceAll( cellLine, "\\u00A0\\u00A0", "\\\\" );
                         cellLine = cellLine.trim();
 

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java?rev=1137879&r1=1137878&r2=1137879&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
Tue Jun 21 06:48:28 2011
@@ -569,12 +569,12 @@ public class AptParserTest
     public void testSpecialCharactersInTables()
         throws Exception
     {
-        // DOXIA-323
+        // DOXIA-323, DOXIA-433
         String text =
-                "  \\~ \\= \\- \\+ \\* \\[ \\] \\< \\> \\{ \\} \\\\" + EOL
+                "  \\~ \\= \\- \\+ \\* \\[ \\] \\< \\> \\{ \\} \\\\ \\u2713" + EOL
                 + EOL
                 + "*--------------------------------------------------+---------------+"
+ EOL
-                + "| \\~ \\= \\- \\+ \\* \\[ \\] \\< \\> \\{ \\} \\\\ | special chars
|" + EOL
+                + "| \\~ \\= \\- \\+ \\* \\[ \\] \\< \\> \\{ \\} \\\\ \\u2713 | special
chars |" + EOL
                 + "*--------------------------------------------------+---------------+";
 
         SinkEventTestingSink sink = new SinkEventTestingSink();
@@ -589,7 +589,7 @@ public class AptParserTest
         assertEquals( "paragraph", ( it.next() ).getName() );
         SinkEventElement event = it.next();
         assertEquals( "text", event.getName() );
-        assertEquals( "~ = - + * [ ] < > { } \\", event.getArgs()[0] );
+        assertEquals( "~ = - + * [ ] < > { } \\ \u2713", event.getArgs()[0] );
         assertEquals( "paragraph_", ( it.next() ).getName() );
 
         assertEquals( "table", ( it.next() ).getName() );
@@ -599,11 +599,18 @@ public class AptParserTest
 
         event = it.next();
         assertEquals( "text", event.getName() );
-        assertEquals( "~ = - + * [ ] < > { } \\", event.getArgs()[0] );
+        assertEquals( "~ = - + * [ ] < > { } \\ \u2713", event.getArgs()[0] );
         assertEquals( "tableCell_", ( it.next() ).getName() );
         assertEquals( "tableCell", ( it.next() ).getName() );
         assertEquals( "text", ( it.next() ).getName() );
         assertEquals( "tableCell_", ( it.next() ).getName() );
+        assertEquals( "tableRow_", ( it.next() ).getName() );
+
+        assertEquals( "tableRows_", ( it.next() ).getName() );
+        assertEquals( "table_", ( it.next() ).getName() );
+        assertEquals( "body_", ( it.next() ).getName() );
+
+        assertFalse( it.hasNext() );
     }
 
     /** @throws Exception  */



Mime
View raw message