From bf2723e83140099914b29c6d51eb147a065be460 Mon Sep 17 00:00:00 2001 From: Sujal Gurung <86787475+dinesh-58@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:17:05 +0545 Subject: [PATCH] add `checked` to htmlBooleanAttributes (#12311) Co-authored-by: Emanuele Stoppa --- .changeset/brown-rocks-ring.md | 5 +++++ packages/astro/src/runtime/server/render/util.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/brown-rocks-ring.md diff --git a/.changeset/brown-rocks-ring.md b/.changeset/brown-rocks-ring.md new file mode 100644 index 0000000000..a32bd412d8 --- /dev/null +++ b/.changeset/brown-rocks-ring.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Adds `checked` to the list of boolean attributes. \ No newline at end of file diff --git a/packages/astro/src/runtime/server/render/util.ts b/packages/astro/src/runtime/server/render/util.ts index 5dd428b9b1..ef8a64fa73 100644 --- a/packages/astro/src/runtime/server/render/util.ts +++ b/packages/astro/src/runtime/server/render/util.ts @@ -7,7 +7,7 @@ import { HTMLString, markHTMLString } from '../escape.js'; export const voidElementNames = /^(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/i; const htmlBooleanAttributes = - /^(?:allowfullscreen|async|autofocus|autoplay|controls|default|defer|disabled|disablepictureinpicture|disableremoteplayback|formnovalidate|hidden|loop|nomodule|novalidate|open|playsinline|readonly|required|reversed|scoped|seamless|selected|itemscope)$/i; + /^(?:allowfullscreen|async|autofocus|autoplay|checked|controls|default|defer|disabled|disablepictureinpicture|disableremoteplayback|formnovalidate|hidden|loop|nomodule|novalidate|open|playsinline|readonly|required|reversed|scoped|seamless|selected|itemscope)$/i; const htmlEnumAttributes = /^(?:contenteditable|draggable|spellcheck|value)$/i; // Note: SVG is case-sensitive! const svgEnumAttributes = /^(?:autoReverse|externalResourcesRequired|focusable|preserveAlpha)$/i;