Repository: withastro/astro
File: packages/astro/src/runtime/server/render/util.ts (TypeScript)

Code before:
		if (typeof value === 'object') {
			return markHTMLString(` ${key}="${toAttributeString(toStyleString(value), shouldEscape)}"`);
		}
	}

	// support `className` for better JSX compat
	if (key === 'className') {
		return markHTMLString(` class="${toAttributeString(value, shouldEscape)}"`);
	}

	// Prevents URLs in attributes from being escaped in static builds
	if (typeof value === 'string' && value.includes('&') && isHttpUrl(value)) {
		return markHTMLString(` ${key}="${toAttributeString(value, false)}"`);
	}

	// Boolean values only need the key
	if (htmlBooleanAttributes.test(key)) {
		return markHTMLString(value ? ` ${key}` : '');
	}

	// Other attributes with an empty string value can omit rendering the value
	if (value === '') {
		return markHTMLString(` ${key}`);
	}

	// Popover seems to be boolean, but it can actually have the value "auto" or "manual"
	if (key === 'popover' && typeof value === 'boolean') {
		return markHTMLString(value ? ` popover` : '');
	}

	return markHTMLString(` ${key}="${toAttributeString(value, shouldEscape)}"`);
}

// Adds support for `<Component {...value} />
export function internalSpreadAttributes(values: Record<any, any>, shouldEscape = true) {
	let output = '';
	for (const [key, value] of Object.entries(values)) {
		output += addAttribute(value, key, shouldEscape);
	}
	return markHTMLString(output);
}

export function renderElement(
	name: string,
	{ props: _props, children = '' }: SSRElement,
	shouldEscape = true,
) {
	// Do not print `hoist`, `lang`, `is:global`
	const { lang: _, 'data-astro-id': astroId, 'define:vars': defineVars, ...props } = _props;
	if (defineVars) {
		if (name === 'style') {

Review comment (suggestion):
```suggestion
	// We cannot add it to htmlBooleanAttributes because it can be: boolean | "auto" | "manual"
```

Code after:
		if (typeof value === 'object') {
			return markHTMLString(` ${key}="${toAttributeString(toStyleString(value), shouldEscape)}"`);
		}
	}

	// support `className` for better JSX compat
	if (key === 'className') {
		return markHTMLString(` class="${toAttributeString(value, shouldEscape)}"`);
	}

	// Prevents URLs in attributes from being escaped in static builds
	if (typeof value === 'string' && value.includes('&') && isHttpUrl(value)) {
		return markHTMLString(` ${key}="${toAttributeString(value, false)}"`);
	}

	// Boolean values only need the key
	if (htmlBooleanAttributes.test(key)) {
		return markHTMLString(value ? ` ${key}` : '');
	}

	// Other attributes with an empty string value can omit rendering the value
	if (value === '') {
		return markHTMLString(` ${key}`);
	}

	// We cannot add it to htmlBooleanAttributes because it can be: boolean | "auto" | "manual"
	if (key === 'popover' && typeof value === 'boolean') {
		return markHTMLString(value ? ` popover` : '');
	}

	return markHTMLString(` ${key}="${toAttributeString(value, shouldEscape)}"`);
}

// Adds support for `<Component {...value} />
export function internalSpreadAttributes(values: Record<any, any>, shouldEscape = true) {
	let output = '';
	for (const [key, value] of Object.entries(values)) {
		output += addAttribute(value, key, shouldEscape);
	}
	return markHTMLString(output);
}

export function renderElement(
	name: string,
	{ props: _props, children = '' }: SSRElement,
	shouldEscape = true,
) {
	// Do not print `hoist`, `lang`, `is:global`
	const { lang: _, 'data-astro-id': astroId, 'define:vars': defineVars, ...props } = _props;
	if (defineVars) {
		if (name === 'style') {