Return-Path: X-Original-To: apmail-incubator-jspwiki-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-jspwiki-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 476EA725E for ; Sun, 18 Sep 2011 13:29:00 +0000 (UTC) Received: (qmail 92802 invoked by uid 500); 18 Sep 2011 13:29:00 -0000 Delivered-To: apmail-incubator-jspwiki-commits-archive@incubator.apache.org Received: (qmail 92783 invoked by uid 500); 18 Sep 2011 13:29:00 -0000 Mailing-List: contact jspwiki-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-commits@incubator.apache.org Received: (qmail 92775 invoked by uid 99); 18 Sep 2011 13:29:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Sep 2011 13:29:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Sep 2011 13:28:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B0F4E238897D; Sun, 18 Sep 2011 13:28:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1172281 - in /incubator/jspwiki/trunk: ChangeLog src/java/org/apache/wiki/Release.java src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java tests/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java Date: Sun, 18 Sep 2011 13:28:38 -0000 To: jspwiki-commits@incubator.apache.org From: metskem@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20110918132838.B0F4E238897D@eris.apache.org> Author: metskem Date: Sun Sep 18 13:28:38 2011 New Revision: 1172281 URL: http://svn.apache.org/viewvc?rev=1172281&view=rev Log: 2011-09-18 Harry Metske * 3.0.0-svn-233 * JSPWIKI-391: FCK editor ruins the anchors inside the page * JSPWIKI-493: FCK editor adds newlines before and after text formatted as "code" Modified: incubator/jspwiki/trunk/ChangeLog incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java incubator/jspwiki/trunk/tests/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java Modified: incubator/jspwiki/trunk/ChangeLog URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1172281&r1=1172280&r2=1172281&view=diff ============================================================================== --- incubator/jspwiki/trunk/ChangeLog (original) +++ incubator/jspwiki/trunk/ChangeLog Sun Sep 18 13:28:38 2011 @@ -1,5 +1,14 @@ 2011-09-18 Harry Metske + * 3.0.0-svn-233 + + * JSPWIKI-391: FCK editor ruins the anchors inside the page + + * JSPWIKI-493: FCK editor adds newlines before and after text + formatted as "code" + +2011-09-18 Harry Metske + * 3.0.0-svn-232 * fixed JSPWIKI-705 (Log a clear hint to a running security manager). 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=1172281&r1=1172280&r2=1172281&view=diff ============================================================================== --- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original) +++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Sun Sep 18 13:28:38 2011 @@ -77,7 +77,7 @@ public final class Release *

* If the build identifier is empty, it is not added. */ - public static final String BUILD = "232"; + public static final String BUILD = "233"; /** * This is the generic version string you should use Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java?rev=1172281&r1=1172280&r2=1172281&view=diff ============================================================================== --- incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java (original) +++ incubator/jspwiki/trunk/src/java/org/apache/wiki/htmltowiki/XHtmlElementToWikiTranslator.java Sun Sep 18 13:28:38 2011 @@ -387,9 +387,20 @@ public class XHtmlElementToWikiTranslato ref = trimLink( ref ); if( ref != null ) { - if( ref.startsWith( "#" ) ) + if( ref.startsWith( "#" ) ) // This is a link to a footnote. { - print( e ); + // convert "#ref-PageName-1" to just "1" + String href = ref.replaceFirst( "#ref-.+-(\\d+)", "$1" ); + + // remove the brackets around "[1]" + String textValue = e.getValue().substring( 1, (e.getValue().length() - 1) ); + + if( href.equals( textValue ) ){ // handles the simplest case. Example: [1] + print( e ); + } + else{ // handles the case where the link text is different from the href. Example: [something|1] + m_out.print( "[" + textValue + "|" + href + "]" ); + } } else { Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java?rev=1172281&r1=1172280&r2=1172281&view=diff ============================================================================== --- incubator/jspwiki/trunk/tests/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java (original) +++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslatorTest.java Sun Sep 18 13:28:38 2011 @@ -75,6 +75,11 @@ public class HtmlStringToWikiTranslatorT assertEquals( "[AugumentedWikiLinks|AugumentedWikiLinks|title='my \"custom\" title' target='_blank']", html2wiki .translate( "AugumentedWikiLinks" ) ); + + // footnote links + assertEquals( "[23]", html2wiki.translate( "[23]" ) ); + assertEquals( "[something|23]", html2wiki.translate( "[something]" ) ); + } public void testTable() throws Exception