diff --git a/docs/guide/api-plugin.md b/docs/guide/api-plugin.md index a35fc0d21b0ba8..d6f797034cd556 100644 --- a/docs/guide/api-plugin.md +++ b/docs/guide/api-plugin.md @@ -387,6 +387,9 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo interface HtmlTagDescriptor { tag: string + /** + * attribute values will be escaped automatically if needed + */ attrs?: Record children?: string | HtmlTagDescriptor[] /** diff --git a/packages/vite/src/node/plugins/html.ts b/packages/vite/src/node/plugins/html.ts index d68752d46c90b3..58881f9e3bef35 100644 --- a/packages/vite/src/node/plugins/html.ts +++ b/packages/vite/src/node/plugins/html.ts @@ -1088,6 +1088,9 @@ export function extractImportExpressionFromClassicScript( export interface HtmlTagDescriptor { tag: string + /** + * attribute values will be escaped automatically if needed + */ attrs?: Record children?: string | HtmlTagDescriptor[] /**