email/transformations/transformemailaligntoattribute
module
Constants
module:email/transformations/transformemailaligntoattribute~transformEmailAlignToAttributePromotes a shared alignment value from all direct children of a
<td>element up to aalignattribute on the cell itself, removing the per-child alignment in the process.Examples:
// All children share align="center" via inline style: <td> <p style="text-align: center;">…</p> <p style="text-align: center;">…</p> </td> → <td align="center"> <p>…</p> <p>…</p> </td> // All children share align="center" via wrapper tables: <td> <table role="presentation" width="100%"><tbody><tr><td align="center"><img …></td></tr></tbody></table> <table role="presentation" width="100%"><tbody><tr><td align="center"><p …></p></td></tr></tbody></table> </td> → <td align="center"> <img …> <p …></p> </td> // Mixed alignments → no change: <td> <p style="text-align: center;">…</p> <p style="text-align: left;">…</p> </td> → (unchanged)Copy code