jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r744667 - in /incubator/jspwiki/trunk: ChangeLog src/java/org/apache/wiki/Release.java src/java/org/apache/wiki/util/TextUtil.java tests/java/org/apache/wiki/TextUtilTest.java
Date Sun, 15 Feb 2009 13:28:04 GMT
Author: metskem
Date: Sun Feb 15 13:28:04 2009
New Revision: 744667

URL: http://svn.apache.org/viewvc?rev=744667&view=rev
Log:
3.0.0-svn-70 JSPWIKI-503 - InsertPage plugin carries dashes from section

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TextUtil.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/TextUtilTest.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=744667&r1=744666&r2=744667&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Sun Feb 15 13:28:04 2009
@@ -1,3 +1,11 @@
+2008-02-15  Harry Metske <metskem@apache.org>
+
+        * 3.0.0-svn-70
+        
+        * JSPWIKI-503 - InsertPage plugin carries dashes from section
+         breaks into output, thanks to Jonathan Sobel
+         Also added an extra JUnit test for this.
+        
 2009-02-14  Janne Jalkanen <jalkanen@apache.org>
 
         * 3.0.0-svn-69

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=744667&r1=744666&r2=744667&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Sun Feb 15 13:28:04 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "69";
+    public static final String     BUILD         = "70";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TextUtil.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TextUtil.java?rev=744667&r1=744666&r2=744667&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TextUtil.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/util/TextUtil.java Sun Feb 15 13:28:04
2009
@@ -722,6 +722,11 @@
             }
 
             start += 4; // Skip this "----"
+            // allow additional dashes, treat it as if it was a correct 4-dash
+            while (start < pagedata.length() && pagedata.charAt(start) == '-')
+            {
+                start++;
+            }
 
             previous = start;
         }

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/TextUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/TextUtilTest.java?rev=744667&r1=744666&r2=744667&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/TextUtilTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/TextUtilTest.java Sun Feb 15 13:28:04
2009
@@ -349,6 +349,13 @@
         catch( IllegalArgumentException e ) {}
     }
 
+    public void testGetSectionWithMoreThanFourDashes() throws Exception
+    {
+        String src = "----------------\nSecond section\n----";
+
+        assertEquals("section 2", "\nSecond section\n", TextUtil.getSection(src, 2));
+    }
+    
     public void testBooleanParameter()
        throws Exception
     {



Mime
View raw message