eaglebk / gwtwiki

Automatically exported from code.google.com/p/gwtwiki
0 stars 0 forks source link

Anchor rendered incorrectly #116

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

    WikiModel wikiModel = new WikiModel( 
        "http://www.test.com/${image}",  
        "http://www.test.com/${title}");

    String test = "[[abcd]]";
    String htmlStr = wikiModel.render(test);

    System.out.println(htmlStr);

Expected
<p><a href="http://www.test.com/abcd" title="abcd">abcd</a></p>
get
<p><a href="http://www.test.com/Abcd" title="abcd">abcd</a></p>

Note the href link location has been capitalized.
abcd => Abcd

Which according to http://meta.wikimedia.org/wiki/Help:Link is incorrect.

Original issue reported on code.google.com by starjar....@googlemail.com on 16 Oct 2012 at 8:26

GoogleCodeExporter commented 9 years ago
At Help:Link follow for example a link like "system message", and you will see 
that the first character is capitalized:
http://meta.wikimedia.org/wiki/Help:System_message

It's also described in the naming conventions:
http://en.wikipedia.org/wiki/Wikipedia:Naming_conventions_(technical_restriction
s)#Lower_case_first_letter

If you don't like this behaviour, you can override the 
AbstractWikiModel#appendInternalLink() method in your own IWikiModel and call 
encodeTitleToUrl() method with false as the second parameter.

Original comment by axelclk@gmail.com on 16 Oct 2012 at 8:48