jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r744665 - in /incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH: ChangeLog src/com/ecyrd/jspwiki/Release.java src/com/ecyrd/jspwiki/TextUtil.java tests/com/ecyrd/jspwiki/TextUtilTest.java
Date Sun, 15 Feb 2009 13:17:50 GMT
Author: metskem
Date: Sun Feb 15 13:17:50 2009
New Revision: 744665

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

Modified:
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/TextUtil.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/TextUtilTest.java

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog?rev=744665&r1=744664&r2=744665&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog Sun Feb 15 13:17:50 2009
@@ -1,3 +1,11 @@
+2008-02-15  Harry Metske <metskem@apache.org>
+
+        * 2.8.2-svn-13
+        
+        * JSPWIKI-503 - InsertPage plugin carries dashes from section
+         breaks into output, thanks to Jonathan Sobel
+         Also added an extra JUnit test for this.
+        
 2008-02-14  Harry Metske <metskem@apache.org>
 
         * 2.8.2-svn-12

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java?rev=744665&r1=744664&r2=744665&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java Sun Feb
15 13:17:50 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "12";
+    public static final String     BUILD         = "13";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/TextUtil.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/TextUtil.java?rev=744665&r1=744664&r2=744665&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/TextUtil.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/TextUtil.java Sun
Feb 15 13:17:50 2009
@@ -696,7 +696,7 @@
     /**
      *  Gets the given section (separated with "----") from the page text.
      *  Note that the first section is always #1.  If a page has no section markers,
-     *  them there is only a single section, #1.
+     *  then there is only a single section, #1.
      *
      *  @param pagedata WikiText to parse.
      *  @param section  Which section to get.
@@ -719,6 +719,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/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/TextUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/TextUtilTest.java?rev=744665&r1=744664&r2=744665&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/TextUtilTest.java
(original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/TextUtilTest.java
Sun Feb 15 13:17:50 2009
@@ -326,6 +326,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