Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Links in markdown previews now open in new tabs and result in 404 #3591

Answered by jsjoeio
ChaDonSom asked this question in Q&A
Discussion options

Hi everyone, I'm having some sort of problem, but I don't know enough about my environment to be sure this is a real issue, so I thought I'd just ask here first.

I'm not sure when this started happening, but it was pretty recently after updating to 3.10.2.

Whenever I click a link in a markdown file written like [file](./file.md) from the preview, it comes up with a url like http://penguin.linux.test:8083/webview/vscode-resources/file///home/chase/project/file.md and the url results in a 404 error.

For some reason, it also is treating that url as an external url? That is, it asked first whether I wanted to trust that 'external' domain (that's the correct domain for where I'm running code-server).

Interestingly, if I click the 'Follow link' that shows up in the editor mode of a markdown file, it works.

I haven't been able to google anything that quite fits this scenario, except possibly this closed issue from Sep. 2019. I've been able to run VS Code 1.56 natively (I'm running on chromebook and code-server simply has better handling) and saw that markdown-preview links work normally there (although it doesn't entirely make sense to me why they wouldn't).

Any ideas or direction toward possible relevant code I could check out or something would be much appreciated! At the same time, this is understandably not a huge priority, either.

Thank you and I hope your day goes well!

You must be logged in to vote

Hmm...are you using any Markdown extensions by chance?

Can this be reproduced in a code-server environment with no extensions installed?

It seems to be working for me locally here (running 3.10.2 on macOS + Chrome):

Screenshot

Screen.Recording.2021年06月10日.at.9.51.05.AM.mov

I checked inside VSCode and it opens the file inside the editor. I guess we default to opening the raw file in the browser (but it could be nice to open directly in code-server. Not sure if we can do that yet though).

@code-asher might have some insight too

Replies: 1 comment 11 replies

Comment options

Hmm...are you using any Markdown extensions by chance?

Can this be reproduced in a code-server environment with no extensions installed?

It seems to be working for me locally here (running 3.10.2 on macOS + Chrome):

Screenshot

Screen.Recording.2021年06月10日.at.9.51.05.AM.mov

I checked inside VSCode and it opens the file inside the editor. I guess we default to opening the raw file in the browser (but it could be nice to open directly in code-server. Not sure if we can do that yet though).

@code-asher might have some insight too

You must be logged in to vote
11 replies
Comment options

Yeah, I think that might be it 😅

I just thought to go ahead and try it directly from the Ubuntu desktop and it worked just like you said it was supposed to.

It must be that ssh port linking I'm doing.

Comment options

I just thought to go ahead and try it directly from the Ubuntu desktop and it worked just like you said it was supposed to.

Oh man! Nice sleuthing! I was wondering if that could be related. Welp, I guess this is an environment issue and not a code-server issue? Either way, it would be nice if it just worked.

Comment options

I guess it didn't work for my locally-run code-server though, so perhaps it has more to do with Chrome OS's implementation of Linux?

The weirdest thing was just that it used to just open the previews there in the same preview pane. 🤷🏼‍♀️🤔😆

But I'd reckon that, too, may have been a result of being on Chrome OS.

Comment options

Maybe you're right? We have seen some weird issues with Chrome OS's implementation of Linux. I'm not sure what could have changed — either in VSCode/code-server or something browser-related 🤔

But at least you are unblocked (I hope 🤞)

Comment options

I've gotten my answer, anyway 🙂

I wish it could open the preview in the same pane, but I see that it was just a happy accident due to my environment that it ever did that 😅

I definitely hope it can be done someday in the future! But also I might look into how to do it with an extension or something. But for now, I'll just click the links from the editor pane.

Thanks again for your help!

Answer selected by ChaDonSom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /