-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML conversion on Windows fails to correctly convert some wiki links #942
Comments
Awesome description. |
@tinmarino Thanks! First time contributing in open source, so wanted to be thorough. I am not familiar with vadar, so will take 1-2 days looking at existing code base, and will add the test cases by this weekend. |
Hi @adi93. Still OK to write the tests ? Start by reading the test/Readme. |
@tinmarino Yes, working on it. Had some trouble writing the test such that it passes both on Windows and Linux, but have figured it out, and will submit the test in about 3-4 hours. |
@adi93 I am also currently struggling with the tests. Trying to make the bash script working on Windows. |
Any idea how can I run the tests in windows? So far, what I am stumbling with is this:
After running ":Vader"
The thing is, I can easily run this on WSL, but I want to test it with windows, since that is where the bug comes. Can you point me to an issue that was for windows, and its accompanying tests? |
Oh, just saw your previous comment. |
Multiple possibilities:
Anyway, from |
Had no idea that vim had help for these codes as well. Anyway, your suggestions worked! The problem is, I was confusing the Execute block as a Do block in Vader. Also, writing to |
Fixed : #945 |
I merged to avoid future conflict. |
Vimwiki2HTML converts some links wrongly on Windows. I have tested this on Windows 10
TL;DR: Windows backslashes are causing a problem.
Setup
Output of
:VimwikiShowVersion
command:Syntax I am using: default
Current vimwiki settings:
File structure: I have the following files on Windows (On Windows, ~ translates to
C:\Users\user
) :Contents of
index.wiki
file:Contents of
abc.wiki
file:Steps to reproduce
Open the abc.wiki file and run
:Vimwiki2HTML
.Bug
After conversion, the "Link to home" link in
abc.html
should point toC:\Users\user\wiki\html\index.html
. Instead, it points toC:\Users\user\wiki\html\foo\bar\index.html
, which does not exist.Reason for bug
wikifile
variable passed to theconvert_file
function inhtml.vim
is being passed asC:\Users\user\wiki\foo\bar\abc.wiki
(line 1646 inhtml.vim
.), which sets the global variablecurrent_wiki_file
.vimwiki#base#resolve_link
function (line 482 inhtml.vim
).resolve_link
function then takes the root of source, and then forms the link forindex.wiki
asC:\Users\user\wiki\foo\bar/../../index.wiki
, which is then passed tovimwiki#path#normalize
function (line 267 inbase.vim
),C:\Users\user\wiki\foo\bar/index.wiki
, instead of the expectedC:\Users\user\wiki\index.wiki
Fix
On line 1646 in html.vim, in the function , we have:
This should be changed to the following:
This will pass the path "C:/Users/user/wiki/foo/bar/abc.wiki" instead of "C:\Users\user\wiki\foo\bar\abc.wiki" to
convert_file
, which will lead to the correct resolution byvimwiki#path#normalize
. I have already tested it in the dev branch.Should I create a pull request for it?
The text was updated successfully, but these errors were encountered: