jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brus...@apache.org
Subject svn commit: r1693822 - in /jspwiki/trunk: ./ jspwiki-war/src/main/styles/haddock/default/ jspwiki-war/src/main/webapp/templates/haddock/editors/ jspwiki-war/src/test/java/org/apache/wiki/htmltowiki/
Date Sun, 02 Aug 2015 19:44:06 GMT
Author: brushed
Date: Sun Aug  2 19:44:06 2015
New Revision: 1693822

URL: http://svn.apache.org/r1693822
Log:
Fixing HtmlStringToWikiTranslator Unit Test, no version bump. 

Added:
    jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/modals.less   (with props)
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp
Modified:
    jspwiki/trunk/ChangeLog
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java

Modified: jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/jspwiki/trunk/ChangeLog?rev=1693822&r1=1693821&r2=1693822&view=diff
==============================================================================
--- jspwiki/trunk/ChangeLog (original)
+++ jspwiki/trunk/ChangeLog Sun Aug  2 19:44:06 2015
@@ -1,5 +1,9 @@
 2015-08-02  Dirk Frederickx (brushed AT apache DOT org)
 
+       * Fixed the unit tests for HtmlStringToWikiTranslatorTest
+
+2015-08-02  Dirk Frederickx (brushed AT apache DOT org)
+
        * 2.10.2-svn-29
 
        Some more Haddock template "tweaks":

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/modals.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/modals.less?rev=1693822&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/modals.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/modals.less Sun Aug  2 19:44:06
2015
@@ -0,0 +1,107 @@
+/*
+    JSPWiki - a JSP-based WikiWiki clone.
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); fyou may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+/*
+Section: Modal
+
+    Simplified modal dialog, based on bootstrap styling
+
+DOM Structure:
+(start code)
+body[.show-modal]
+    div.modal[.active]
+        ... body ...
+        div.modal-footer
+            button.btn.btn-default Close
+            button.btn.btn-primary OK
+    div.backdrop
+(end)
+*/
+
+.modal {
+  position: fixed;
+  top: 50%; left: 50%;
+  width: 20em; margin: -5em -10em;
+
+  padding: @modal-inner-padding;
+  .lead; //get some bigger font
+
+  background-color: @modal-content-bg;
+  border: 1px solid @modal-content-border-color;
+  border-radius: @border-radius-large;
+  .box-shadow(0 5px 15px rgba(0,0,0,.5));
+  // Remove focus outline from opened modal
+  outline: none;
+
+  .transition(all .6s);
+  .opacity(0);
+  z-index: -1;
+  pointer-events:0;
+}
+
+
+// Modal background DOM element, inserted as last element of the DOM
+.backdrop {
+    position: fixed;top: 0;left: 0;right: 0;bottom: 0;
+    background-color: @modal-backdrop-bg;
+
+    .transition(all .6s);
+    .opacity(0);
+    z-index: -1;
+}
+
+.show-modal {
+
+    .backdrop {
+        .opacity(0.3);
+        z-index: (@zindex-modal-background - 10); //bring above main content, but below the
dialog
+    }
+
+    .modal.active {
+        .opacity(1);
+        z-index: @zindex-modal-background;
+	}
+}
+
+
+// Footer (for actions)
+.modal-footer {
+    margin-top: 15px;
+    text-align: center; // right align buttons
+
+    // Properly space out buttons
+    .btn + .btn {
+        margin-left: 5px;
+        margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin
like all other inputs
+    }
+}
+
+
+// Scale up the modal
+@media screen and (min-width: @screen-sm-min) {
+
+  .modal {
+    //width: 600px;
+    //top: 50%; left: 50%;
+	//margin: -300px;
+    //margin: 30px auto;
+  }
+
+}

Propchange: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/modals.less
------------------------------------------------------------------------------
    svn:executable = *

Added: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp?rev=1693822&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp (added)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp Sun Aug
 2 19:44:06 2015
@@ -0,0 +1,270 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+--%>
+<%@ page language="java" pageEncoding="UTF-8"%>
+<%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
+<%@ page import="java.util.Properties"%>
+<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.auth.*" %>
+<%@ page import="org.apache.wiki.auth.permissions.*" %>
+<%@ page import="org.apache.wiki.render.*" %>
+<%@ page import="org.apache.wiki.parser.JSPWikiMarkupParser" %>
+<%@ page import="org.apache.wiki.ui.*" %>
+
+<%@ page import="org.apache.wiki.util.TextUtil" %>
+
+<%@ page import="org.apache.wiki.filters.*" %>
+<%@ page import="org.apache.commons.lang.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<fmt:setLocale value="${prefs.Language}" />
+<fmt:setBundle basename="templates.default"/>
+<%--
+    This provides the WYSIWYG TinyMCE for JSPWiki.
+--%>
+<%
+    WikiContext context = WikiContext.findContext( pageContext );
+    WikiEngine engine = context.getEngine();
+
+    /* local download of TinyMCE */
+    TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT,
+           context.getURL( WikiContext.NONE, "scripts/tinymce/js/tinymce/tinymce.min.js"
) );
+
+    /*  Use TinyMCE from a CDN
+    TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT,
+           "//tinymce.cachefly.net/4.2/tinymce.min.js" );
+    */
+
+    context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.TRUE );
+    context.setVariable( WikiEngine.PROP_RUNFILTERS,  "false" );
+
+    WikiPage wikiPage = context.getPage();
+    String originalCCLOption = (String)wikiPage.getAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS
);
+    wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, "false" );
+
+    String usertext = EditorManager.getEditedText(pageContext);
+
+%>
+
+<wiki:CheckRequestContext context="edit">
+<wiki:NoSuchPage> <%-- this is a new page, check if we're cloning --%>
+<%
+  String clone = request.getParameter( "clone" );
+  if( clone != null )
+  {
+    WikiPage p = engine.getPage( clone );
+    if( p != null )
+    {
+        AuthorizationManager mgr = engine.getAuthorizationManager();
+        PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION );
+
+        try
+        {
+          if( mgr.checkPermission( context.getWikiSession(), pp ) )
+          {
+            usertext = engine.getPureText( p );
+          }
+        }
+        catch( Exception e ) {  /*log.error( "Accessing clone page "+clone, e );*/ }
+    }
+  }
+%>
+</wiki:NoSuchPage>
+<%
+  if( usertext == null )
+  {
+    usertext = engine.getPureText( context.getPage() );
+  }
+%>
+</wiki:CheckRequestContext>
+<%
+    if( usertext == null ) usertext = "";
+
+    RenderingManager renderingManager = new RenderingManager();
+
+    // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
+    Properties copyOfWikiProperties = new Properties();
+    copyOfWikiProperties.putAll( engine.getWikiProperties() );
+    copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName()
);
+    renderingManager.initialize( engine, copyOfWikiProperties );
+
+    String pageAsHtml;
+    try
+    {
+        //pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context,
usertext ) );
+        pageAsHtml = renderingManager.getHTML( context, usertext );
+    }
+        catch( Exception e )
+    {
+        pageAsHtml = "Error in converting wiki-markup to well-formed HTML \n" + e.toString();
+        //pageAsHtml = e.toString() + "\n" + usertext; //error
+    }
+
+   // Disable the WYSIWYG_EDITOR_MODE and reset the other properties immediately
+   // after the XHTML for TinyMCE has been rendered.
+   context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.FALSE );
+
+   context.setVariable( WikiEngine.PROP_RUNFILTERS,  null );
+   wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption );
+
+   String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR );
+
+   String protocol = "http://";
+   if( request.isSecure() )
+   {
+       protocol = "https://";
+   }
+
+%>
+<form method="post" accept-charset="<wiki:ContentEncoding/>"
+      action="<wiki:CheckRequestContext
+     context='edit'><wiki:EditLink format='url'/></wiki:CheckRequestContext><wiki:CheckRequestContext
+     context='comment'><wiki:CommentLink format='url'/></wiki:CheckRequestContext>"
+       class="editform"
+          id="editform"
+     enctype="application/x-www-form-urlencoded" >
+
+  <%-- Edit.jsp relies on these being found.  So be careful, if you make changes. --%>
+  <input type="hidden" name="page" value="<wiki:Variable var='pagename' />" />
+  <input type="hidden" name="action" value="save" />
+  <%=SpamFilter.insertInputFields( pageContext )%>
+  <input type="hidden" name="<%=SpamFilter.getHashFieldName(request)%>" value="${lastchange}"
/>
+  <%-- This following field is only for the SpamFilter to catch bots which are just randomly
filling all fields and submitting.
+       Normal user should never see this field, nor type anything in it. --%>
+  <input class="hidden" type="text" name="<%=SpamFilter.getBotFieldName()%>" id="<%=SpamFilter.getBotFieldName()%>"
value="" />
+
+
+  <div class="form-inline form-group">
+
+  <span class="cage">
+    <input class="btn btn-primary" type="submit" name="ok" accesskey="s"
+           value="<fmt:message key='editor.plain.save.submit'/>"
+           title="<fmt:message key='editor.plain.save.title'/>" />
+
+      <wiki:CheckRequestContext context="edit">
+      <input class="form-control" data-hover-parent="span" type="text" size="80" maxlength="80"
+             name="changenote" id="changenote"
+             placeholder="<fmt:message key='editor.plain.changenote'/>"
+             value="${changenote}" />
+      </wiki:CheckRequestContext>
+  </span>
+
+
+  <%--<div class="btn-group editor-tools">--%>
+
+    <c:set var="editors" value="<%= engine.getEditorManager().getEditorList() %>"
/>
+    <c:if test='${fn:length(editors)>1}'>
+`   <div class="btn-group config">
+      <%-- note: 'dropdown-toggle' is only here to style the last button properly! --%>
+      <button class="btn btn-default dropdown-toggle"><span class="icon-pencil"></span><span
class="caret"></span></button>
+      <ul class="dropdown-menu" data-hover-parent="div">
+        <c:forEach items="${editors}" var="edt">
+          <c:choose>
+            <c:when test="${edt != prefs.editor}">
+              <li>
+                <wiki:Link context="edit"><wiki:Param name="editor" value="${edt}"
/>${edt}</wiki:Link>
+              </li>
+            </c:when>
+            <c:otherwise>
+              <li class="dropdown-header">${edt}</li>
+            </c:otherwise>
+          </c:choose>
+      </c:forEach>
+      </ul>
+    </div>
+    </c:if>
+
+  <%--</div>--%>
+
+  <div class="form-group pull-right">
+
+  <%-- is PREVIEW functionality still needed - with livepreview ?
+  <input class="btn btn-primary" type="submit" name="preview" accesskey="v"
+         value="<fmt:message key='editor.plain.preview.submit'/>"
+         title="<fmt:message key='editor.plain.preview.title'/>" />
+  --%>
+  <input class="btn btn-danger" type="submit" name="cancel" accesskey="q"
+         value="<fmt:message key='editor.plain.cancel.submit'/>"
+         title="<fmt:message key='editor.plain.cancel.title'/>" />
+
+  </div>
+  <%--TODO: allow page rename as part of an edit session
+    <wiki:Permission permission="rename">
+    <div class="form-group form-inline">
+    <label for="renameto"><fmt:message key='editor.renameto'/></label>
+    <input type="text" name="renameto" value="<wiki:Variable var='pagename' />"
size="40" />
+    <input type="checkbox" name="references" checked="checked" />
+    <fmt:message key="info.updatereferrers"/>
+    </div>
+    </wiki:Permission>
+  --%>
+
+  </div>
+
+  <wiki:CheckRequestContext context="comment">
+    <div class="info">
+    <label><fmt:message key="editor.commentsignature"/></label>
+    <input class="form-control form-col-20" type="text" name="author" id="authorname"
+           placeholder="<fmt:message key='editor.plain.name'/>"
+           value="${author}" />
+    <label class="btn btn-default btn-sm" for="rememberme">
+      <input type="checkbox" name="remember" id="rememberme"
+             <%=TextUtil.isPositive((String)session.getAttribute("remember")) ? "checked='checked'"
: ""%> />
+      <fmt:message key="editor.plain.remember"/>
+    </label>
+    <input class="form-control form-col-20" type="text" name="link" id="link" size="24"
+           placeholder="<fmt:message key='editor.plain.email'/>"
+           value="${link}" />
+    </div>
+  </wiki:CheckRequestContext>
+
+  <textarea name="htmlPageText"><%=pageAsHtml%></textarea>
+
+</form>
+<script type="text/javascript">
+//<![CDATA[
+
+Wiki.add("[name=htmlPageText]", function( element){
+
+    element.value = element.value
+        .replace( /<a class="hashlink"[^>]+>#<\/a>/g, "" )
+        .replace( /<img class="outlink"[^>]+>/g, "" );     // <img class="outlink"
src="/..../images/out.png" alt=""
+
+    tinymce.init({
+      selector: "textarea[name=htmlPageText]",
+      //extended_valid_elements: "...]",
+      //invalid_elements: blockquote ...",
+      language: Wiki.prefs.get( "Language" ), //"${prefs.Language}",
+      height: Wiki.prefs.get( "EditorCookie" ),
+      //plugins from the standard 4.2.2. package
+      plugins: 'anchor charmap code fullscreen image insertdatetime link lists media paste
preview searchreplace table wordcount',
+
+      setup : function(editor) {
+
+        console.log("Editor: " + editor.id + " is now initialized.");
+        editor.on("ResizeEditor", (function(e){
+           //console.log(e, e.target, e.width, e.height);
+           //Wiki.prefs.set("EditorCookie", e.height);
+        }).debounce() );
+      }
+    });
+});
+
+//]]>
+</script>

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java?rev=1693822&r1=1693821&r2=1693822&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java
Sun Aug  2 19:44:06 2015
@@ -1,4 +1,4 @@
-/* 
+/*
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
@@ -14,7 +14,7 @@
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
-    under the License.  
+    under the License.
  */
 package org.apache.wiki.htmltowiki;
 
@@ -24,7 +24,7 @@ import junit.framework.TestSuite;
 
 /**
  * JUnit test cases for Converting Html to Wiki Markup.
- * 
+ *
  */
 public class HtmlStringToWikiTranslatorTest extends TestCase
 {
@@ -44,7 +44,7 @@ public class HtmlStringToWikiTranslatorT
     {
         html2wiki = new HtmlStringToWikiTranslator();
     }
-    
+
     public void testAnchor() throws Exception
     {
         assertEquals(
@@ -71,13 +71,13 @@ public class HtmlStringToWikiTranslatorT
 
        assertEquals( "[AugumentedWikiLinks|AugumentedWikiLinks|title='my \"custom\" title'
target='_blank']", html2wiki
                      .translate( "<a class=\"wikipage\" href=\"Wiki.jsp?page=AugumentedWikiLinks\"
target=\"_blank\" title=\"my 'custom' title\">AugumentedWikiLinks</a>" ) );
-       
+
        // footnote links
        assertEquals( "[23]", html2wiki.translate( "<a class=\"footnoteref\" href=\"#ref-PageName-23\">[23]</a>"
) );
        assertEquals( "[something|23]", html2wiki.translate( "<a class=\"footnoteref\"
href=\"#ref-PageName-23\">[something]</a>" ) );
-       
+
     }
-    
+
     public void testTable() throws Exception
     {
         assertEquals( "a\n| erste\n", html2wiki
@@ -115,23 +115,23 @@ public class HtmlStringToWikiTranslatorT
                     html2wiki
                             .translate( "<table class=\"wikitable\" border=\"1\"><tbody><tr><td>
Name: <a class=\"wikipage\" href=\"Wiki.jsp?page=ChristianS\">Christian</a> <br>
Geschicklichkeit: 2 <br> Hang zu perversen Sexorgien. Jongliert mit Worten und K\u00f6pfen.
<br> <a class=\"wikipage\" href=\"Wiki.jsp?page=Berian\">Berian Nachtschleicher</a>
<br> <a class=\"wikipage\" href=\"Wiki.jsp?page=XLerul\">XLerul</a> <br>
<a class=\"wikipage\" href=\"Wiki.jsp?page=EffifotErif\">Effifot Erif</a></td></tr>
</tbody></table>" ) );
 
-        
+
     }
 
     public void testRulers() throws Exception
     {
-        assertEquals( "a\n----\nb", html2wiki.translate( "a<hr/>b" ) );        
+        assertEquals( "a\n----\nb", html2wiki.translate( "a<hr/>b" ) );
         assertEquals( "by\n" + "----\n" + "Dies", html2wiki.translate( "by\n" + "<hr>\n"
+ "Dies" ) );
 
     }
-    
+
     public void testParagraphs() throws Exception
     {
         assertEquals( "a\nb\nc", html2wiki.translate( "a<p>b</p>c" ) );
 
         assertEquals( "ab", html2wiki.translate( "a<p></p>b" ) );
 
-        assertEquals( "a\n\nb", html2wiki.translate( "a<p>\n</p>b" ) );     
  
+        assertEquals( "a\n\nb", html2wiki.translate( "a<p>\n</p>b" ) );
 
         assertEquals(
                      "\n\\\\\n__Willkommen__ \\\\\n\\\\\nUnd niemand wird sie sehen \\\\\nEine
Page ...\n\nAls Unterthema\n",
@@ -140,14 +140,14 @@ public class HtmlStringToWikiTranslatorT
 
         assertEquals( "\n\u00A0\n\nTop\n\nBottom\n\n\n", html2wiki.translate( "<p>&nbsp;</p><p>Top</p>\n<p></p>\n<p></p>\n<p>Bottom</p>
<p> </p>" ) );
     }
-    
+
     public void testWhitespace() throws Exception
     {
         assertEquals( "", html2wiki.translate( "" ) );
 
         assertEquals( "", html2wiki.translate( "   " ) );
 
-        assertEquals( "", html2wiki.translate( "<div>\n\n\n</div>" ) );     
  
+        assertEquals( "", html2wiki.translate( "<div>\n\n\n</div>" ) );
 
         assertEquals( "a ", html2wiki.translate( "a\n  \n\n \t\r\n" ) );
     }
@@ -181,10 +181,10 @@ public class HtmlStringToWikiTranslatorT
 
 
     }
-    
+
     public void testPre() throws Exception
     {
-        
+
         assertEquals( "\n{{{hallo}}}\n", html2wiki.translate( "<pre>hallo</pre>"
) );
 
         assertEquals( "\n{{{Hallo\nWelt!\n\n}}}\n", html2wiki.translate( "<pre>Hallo<br>Welt!<br><br></pre>"
) );
@@ -212,18 +212,18 @@ public class HtmlStringToWikiTranslatorT
     {
         assertEquals( "{{hallo}}", html2wiki.translate( "<tt>hallo</tt>" ) );
 
-        assertEquals( "{{hallo}}", html2wiki.translate( "<code>hallo</code>"
) );        
+        assertEquals( "{{hallo}}", html2wiki.translate( "<code>hallo</code>"
) );
     }
-    
+
     public void testCenter() throws Exception
     {
-        assertEquals( "\n%%( text-align: center; )\nHello \\\\\nWorld!\n%%\n", html2wiki
+        assertEquals( "\n%%( text-align: center; )\nHello \\\\\nWorld!\n/%\n", html2wiki
                       .translate( "<div style=\"text-align: center;\">Hello<br>World!</div>"
) );
 
-              assertEquals( "__%%( text-align: center; display: block; )Hello \\\\World!%%__",
html2wiki
+              assertEquals( "__%%( text-align: center; display: block; )Hello \\\\World!/%__",
html2wiki
                       .translate( "<span style=\"font-weight: bold; text-align: center;
display: block;\">Hello<br>World!</span>" ) );
 
-        
+
     }
 
     public void testImage() throws Exception
@@ -271,9 +271,9 @@ public class HtmlStringToWikiTranslatorT
                              .translate( "  <a href=\"http://edit.yahoo.com/config/send_webmesg?.target=YahooUser1234&amp;.src=pg\">\r\n"
                                          + "  <img src=\"http://opi.yahoo.com/online?u=YahooUser1234&amp;m=g&amp;t=2\">\r\n"
                                          + "  </a" ) );
-        
+
     }
-    
+
     public void testPlugin() throws Exception
     {
         assertEquals( "This is a private homepage done by\n" + "----\n"
@@ -285,20 +285,20 @@ public class HtmlStringToWikiTranslatorT
                             + "[{Text2gif width=\'150\' height=\'100\'\n" + "<br> <br>Sebastian
L. Baltes\n"
                             + "<br>Lange Str. 53\n" + "<br>44137 Dortmund\n"
+ "<br> <br>email: info@sorokan.de\n" + "<br>}]\n"
                             + "</p><p>" ) );
-        
+
     }
 
     public void testCSS() throws Exception
     {
-        assertEquals( "%%( color: rgb(255, 0, 0); )Und niemand wird sie sehen%%, die", html2wiki
+        assertEquals( "%%( color: rgb(255, 0, 0); )Und niemand wird sie sehen/%, die", html2wiki
                       .translate( "<span style=\"color: rgb(255, 0, 0);\">Und niemand
wird sie sehen</span>, die" ) );
 
-        assertEquals( "\n%%information\nCSS class here\n%%\n\nFont %%( color: #ff9900; font-family:
arial; font-size: large; )styling here.%% Some %%( background-color: #ffff00; )more here%%.\n",

+        assertEquals( "\n%%information\nCSS class here\n/%\n\nFont %%( color: #ff9900; font-family:
arial; font-size: large; )styling here./% Some %%( background-color: #ffff00; )more here/%.\n",
                       html2wiki.translate( "<div class=\"information\">CSS class here</div>\n"
                                   + "<p>Font <font face=\"Arial\" color=\"#ff9900\"
size=\"5\">styling here.</font>"
                                   + " Some <font style=\"background-color: #ffff00\">more
here</font>.</p>" ) );
-        
-        assertEquals( "\n\n%%( text-align: center; )\nsome leading text %%strike line through
this text%% some trailing text\n%%\n\n",
+
+        assertEquals( "\n\n%%( text-align: center; )\nsome leading text %%strike line through
this text/% some trailing text\n/%\n\n",
                       html2wiki.translate( "<p align=\"center\">some leading text <strike>line
through this text</strike> some trailing text</p>" ) );
     }
 
@@ -343,58 +343,58 @@ public class HtmlStringToWikiTranslatorT
                       .translate( "Wilma: <i>Ich             m\u00f6chte hier\nmal
in aller\nDeutlichkeit sagen! </i>" ) );
 
     }
-    
+
     public void testHeading() throws Exception
     {
         assertEquals( "\n!!! Heading 1 should be translated to large heading.\n",
                      html2wiki.translate( "<h1>Heading 1 should be translated to large
heading.</h1>" ) );
-        
+
         assertEquals( "\n!!! Heading 2 should be translated to large heading.\n",
                       html2wiki.translate( "<h2>Heading 2 should be translated to large
heading.</h2>" ) );
-        
+
         assertEquals( "\n!! Heading 3 should be translated to medium heading.\n",
                       html2wiki.translate( "<h3>Heading 3 should be translated to medium
heading.</h3>" ) );
-        
+
         assertEquals( "\n! Heading 4 should be translated to small heading.\n",
-                      html2wiki.translate( "<h4>Heading 4 should be translated to small
heading.</h4>" ) );        
+                      html2wiki.translate( "<h4>Heading 4 should be translated to small
heading.</h4>" ) );
     }
-    
+
     public void testForm() throws Exception
     {
         assertEquals( "\n[{FormOpen form='myForm'}]\n\n[{FormClose}]\n",
                       html2wiki.translate( "<div class=\"wikiform\">\n<form name=\"myForm\"><input
name=\"formname\" value=\"myForm\" type=\"hidden\">\n</div>" ) );
-        
+
         assertEquals( "[{FormInput type='hidden' name='myHiddenField' value='myHiddenField'}]myHiddenField",
                       html2wiki.translate( "<input name=\"nbf_myHiddenField\" value=\"myHiddenField\"
type=\"hidden\">myHiddenField" ) );
-        
+
         assertEquals( "[{FormInput type='checkbox' name='myCheckbox' value='myCheckbox' checked='checked'}]myCheckbox",
                       html2wiki.translate( "<input checked=\"checked\" value=\"myCheckbox\"
name=\"nbf_myCheckbox\" type=\"checkbox\">myCheckbox" ) );
-        
+
         assertEquals( "[{FormInput type='radio' name='myRadioButton' value='myRadioButton'}]myRadioButton",
                       html2wiki.translate( "<input name=\"nbf_myRadioButton\" value=\"myRadioButton\"
type=\"radio\">myRadioButton" ) );
-        
+
         assertEquals( "[{FormInput type='button' name='myButton' value='myButton'}]myButton",
                       html2wiki.translate( "<input name=\"nbf_myButton\" value=\"myButton\"
type=\"button\">myButton" ) );
 
         assertEquals( "[{FormTextarea name='myTextarea' rows='6' cols='50'}]myTextarea",
                       html2wiki.translate( "<textarea cols=\"50\" name=\"nbf_myTextarea\"
rows=\"6\"></textarea>myTextarea" ) );
-        
+
         assertEquals( "[{FormSelect name='mySelectionList' value='apple;*orange;pear'}]mySelectList",
                       html2wiki.translate( "<select name=\"nbf_mySelectionList\">\n"
                                            + "<option value=\"apple\">apple</option>\n"
                                            + "<option selected=\"selected\" value=\"orange\">orange</option>\n"
                                            + "<option value=\"pear\">pear</option>\n"
                                            + "</select>mySelectList" ) );
-        
+
     }
-    
+
     public void testDefinitionList() throws Exception
     {
         assertEquals( "\n;__Priority__:High\n\n;__TODO Name__:Initialization\n\n;__Requester__:John
Smith\n",
                       html2wiki.translate( "<dl><dt><b>Priority</b></dt><dd>High</dd></dl>\n"
                                            + "<dl><dt><b>TODO Name</b></dt><dd>Initialization</dd></dl>\n"
                                            + "<dl><dt><b>Requester</b></dt><dd>John
Smith</dd></dl>\n" ) );
-        
+
         assertEquals( "Some text here\n;:(A)indented comment here\n\n;:(B)another comment
here\n",
                       html2wiki.translate( "Some text here\n<dl><dt></dt><dd>(A)indented
comment here</dd></dl>\n"
                                            + "<dl><dt></dt><dd>(B)another
comment here</dd></dl>\n" ) );
@@ -402,10 +402,10 @@ public class HtmlStringToWikiTranslatorT
         assertEquals( "\n;__New Page Name__:[{FormInput type='text' name='newPageName'}]\n",
                       html2wiki.translate( "\n<dl><dt><b>New Page Name</b></dt><dd><input
name=\"nbf_newPageName\" type=\"text\"></dd></dl>\n" ) );
     }
-    
+
     public static Test suite()
     {
         return new TestSuite( HtmlStringToWikiTranslatorTest.class );
     }
-    
+
 }



Mime
View raw message