agelessdummy / vimwiki

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

External links with "#", "%"' don't work under Linux #424

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Under Linux, with either command-line vim or gvim, add an external link 
containing a '#' or '%' character, e.g. 
[https://en.wikipedia.org/wiki/2_%2B_2_%3D_5] or 
[https://en.wikipedia.org/wiki/Percent_encoding#See_also], to a vimwiki 
document.
2. Position the text cursor on the link and press enter.
3. The web browser will try to open the URL 
[https://en.wikipedia.org/wiki/2_\%5C\%2B_2_\%5C\%3D_5] or 
[https://en.wikipedia.org/wiki/Percent_encoding#See_also], respectively, i.e., 
the '%' and '#' of the URL are escaped with backslashes but should not have 
been escaped.

What is the expected output? What do you see instead?

Special characters in URLs should be escaped when used in shell commands or the 
like (see e.g. issues #274) but not more than necessary.

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

* vimwiki 2.1 as provided by the master branch of the git repository at 
[https://github.com/vimwiki/vimwiki] (I am using the vundle package manager to 
manage the vim bundles I use.)
* vim 7.3 ("VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr  2 2013 
09:18:18)") as provided by Lubuntu 13.4 (a Ubuntu-based Linux distribution)

Please provide any additional information below.

This appears to be a regression introduced with the fix to issue #401. Changing 
the line
  call system('xdg-open ' . shellescape(a:url, 1).' &')
in the function s:win32_handler in the file base.vim to
  call system('xdg-open ' . shellescape(a:url).' &')
appears to fix the problem. See ":h shellescape".

Original issue reported on code.google.com by jtbergem...@yahoo.de on 16 Jan 2014 at 6:36

GoogleCodeExporter commented 8 years ago
Thank you, I will take a look at it. BTW, bugs should go to the Github page: 
https://github.com/vimwiki/vimwiki

Original comment by istjanic...@gmail.com on 28 Feb 2014 at 12:36