Description
vite-plugin-php fails to restore PHP placeholders during build when PHP is used as a standalone HTML attribute (boolean / attribute injection). DEV works correctly.
Affected pattern
<div value="val" <?php echo $variable; ?>>Content</div>
Build output (incorrect)
<div value="val" php_code_placeholder_1="">Content</div>
The PHP placeholder is not converted back to PHP value.
Working patterns
PHP inside an attribute value works as expected:
<div value="val <?php echo $variable; ?>">Content</div>
PHP as node content also works:
<div value="val"><?php echo $variable; ?></div>
Expected behavior: Standalone PHP attributes (commonly used for checked, selected, disabled, data-*, etc.) should be restored correctly during build.
Suspected cause: The placeholder tracking / reverse-mapping logic does not handle PHP blocks that appear as full attributes (not inside quoted values).
Impact: Prevents valid PHP/HTML patterns commonly used for conditional attributes.
Suggestion: Extend the parser / placeholder restore logic to support PHP blocks that represent entire attributes, not only quoted attribute values or node content.
Description
vite-plugin-phpfails to restore PHP placeholders during build when PHP is used as a standalone HTML attribute (boolean / attribute injection). DEV works correctly.Affected pattern
Build output (incorrect)
The PHP placeholder is not converted back to PHP value.
Working patterns
PHP inside an attribute value works as expected:
PHP as node content also works:
Expected behavior: Standalone PHP attributes (commonly used for
checked,selected,disabled,data-*, etc.) should be restored correctly during build.Suspected cause: The placeholder tracking / reverse-mapping logic does not handle PHP blocks that appear as full attributes (not inside quoted values).
Impact: Prevents valid PHP/HTML patterns commonly used for conditional attributes.
Suggestion: Extend the parser / placeholder restore logic to support PHP blocks that represent entire attributes, not only quoted attribute values or node content.