maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r771709 - in /maven/doxia: doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/ doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/ doxia/trunk/doxia-core/src/test/java/org/apache/maven/...
Date Tue, 05 May 2009 13:16:37 GMT
Author: vsiveton
Date: Tue May  5 13:16:36 2009
New Revision: 771709

URL: http://svn.apache.org/viewvc?rev=771709&view=rev
Log:
DOXIA-314: Custom entities do not work in xdoc section titles

o added a small hack
o added test cases

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/EntitiesVerifier.java
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/EntitiesVerifier.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/EntitiesVerifier.java?rev=771709&r1=771708&r2=771709&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/EntitiesVerifier.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/EntitiesVerifier.java
Tue May  5 13:16:36 2009
@@ -139,8 +139,7 @@
 
         h3 = (HtmlHeader3) elementIterator.next();
         assertNotNull( h3 );
-        // DOXIA-314: FIXME!
-        //assertEquals( h3.asText().trim(), "Local Entities: '\u0391' '\u0392' '\u0393' '\uD7ED'"
);
+        assertEquals( h3.asText().trim(), "Local Entities: '\u0391' '\u0392' '\u0393' '\uD7ED'"
);
 
         a = (HtmlAnchor) elementIterator.next();
 

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=771709&r1=771708&r2=771709&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 13:16:36 2009
@@ -1866,7 +1866,10 @@
      */
     protected void content( String text )
     {
-        write( escapeHTML( text ) );
+        // small hack due to DOXIA-314
+        text = escapeHTML( text );
+        text = StringUtils.replace( text, "&#", "&#" );
+        write( text );
     }
 
     /**

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=771709&r1=771708&r2=771709&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 May  5 13:16:36 2009
@@ -831,4 +831,25 @@
 
         assertEquals( "", writer.toString() );
     }
+
+    /**
+     * Test of entity.
+     */
+    public void testEntity()
+    {
+        // DOXIA-314
+        String text = "a text '𝟭'";
+
+        try
+        {
+            sink = new XhtmlBaseSink( writer );
+            sink.text( text );
+        }
+        finally
+        {
+            sink.close();
+        }
+
+        assertEquals( "a text '𝟭'", writer.toString() );
+    }
 }



Mime
View raw message