Skip to content

Commit d857f8d

Browse files
docs: add markdown image syntax migration guide (close #1373) (#1420)
Co-authored-by: meteorlxy <[email protected]>
1 parent 1254c79 commit d857f8d

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

docs/guide/migration.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,18 @@ This directory will not be used as local theme implicitly if it is existed.
239239

240240
You need to import and set your local theme via [theme](../reference/config.md#theme) option.
241241

242-
### Markdown slot Change
242+
### Markdown Change
243243

244-
Markdown slot is no longer supported.
244+
- Markdown slot is no longer supported.
245+
- Markdown image syntax does not support webpack aliases anymore. Links without `./` prefix are also treated as relative links, which is aligned with the behavior of the native markdown image syntax. If you want to use aliases in image paths, or use images from external packages, you should use `<img>` tag instead.
246+
247+
```diff
248+
- ![](@alias/foo.png)
249+
- ![](package-name/bar.png)
250+
251+
+ <img src="@alias/foo.png">
252+
+ <img src="package-name/bar.png">
253+
```
245254

246255
### CLI Change
247256

docs/zh/guide/migration.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,18 @@ VuePress v1 的 Stylus 调色板系统 (即 `styles/palette.styl` 和 `styles/
239239

240240
你需要在 [theme](../reference/config.md#theme) 配置项中显式引入并使用本地主题。
241241

242-
### Markdown 插槽变更
242+
### Markdown 变更
243243

244-
Markdown 插槽不再被支持。
244+
- Markdown 插槽不再被支持。
245+
- Markdown 图片语法不再支持 Webpack 别名。不以 `./` 开头的链接也会被识别为相对路径,这与原生 Markdown 图片语法的行为一致。如果你想要使用 Webpack 别名,或者使用来自外部包的图片,你应该使用 `<img>` 标签。
246+
247+
```diff
248+
- ![](@alias/foo.png)
249+
- ![](package-name/bar.png)
250+
251+
+ <img src="@alias/foo.png">
252+
+ <img src="package-name/bar.png">
253+
```
245254

246255
### CLI 变更
247256

0 commit comments

Comments
 (0)