7fe47160e9daeec27da048ccc9834e0fff47d539
injectAttrs() skipped leading <style> blocks and then inserted the responsive/visibility/animation attrs before the first '>'. Relay forms (ContactForm, SubscribeForm, FormContainer with a recipient) start their toHtml with `<!--WHP-FORM ...-->`, so the attrs landed inside the marker (`thankyou=""-- data-wsb-r="...">`): the comment was left unterminated, Preview swallowed the form, and the publish step refused the whole site. injectAttrs now skips any leading run of whitespace, <style> blocks and <!--...--> comments (any order, repeated) and targets the first real element; a string that is only such a run is returned unchanged. The marker wire format is untouched. Tests port the backend's strict marker regex from FormRelayRewrite.php and export each relay form with a recipient + styleMobile/styleTablet + hideOnMobile + animation through exportBodyHtml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Languages
TypeScript
75.7%
JavaScript
12.4%
HTML
8.7%
CSS
2.6%
PHP
0.4%
Other
0.2%