From fbdfc70a74f970d8589f48608b376c29792146c3 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:56:50 +0900 Subject: [PATCH] docs: clarify the values are escaped automatically --- docs/guide/api-plugin.md | 3 +++ packages/vite/src/node/plugins/html.ts | 3 +++ 2 files changed, 6 insertions(+) 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[] /**