Skip to content
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

Relative paths in content are not correctly handled #46

Open
cavo789 opened this issue Jul 3, 2019 · 4 comments
Open

Relative paths in content are not correctly handled #46

cavo789 opened this issue Jul 3, 2019 · 4 comments

Comments

@cavo789
Copy link

cavo789 commented Jul 3, 2019

Hello

There is incorrect management of relative links to images.

Let us imagine the situation:

/wiki_root
     /images/img.png
     /content/parameters.md

Under my wiki_root folder, I've a sub-folder with my images.
In my /content/parameters.md file, I put the following code ![](./../images/img.png). To get the image, I need to go one folder up to retrieve the images folder..

Below a preview from within vscode: the first image is displayed; it's normal, the path is correct.
On the other hand, the second image isn't displayed, normal tool, the path is incorrect.

2019-07-03_15h55_53

But, the convert tool didn't understand. He can find the ... second image because seems to calculate paths based on the root folder of the wiki. This is wrong. The path is relative to the markdown document; not from the root of the repository.

Is it possible to solve this please ?

Thanks.

Below the result of the conversion when I remove the first (and yet correct) link:

2019-07-03_15h56_39

The second image is displayed and it shouldn't be the case since the path is wrong.

Thanks a lot!

@flashpixx
Copy link

I have tested the tool on Gitlab Wiki pages, and the problem still exists here also. The path of an image must be relative to the Markdown file. I can create a working image link for the Wiki xor for the converter call, but not for both.

@cavo789
Copy link
Author

cavo789 commented Sep 4, 2019

Hello

I've abandoned the idea of using this tool (github-wikito) due to the problem mentioned here above (seems that the image has to be stored in the root of the wiki; my example illustrates that problem).

Now I'm using pandoc to convert a .md file to .html, .pdf, ... At this time, I convert one file but we can of course write small piece of code to first concatenate several .md files into one before creating the output file.

Have a nice day.

@connorjak
Copy link

I'm reproducing this issue. My use case is tutorial documentation with lots of links from wiki pages to other wiki pages.

@petrkalina
Copy link

petrkalina commented Feb 26, 2020

using the following syntax

![images/new-image-2.jpg](images/new-image-2.jpg)

results in html like

<img src="data:image/jpeg;base64,/9j/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCI...

and the images are displayed in the PDF. Using i.e.

[[images/new-image-2.jpg]]

results in

<a href="#new-image-2.jpg">images/new-image-2.jpg</a>

html and this translated to non-funuctioning link in the PDF..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants