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 report] Cannot use image with alias #1373

Closed
trinhpham opened this issue Jul 4, 2023 · 4 comments · Fixed by #1420
Closed

[Bug report] Cannot use image with alias #1373

trinhpham opened this issue Jul 4, 2023 · 4 comments · Fixed by #1420
Labels
documentation Improvements or additions to documentation

Comments

@trinhpham
Copy link

Description

Upgrade to latest version broken sites that use image alias.

Reproduction

Use image alias in markdown

Used Package Manager

yarn

System Info

System:
    OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (6) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 4.68 GB / 7.77 GB
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 18.16.1 - /usr/local/share/nvm/versions/node/v18.16.1/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.5.1 - /usr/local/share/nvm/versions/node/v18.16.1/bin/npm
  Utilities:
    Git: 2.41.0 - /usr/local/bin/git
  Browsers:
    Chrome: Not Found
  npmPackages:
    @vuepress/bundler-vite: Not Found
    @vuepress/bundler-webpack: 2.0.0-beta.64 => 2.0.0-beta.64 
    @vuepress/cli:  2.0.0-beta.64 
    @vuepress/client:  2.0.0-beta.64 (2.0.0-beta.33)
    @vuepress/core:  2.0.0-beta.64 (2.0.0-beta.33)
    @vuepress/markdown:  2.0.0-beta.64 (2.0.0-beta.33)
    @vuepress/plugin-active-header-links:  2.0.0-beta.64 
    @vuepress/plugin-back-to-top:  2.0.0-beta.64 
    @vuepress/plugin-container:  2.0.0-beta.64 
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon:  2.0.0-beta.64 
    @vuepress/plugin-git:  2.0.0-beta.64 
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.64 
    @vuepress/plugin-nprogress:  2.0.0-beta.64 
    @vuepress/plugin-palette:  2.0.0-beta.64 
    @vuepress/plugin-prismjs:  2.0.0-beta.64 
    @vuepress/plugin-pwa: 2.0.0-beta.64 => 2.0.0-beta.64 
    @vuepress/plugin-pwa-popup: 2.0.0-beta.64 => 2.0.0-beta.64 
    @vuepress/plugin-register-components: 2.0.0-beta.64 => 2.0.0-beta.64 
    @vuepress/plugin-search: 2.0.0-beta.64 => 2.0.0-beta.64 
    @vuepress/plugin-shiki: 2.0.0-beta.64 => 2.0.0-beta.64 
    @vuepress/plugin-theme-data:  2.0.0-beta.64 
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.64 (2.0.0-beta.33)
    @vuepress/theme-default:  2.0.0-beta.64 
    @vuepress/utils:  2.0.0-beta.64 (2.0.0-beta.33)
    vue:  3.3.4 
    vue-loader:  17.2.2 
    vue-router:  4.2.2 
    vuepress: Not Found
    vuepress-vite: Not Found
    vuepress-webpack: 2.0.0-beta.64 => 2.0.0-beta.64
@trinhpham
Copy link
Author

trinhpham commented Jul 4, 2023

I think it's because #1103 .
Hm... took me one day to figure it out.

Please consider to revert it so people can migrate from v1 to this version.

@Mister-Hope
Copy link
Member

Mister-Hope commented Jul 4, 2023

The v1 behavior is actually breaking markdown. An <img src="a/b.png" /> should be a relative link that points to b.png under current folder's "a" sub dir.

We done the fix so that existing markdown contents like wiki and blogs could be served by VuePress out of box without adding ./ in every links. That's stopping more people to start using VuePress than people who migrates from V1.

Please consider to revert it so people can migrate from v1 to this version.

The usage of alias should be actually considered abnormal, so should requires extra handling. We still allows you to use alias in img tag, so you should consider migrating all markdown format to html tags.

@Mister-Hope Mister-Hope closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2023
@Mister-Hope Mister-Hope added the question Asking question label Jul 4, 2023
@fdevans
Copy link
Contributor

fdevans commented Sep 26, 2023

This is a disappointing breaking change. Having to migrate the hundreds of markdown docs to a new image format will be incredibly time consuming. Some sort of migration path option from V1 would be nice for your existing users.

When it's this much work it creates a situation where, along with measuring the effort of migrating we should look at other options.

At a minimum put this breaking change in the migration docs. It took me multiple days to find this and the existing docs are misleading that it could be made to work.

@Mister-Hope
Copy link
Member

I understand your disappointment, but I think that v1 support for this is unreasonable because far more people are complaining why should every relative markdown image link should be enforced starting with ./

We will mention this in migration docs, besides, you may try to use regexp to help you check and convert existing ones to new syntax, that should not be a hard work.

@Mister-Hope Mister-Hope reopened this Sep 27, 2023
@Mister-Hope Mister-Hope added documentation Improvements or additions to documentation and removed question Asking question labels Sep 27, 2023
meteorlxy added a commit that referenced this issue Oct 11, 2023
Co-authored-by: meteorlxy <meteor.lxy@foxmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants