jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r761969 - in /incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH: src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java tests/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslatorTest.java
Date Sat, 04 Apr 2009 17:28:38 GMT
Author: jalkanen
Date: Sat Apr  4 17:28:38 2009
New Revision: 761969

URL: http://svn.apache.org/viewvc?rev=761969&view=rev
Log:
JSPWIKI-493: FCK editor adds newlines before and after text formatted as "code"

Modified:
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java
    incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslatorTest.java

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java?rev=761969&r1=761968&r2=761969&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java
(original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java
Sat Apr  4 17:28:38 2009
@@ -518,14 +518,14 @@
                 }
                 else if( n.equals( "pre" ) )
                 {
-                    m_out.print( "\n{{{\n" ); // start JSPWiki "code blocks" on its own line
+                    m_out.print( "\n{{{" ); // start JSPWiki "code blocks" on its own line
                     m_preStack.push();
                     print( e );
                     m_preStack.pop();
 
-                    // print a newline before the closing braces for aesthetics and a newline
after it
+                    // print a newline after the closing braces
                     // to avoid breaking any subsequent wiki markup that follows.
-                    m_out.print( "\n}}}\n" );
+                    m_out.print( "}}}\n" );
                 }
                 else if( n.equals( "code" ) || n.equals( "tt" ) )
                 {

Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslatorTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslatorTest.java?rev=761969&r1=761968&r2=761969&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslatorTest.java
(original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/tests/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslatorTest.java
Sat Apr  4 17:28:38 2009
@@ -163,14 +163,14 @@
     public void testPre() throws Exception
     {
         
-        assertEquals( "\n{{{\nhallo\n}}}\n", html2wiki.translate( "<pre>hallo</pre>"
) );
+        assertEquals( "\n{{{hallo}}}\n", html2wiki.translate( "<pre>hallo</pre>"
) );
 
-        assertEquals( "\n{{{\nHallo\nWelt!\n\n\n}}}\n", html2wiki.translate( "<pre>Hallo<br>Welt!<br><br></pre>"
) );
+        assertEquals( "\n{{{Hallo\nWelt!\n\n}}}\n", html2wiki.translate( "<pre>Hallo<br>Welt!<br><br></pre>"
) );
 
-        assertEquals( "\n{{{\n\n\n\n\nHallo\n\n\n\nWelt!\n\n\n\n\n}}}\n", html2wiki
+        assertEquals( "\n{{{\n\n\n\nHallo\n\n\n\nWelt!\n\n\n\n}}}\n", html2wiki
                 .translate( "\n\n\n\n<pre>\n\n\n\nHallo\n\n\n\nWelt!\n\n\n\n</pre>\n\n\n\n"
) );
 
-        assertEquals( "\n{{{\n\n\n* Baltramon \n  lasdjfh\n\n\n}}}\n", html2wiki.translate(
"<pre>\n\n* Baltramon \n  lasdjfh\n\n</pre>" ) );
+        assertEquals( "\n{{{\n\n* Baltramon \n  lasdjfh\n\n}}}\n", html2wiki.translate( "<pre>\n\n*
Baltramon \n  lasdjfh\n\n</pre>" ) );
 
         /*
         // The style "font-family: courier new" is no longer translated as monospace text,
so this test case is no longer needed.



Mime
View raw message