Comments (4)
[deleted comment]
from gwtwiki.
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.
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.
Original comment by [email protected]
on 5 Jan 2010 at 7:24
- Changed state: Fixed
from gwtwiki.
Related Issues (20)
- ConcurrentEditException while importing HTML page to my mediawiki HOT 1
- Does not recognize image tags with non-ascii characters HOT 2
- Problem when a language uses a mix of native and English tags HOT 2
- WikiXMLParser doesn't read bzip2 files directly HOT 2
- Jar File ?
- iframe incorrect translation HOT 2
- CmContinue Empty for XMLCategoryMembersParser HOT 2
- version 3.0.19 renderns invalid html for TOC HOT 2
- Login Broken
- Bold Wiki Text does not end properly HOT 3
- Problem in converting MediaWiki text to Plain text HOT 1
- It is impossible to create new page with Connector.edit() method HOT 1
- make hide Table of Contents (toc) convenient HOT 2
- Error on rendering Wiki to HTML of some pages HOT 4
- toc generate not valid anchor HOT 3
- Html to wiki for embedded unordered lists adds an additional list item HOT 1
- line breaks removed after stripping wikipedia markup language
- Nested Links Are Not Resolved Correctly
- Slashes in titles should be escaped (?)
- Scribunto (Luaj scripting for Wikipedia) support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gwtwiki.