J’ai juste fusionné une mise à jour, ce changement a été plus facile que prévu. Cela devrait éviter la plupart des problèmes de mise en page lorsqu’elle est trop longue pour Gmail.
main ← digest-truncation
opened 10:11PM - 19 Apr 23 UTC
This addresses an issue raised here: https://meta.discourse.org/t/email-summary-… styling-changed-as-rendered-in-gmail/251940
A simplified version of the problem:
```xml
<table>
<tr>
<td></td>
<td width="650"> </td>
<td></td>
</tr>
</table>
```
If the width-restricted `td` is too long, gmail will clip the end, including the following `td`.
When the last `td` is removed, the first `td` expands to fill the space and pushes all the content to the right, so it's no longer centered.
To avoid this, I've updated the structure so that each section centers itself and doesn't rely on the wrapping container.
```xml
<table>
<tr>
<td>
<table>
<tr>
<td></td>
<td width="650"> </td>
<td></td>
</tr>
</table>
<table>
<tr>
<td></td>
<td width="650"> </td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
```
So now if gmail clips a too-long email, only the last section that gets clipped will be misaligned.
This also results in a slightly different appearance with a wider background, but I think this is a completely fine trade-off.
Before:

After:

Ce n’est pas un modèle modifiable comme les autres, il se trouve dans le code source de Discourse ici : discourse/app/views/user_notifications/digest.html.erb at main · discourse/discourse · GitHub
3 « J'aime »