Skip to content

Commit

Permalink
docs: add markdown image syntax migration guide (close #1373) (#1420)
Browse files Browse the repository at this point in the history
Co-authored-by: meteorlxy <meteor.lxy@foxmail.com>
  • Loading branch information
Mister-Hope and meteorlxy committed Oct 11, 2023
1 parent 1254c79 commit d857f8d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions docs/guide/migration.md
Expand Up @@ -239,9 +239,18 @@ This directory will not be used as local theme implicitly if it is existed.

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

### Markdown slot Change
### Markdown Change

Markdown slot is no longer supported.
- Markdown slot is no longer supported.
- 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.

```diff
- ![](@alias/foo.png)
- ![](package-name/bar.png)

+ <img src="@alias/foo.png">
+ <img src="package-name/bar.png">
```

### CLI Change

Expand Down
13 changes: 11 additions & 2 deletions docs/zh/guide/migration.md
Expand Up @@ -239,9 +239,18 @@ VuePress v1 的 Stylus 调色板系统 (即 `styles/palette.styl` 和 `styles/

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

### Markdown 插槽变更
### Markdown 变更

Markdown 插槽不再被支持。
- Markdown 插槽不再被支持。
- Markdown 图片语法不再支持 Webpack 别名。不以 `./` 开头的链接也会被识别为相对路径,这与原生 Markdown 图片语法的行为一致。如果你想要使用 Webpack 别名,或者使用来自外部包的图片,你应该使用 `<img>` 标签。

```diff
- ![](@alias/foo.png)
- ![](package-name/bar.png)

+ <img src="@alias/foo.png">
+ <img src="package-name/bar.png">
```

### CLI 变更

Expand Down

0 comments on commit d857f8d

Please sign in to comment.