[Vim-l] Template:Help - Simple fixes
hermitte at free.fr
hermitte at free.fr
Mon Jun 25 12:39:59 UTC 2007
John Beckett <johnb.beckett at gmail.com>:
> Bastl has done a great job getting everything working, but
> I think we need to re-visit how Template:Help works.
>
> 1. Modify Template:Help
> - Change "sf" to "sourceforge" in "vimplugin.sf.net".
It's fine with me.
> - Change "tag={{{1}}}" so parameter 1 is urlencoded.
I had to remove {{urlencode:xxx}}. It does fix anything. On the contrary, it
worsens the situation: single quotes are encoded while they must not.
> 2. Modify the CGI python 'help' script on the
> vimplugin.sourceforge.net web site:
> - Change "sf" to "sourceforge" in line:
> baseurl="http://vimdoc.sf.net/htmldoc/"
> - In "+baseurl+files[tag]" change "tag" so it is urldecoded
> (but do not urldecode the second "tag" on the same line).
>
> 3. Have the 'help' script put on the vimdoc.sourceforge.net
> site, instead of the vimplugin.sourceforge.net site.
> Then, change Template:Help to go to vimdoc.sourceforge.net.
>
> Reasons:
>
> Analysing network traffic shows that attempting to get a web
> page from xxx.sf.net causes a redirect to xxx.sourceforge.net.
> So, using the short name "sf.net" causes an extra DNS lookup,
> and an extra web page fetch (with no benefit).
>
> These redirects are the reason that the "#tag" anchors are
> failing. For example, clicking the link [[help|word]] goes to
> the correct page, but not to the correct anchor position on that
> page. That's because the CGI 'help' script sends the client to
> sf.net, and the subsequent redirect to sourceforge.net does NOT
> include the "#tag" anchor.
>
> You can test this at
> http://vim.wikia.com/wiki/User_talk:JohnBeckett
> which includes "Experiment with Template:Help :help word".
OK. That's extremelly odd. Again I have no problem, I'm redirected correctly to
http://vimdoc.sourceforge.net/htmldoc/motion.html#word. I don't know if it could
have any impact, I use firefox v2.
That's odd (bis), I've just done a test with IE (v7) and observed the same
problem you do.
> Currently, Template:Help fails for tags like "<tab>" (because of
> the angle brackets). I think that would work if urlencoding were
> performed.
Nope, it doesn't. I've already tried that. What I observed was quite strange.
It is quite easy to test and experiment by yourself: copy-paste what the
template inserts in a draft/sandbox-page, have a link with {{urlencode:}} and
one without. Use a tag with angle brackets, and see where the link gets you to.
If I understand (and remember) correctly what happens, we have something to fix
on the CGI script first.
> The reason we can't do urlencoding at the moment is that the
> CGI 'help' script does not urldecode before doing a lookup.
> [...]
> Any comments?
Whatever changes we undergo, they must be done on the CGI script, and may be on
the help template. Be cautious that urlencode encodes things that we don't want
to be encoded. Ideally we'd need a {{tagencode:xxx}} function that is compatible
with the CGI script.
--
Luc Hermitte
More information about the Vim-l
mailing list