markdown-viewer icon indicating copy to clipboard operation
markdown-viewer copied to clipboard

Relative link issue after opening a local file

Open Macobian opened this issue 9 years ago • 3 comments

There are two markdown files on my local computer(Windows7):

  • C:\dir1\test1.md
  • C:\dir1\dir2\test2.md

I want a relative link in test1.md to test2.md after opening test1.md, like this:

 [TEST2](dir2/test2.md)

And I also want another link in test2.md back to test1.md after following the link above, like this:

 [TEST1](../test1.md)

Those links do not seem to be working in the current version.

I noticed these links below were OK, but they are incompatible with server file format.

 [TEST2](dir2\test2.md)
 [TEST1](test1.md)

Macobian avatar Jun 06 '16 04:06 Macobian

I had the same problem.

I found that the solution can be to remove the code to "sanitize" links here: https://github.com/Thiht/markdown-viewer/blob/master/chrome/content/markdown-viewer.js at line 149, 150, 151

// Sanitize: Only allow links in the same folder.
var match = linkInTheSameFolderWithHash.exec(originalHref);
if (match) {

This should be removed or it could be put under condition that the user can set in the PlugIn Option

lunat avatar Jul 05 '16 13:07 lunat

This sounds like the problem I'm seeing too.

tinyplasticgreyknight avatar Nov 13 '16 23:11 tinyplasticgreyknight

I have the same problem. Is this Add On maintained anymore?

funkvn avatar Sep 23 '17 08:09 funkvn