karlosjota / gwtwiki

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

rendering non-existing transclude should display a (red) link #114

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. render {{NonExistingTemplate}}

What is the expected output? What do you see instead?
expected:
<a href="URL?title=Template:NonExistingTemplate&amp;action=edit&amp;redlink=1" 
class="new" title="Template:NonExistingTemplate (page does not 
exist)">Template:NonExistingTemplate</a>

or at least the content like a normal link would be rendered

actual:
{{NonExistingTemplate}}

What version of the product are you using? On what operating system?
3.0.20-SNAPSHOT

Please provide any additional information below.
https://secure.wikimedia.org/wikipedia/en/wiki/Help:Template#General

Note: Attempting to transclude a template that does not exist produces a red 
link, just like linking to any other nonexistent page. Following the link 
allows one to create that particular template.

Original issue reported on code.google.com by nico.kru...@googlemail.com on 8 Oct 2012 at 2:04

GoogleCodeExporter commented 9 years ago
FYI: the corresponding lines seem to be AbstractWikiModel:1840-1843

Original comment by nico.kru...@googlemail.com on 8 Oct 2012 at 2:24

GoogleCodeExporter commented 9 years ago

Original comment by axelclk@gmail.com on 9 Oct 2012 at 4:25

GoogleCodeExporter commented 9 years ago
Commited r7090 and r7091

I choose option 2 "the content should be rendered like a normal link",
because the method for wiki link rendering is now called and could decide if 
the link should be "editable".

Original comment by axelclk@gmail.com on 9 Oct 2012 at 5:02

GoogleCodeExporter commented 9 years ago
thank you once again.

a minor issue is still present with the choice of the namespace to append, e.g. 
see the following wikitext:

==========
{{Help:test}}

{{test}}

{{:test}}
==========

the first is rendered to a link pointing to Template:Help:test but should be 
Help:Test (which is included correctly if the page exists)

Original comment by nico.kru...@googlemail.com on 10 Oct 2012 at 8:57

GoogleCodeExporter commented 9 years ago
I just realise that the fact that the correct page is included is in my code 
(overriding #getRawWikiContent) which fixes that behaviour...
I'll try to backport this to bliki so this gets fixed for everyone.

Original comment by nico.kru...@googlemail.com on 10 Oct 2012 at 9:02

GoogleCodeExporter commented 9 years ago
Commited r7155 to improve the rendering of templates with "namespace links".

Original comment by axelclk@gmail.com on 10 Oct 2012 at 6:53

GoogleCodeExporter commented 9 years ago
almost like my start yesterday

see an enhanced version covering more special cases in the attached patch (the 
patch should apply with -p0 in the info.bliki.wiki directory) - I also extended 
the test case

Original comment by nico.kru...@googlemail.com on 11 Oct 2012 at 3:28

Attachments:

GoogleCodeExporter commented 9 years ago
Commited r7219.
Thanks for the patch.

Original comment by axelclk@gmail.com on 11 Oct 2012 at 5:03

GoogleCodeExporter commented 9 years ago
Commited r7220.
Thanks for the patches.

Original comment by axelclk@gmail.com on 11 Oct 2012 at 9:05