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

Link to a *.md file in another folder #580

Open
yongjincho opened this issue Mar 7, 2016 · 3 comments
Open

Link to a *.md file in another folder #580

yongjincho opened this issue Mar 7, 2016 · 3 comments

Comments

@yongjincho
Copy link

I'm using this wonderful app to manage my wki-like notes.

If I click the link to a markdown file in the current directory, the file is opened in the new window. However, if the link to the file in another directory, it shows "can't find the file.." message.

The link is just like...

[title](another_folder/title.md)

Thanks.

@Jmuccigr
Copy link
Contributor

Jmuccigr commented Mar 7, 2016

It apparently needs the path to be written out more fully. If another_folder is in the same folder as the document, try this:

[title](./another_folder/title.md)

Otherwise always use the full path, like /Users/username/Documents….

@uranusjr
Copy link
Member

Could you provide an example with a complete file structure? I tried the following, and everything works as expected:

.
├── main
│   ├── another.md
│   ├── inner
│   │   └── inner.md
│   └── main.md
└── outer.md

Content of main.md:

[another](another.md)

[another, dot](./another.md)

[inner](inner/inner.md)

[inner, dot](./inner/inner.md)

[outer](../outer.md)

---

The followings work if you check “Automatically create files for link targets” in preferences.

[boo 1](boo1.md)

[boo 2](./boo2.md)

[boo 3](inner/boo3.md)

[boo 4](./inner/boo4.md)

[boo 5](../boo5.md)

@Jmuccigr
Copy link
Contributor

Yeah, those all work for me.

uranusjr added a commit that referenced this issue Mar 17, 2016
UX enhancement regarding #580.

Previously MacDown delegates error-handling to Finder when a link
to nonexistent local file is clicked in preview (via NSWorkspace).
This leads to a generic "Can't find the file XXX" message, which
is not really useful.

This patch detects a file URL in the above scenario, and shows a
better message inside MacDown that provides an absolute path
(instead of just the filename), and hints the user to use the
auto-create feature if desired.

Behaviours are unchanged for cases which...

* The URL is not a local file.
* The target file exists.
* The auto-create option is on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants