question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relative local file link

See original GitHub issue

Description

  • Can you reproduce the issue?

Steps to reproduce

  1. create markdown link to relative file e.g.: My File
  2. export as a PDF

Expected behavior:

In the PDF, the text link should link to my_file.pdf next to the markdown file location.

Actual behavior:

In the PDF, the text link links to: file:///D:/soft/marktext/marktext/resources/app.sar/dist/electron/my_file.pdf

Versions

  • Mark Text: v0.15.1 and v0.16.0
  • Operating system: Windows 10

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
fxhacommented, Nov 12, 2019

@Jocs I would categorized the issue as bug?!

0reactions
MrHeercommented, Nov 24, 2019

Yes, converting a relative path to an absolute makes sense, but I checked that the html data while export pdf. I found the url is relative path, but it will automatically become the absolute path after exporting pdf.

I did the following experiment:

  1. create a test.html file, and edit it
    <a href="./test.txt">go to test.txt</a>
    
  2. create a test.txt file in the same directory, and edit it
    test.txt
    
  3. open test.html with Chrome and click go to test.txt will will jump to test.txt
  4. Export test.html as pdf in Chrome using Print, then you can found the relative path will automatically become the absolute path.

So, I think the reason is Chrome Printer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help with relative path link to local file - html - Stack Overflow
I tried the code below and a number of similar permutations, but I can't seem to successfully write the relative path link for...
Read more >
HTML File Paths - W3Schools
When using relative file paths, your web pages will not be bound to your current base URL. All links will work on your...
Read more >
File Paths - HTML - Codecademy
Relative file path are paths that links to a local file in the same folder or on the same server, for example: ......
Read more >
How to create absolute hyperlinks and relative hyperlinks in ...
A relative hyperlink is a hyperlink that contains an address that is relative to the address of the destination file. The address of...
Read more >
file:// to point a relative file to current directory - Super User
A relative link usually doesn't include the protocol (like http: or https: or file: ). When the protocol is omitted, a web browser...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found