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

[BUG] Image preview and link jumping with a relative/absolute pathname work unexpectedly #11

Open
DehanLUO opened this issue Mar 19, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@DehanLUO
Copy link

DehanLUO commented Mar 19, 2022

Describe the bug

I made it a markdown demo to describe the bug. However, I not sure how to upload markdown code without previewing it. So, I attached the file following. Sry, my bad.
main.md

Result from CocInfo

## versions

vim version: VIM - Vi IMproved 8.2 8023455
node version: v17.7.1
coc.nvim version: 0.0.80-ccd0b050e0
coc.nvim directory: /Users/dehan/.vim/plugged/coc.nvim
term: dumb
platform: darwin

## Log of coc.nvim

2022-03-18T20:18:12.369 WARN (pid:67086) [attach] - Plugin not ready when received "highlight" []
2022-03-18T20:18:12.461 INFO (pid:67086) [services] - registered service "highlight"
2022-03-18T20:18:12.607 INFO (pid:67086) [plugin] - coc.nvim initialized with node: v17.7.1 after 234ms
2022-03-18T20:18:24.623 INFO (pid:67086) [attach] - receive notification: highlight []
2022-03-18T20:18:24.713 WARN (pid:67086) [extension:coc-prettier] - jsxBracketSameLine is deprecated.
2022-03-18T20:18:24.800 INFO (pid:67086) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ]
2022-03-18T20:18:25.192 INFO (pid:67086) [attach] - receive notification: highlight []
2022-03-18T20:18:36.681 INFO (pid:67086) [attach] - receive notification: highlight []
2022-03-18T20:18:44.505 INFO (pid:67086) [attach] - receive notification: showInfo []
2022-03-18T20:18:44.717 INFO (pid:67086) [attach] - receive notification: highlight []
2022-03-18T20:19:01.600 INFO (pid:67086) [attach] - receive notification: highlight []
2022-03-18T20:19:02.724 INFO (pid:67086) [attach] - receive notification: highlight []
2022-03-18T20:19:03.409 INFO (pid:67086) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ]
2022-03-18T20:19:03.570 INFO (pid:67086) [attach] - receive notification: highlight []
2022-03-18T20:19:07.405 INFO (pid:67086) [attach] - receive notification: showInfo []

Steps to reproduce
Steps to reproduce the behavior:

  1. execute gvim
  2. :CocCommand markdown-preview-enhanced.openPreview
  3. See error

Expected behavior

Images displaying and links jumping correctly.

Screenshots

image

Additional context
None

@DehanLUO DehanLUO added the bug Something isn't working label Mar 19, 2022
@weirongxu
Copy link
Owner

Hi @DehanLUO.
Actually, This is a limitation of vscode webview, which restricts webview to accessing files outside of the project for security reasons.

So when mume goes to resolve the absolute path of the image, it will change it to a relative path.

Unfortunately, we have to wait for mume to solve this issue.

shd101wyy/crossnote#132
shd101wyy/vscode-markdown-preview-enhanced#215

@DehanLUO
Copy link
Author

Hi @DehanLUO. Actually, This is a limitation of vscode webview, which restricts webview to accessing files outside of the project for security reasons.

So when mume goes to resolve the absolute path of the image, it will change it to a relative path.

Unfortunately, we have to wait for mume to solve this issue.

shd101wyy/mume#132 shd101wyy/vscode-markdown-preview-enhanced#215

Thank you for the detail you went into mume.
Have a good day :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants