Skip to content

docs: clarify execution order with modifyHTML and html.tags #5523

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

Merged
merged 3 commits into from
Jul 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion website/docs/en/plugins/dev/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ const myPlugin = () => ({

### modifyHTMLTags

Modify the tags that are injected into the HTML. This hook is triggered before the [modifyHTML](#modifyhtml) hook.
Modify the tags that are injected into the HTML.

- **Type:**

Expand Down Expand Up @@ -617,6 +617,16 @@ const tagsPlugin = () => ({
});
```

:::tip

When using `modifyHTML`, `modifyHTMLTags`, and `html.tags` options together, the execution order is as follows:

1. [modifyHTML](#modifyhtml)
2. [modifyHTMLTags](#modifyhtmltags)
3. [html.tags](/config/html/tags)

:::

### onBeforeCreateCompiler

import OnBeforeCreateCompiler from '@en/shared/onBeforeCreateCompiler.mdx';
Expand Down
12 changes: 11 additions & 1 deletion website/docs/zh/plugins/dev/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ const myPlugin = () => ({

### modifyHTMLTags

修改注入到 HTML 中的标签。这个钩子在 [modifyHTML](#modifyhtml) 钩子之前触发。
修改注入到 HTML 中的标签。

- **类型:**

Expand Down Expand Up @@ -613,6 +613,16 @@ const tagsPlugin = () => ({
});
```

:::tip

当同时使用 `modifyHTML`,`modifyHTMLTags` 和 `html.tags` 选项时,执行顺序如下:

1. [modifyHTML](#modifyhtml)
2. [modifyHTMLTags](#modifyhtmltags)
3. [html.tags](/config/html/tags)

:::

### onBeforeCreateCompiler

import OnBeforeCreateCompiler from '@zh/shared/onBeforeCreateCompiler.mdx';
Expand Down
Loading