Giter VIP home page Giter VIP logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
[deleted comment]

from gwtwiki.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I have a fix working, changes to AbstractWikiModel.java only.

In appendRawWikipediaLink(), remove the line:

rawTopicName = Encoder.encodeHtml(rawTopicName);

In appendInternalImageLink(), do the encoding (close to line 396):

                                altAttribute = captionTagNode.getBodyString();
-                               imageFormat.setAlt(altAttribute);
+                imageFormat.setAlt(Encoder.encodeHtml(altAttribute));

This breaks a couple of test cases, but I believe the test cases are wrong.
WPImageFilterTest.testImage06 and WPLinkFilterTest.testLink12 both seem to
double-escape amps in their expected results.

    public void testImage06() {
        assertEquals(
                "\n"
                        + "<p><a class=\"internal\"
href=\"http://www.bliki.info/wiki/Image:Henkell-Schl%C3%B6sschen.JPG\""
                        + " title=\"Henkell-Schlösschen "der Sektkellerei"
Henkell & Söhnlein KG\">"
                        + "<img
src=\"http://www.bliki.info/wiki/Henkell-Schl%C3%B6sschen.JPG\""
                        + " alt=\"Henkell-Schlösschen "der Sektkellerei"
Henkell & Söhnlein KG\""
                        + " title=\"Henkell-Schlösschen "der Sektkellerei"
Henkell & Söhnlein KG\""
                        + " class=\"location-none type-thumb\" />\n"
                        + "</a>\n"
                        + "<div class=\"thumbcaption\"><i>Henkell-Schlösschen</i>"
                        + " "der Sektkellerei" <a
href=\"http://www.bliki.info/wiki/Henkell_%26_S%C3%B6hnlein_KG\""
                        + " title=\"Henkell & Söhnlein KG\">"
                        + "Henkell & Söhnlein KG</a></div> Wiesbaden</p>",
                wikiModel

.render("[[Image:Henkell-Schlösschen.JPG|thumb|\'\'Henkell-Schlösschen\'\' 
\"der
Sektkellerei\" [[Henkell & Söhnlein KG]]]] Wiesbaden"));
    }

    public void testLink12() {
        assertEquals(
                "\n"
                        + "<p>kellereien wie "
                        + "<a
href=\"http://www.bliki.info/wiki/Henkell_%26_S%C3%B6hnlein\""
                        + " title=\"Henkell & Söhnlein\">Henkell</a>,"
                        + " <a href=\"http://www.bliki.info/wiki/S%C3%B6hnlein\""
                        + " title=\"Söhnlein\">Söhnlein</a></p>",
                wikiModel
                        .render("kellereien wie [[Henkell & Söhnlein|Henkell]],
[[Söhnlein]]"));
        Set<String> set = wikiModel.getLinks();
        assertTrue(set.contains("Söhnlein"));
        assertTrue(set.contains("Henkell & Söhnlein"));
    }

Original comment by [email protected] on 3 Nov 2009 at 3:02

from gwtwiki.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Changed in SVN:
http://code.google.com/p/gwtwiki/source/detail?r=525

Original comment by [email protected] on 3 Nov 2009 at 7:15

from gwtwiki.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024

Original comment by [email protected] on 5 Jan 2010 at 7:24

  • Changed state: Fixed

from gwtwiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.