ContactForm relay wiring (recipient, thank-you, honeypot, marker) #2

Merged
jknapp merged 3 commits from contact-form-relay into main 2026-07-07 19:35:28 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit cf5d30382a - Show all commits
@@ -20,5 +20,7 @@ describe('ContactForm.toHtml relay wiring', () => {
expect(html).not.toContain('WHP-FORM');
expect(html).toContain('action="/legacy"');
expect(html).not.toContain('_gotcha');
// Backward-compat: ensure non-relay output is byte-identical (no extra blank lines from honeypot)
expect(html).not.toMatch(/<form[^>]*>\n\s*\n/);
});
});
+1 -3
View File
@@ -447,9 +447,7 @@ ContactForm.craft = {
return {
html: `${marker}<form action="${actionAttr}" method="POST"${formStyle ? ` style="${formStyle}"` : ''}>
${honeypot}
${fieldsHtml}
<button type="submit"${btnStyle ? ` style="${btnStyle}"` : ''}>${esc(props.submitText || 'Send Message')}</button>
${honeypot ? ` ${honeypot}\n` : ''}${fieldsHtml ? ` ${fieldsHtml}\n` : ''} <button type="submit"${btnStyle ? ` style="${btnStyle}"` : ''}>${esc(props.submitText || 'Send Message')}</button>
</form>`,
};
};