ContactForm relay wiring (recipient, thank-you, honeypot, marker) #2
@@ -20,5 +20,7 @@ describe('ContactForm.toHtml relay wiring', () => {
|
|||||||
expect(html).not.toContain('WHP-FORM');
|
expect(html).not.toContain('WHP-FORM');
|
||||||
expect(html).toContain('action="/legacy"');
|
expect(html).toContain('action="/legacy"');
|
||||||
expect(html).not.toContain('_gotcha');
|
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/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -447,9 +447,7 @@ ContactForm.craft = {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
html: `${marker}<form action="${actionAttr}" method="POST"${formStyle ? ` style="${formStyle}"` : ''}>
|
html: `${marker}<form action="${actionAttr}" method="POST"${formStyle ? ` style="${formStyle}"` : ''}>
|
||||||
${honeypot}
|
${honeypot ? ` ${honeypot}\n` : ''}${fieldsHtml ? ` ${fieldsHtml}\n` : ''} <button type="submit"${btnStyle ? ` style="${btnStyle}"` : ''}>${esc(props.submitText || 'Send Message')}</button>
|
||||||
${fieldsHtml}
|
|
||||||
<button type="submit"${btnStyle ? ` style="${btnStyle}"` : ''}>${esc(props.submitText || 'Send Message')}</button>
|
|
||||||
</form>`,
|
</form>`,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user