On Oct 13, 2009, at 14:18 , Andrew Jaquith wrote:
A few more clarifying questions:
- Are page names normalized when stored? I.e., when persisted we
always use the MashedTogetherName?
No, we use the result of MarkupParser.cleanLink() [which turns [foo
bar] into [Foo bar]. It essentially just capitalizes it and removes
illegal characters.]
- When WikiPaths are resolved, do we resolve such that the WikiPath
returned always uses the MashedTogetherName?
Good question. 2.8 resolves them in
CommandResolver.getFinalPageName() but it appears that this code has
been accidentally left out in 3.0...
The correct response would be to write a
org.apache.wiki.content.resolver.OldStyleCamelCasePageNameResolver, I
think. That should make it work fairly transparently.
/Janne
(1) JSPWikiMarkupParser.testHyperlinks3():
newPage("HyperlinkToo");
String src = "This should be a [hyperlink too]";
assertEquals( "This should be a <a class=\"wikipage\"
href=\"/Wiki.jsp?page=HyperlinkToo\">hyperlink too</a>",
translate(src) );
Is correct. There only exists an old-style page name
("HyperlinkToo".) This is the pre-2.6 model.
(2) JSPWikiMarkupParser.testSpacesInLinks1()
newPage("Foo bar");
String src = "[Foo bar]";
assertEquals( "<a class=\"wikipage\"
href=\"/Wiki.jsp?page=Foo%20bar\">Foo bar</a>", translate(src) );
Correct too. There is a page called "Foo bar", so linking to it with
[Foo bar] should obviously work.
(3) MarkupParserTest.testCleanLinkWithSpaces()
assertEquals( "HyperlinkToo",
MarkupParser.cleanLink("hyperlink too") );
Mmm... Incorrect. It should actually return with "Hyperlink too".
MarkupParser.wikifyLink() should then return "HyperlinkToo".
/Janne