# markdown_preview: Fix relative links in remote Markdown subfolders \(\#61438\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/9d0ef37a25711c00bf6d1ba1142e9de4f4a122a9)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 9d0ef37a25711c00bf6d1ba1142e9de4f4a122a9

Requested commit: 9d0ef37a25711c00bf6d1ba1142e9de4f4a122a9

Commit: 9d0ef37a25711c00bf6d1ba1142e9de4f4a122a9

Tree: b74b578576ea62f148567a3c996392aa90ac35b2

Author: Smit Barmase

Committer: GitHub

## Message

```
markdown_preview: Fix relative links in remote Markdown subfolders (#61438)

Closes #58270

In remote projects, Markdown previews resolved relative links from the
project root instead of the Markdown file's folder. Links worked for
files in the root but could fail or open the wrong file for files in
subfolders.

Zed now resolves these links from the Markdown file's folder. The fix
updates base path handling in `open_url_or_file`. Only Markdown Preview
passes a base path to this function.

I tested it on macOS with a Linux SSH host and on Windows with WSL.

Release Notes:

- Fixed relative links in Markdown previews for files in subfolders when
using SSH or WSL.
```

## Parents

- [b6dac6ca30df1c3bd4b7d34f53ac64da6cd8a4a0](https://git.cafe/gitcafe/zed/commit/b6dac6ca30df1c3bd4b7d34f53ac64da6cd8a4a0?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/9d0ef37a25711c00bf6d1ba1142e9de4f4a122a9?format=markdown)
