Ho appena unito un aggiornamento, è stato un cambiamento più facile del previsto. Questo dovrebbe evitare la maggior parte dei problemi di layout quando è troppo lungo per 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:

Non è un modello modificabile come gli altri, si trova nel codice sorgente di Discourse qui: discourse/app/views/user_notifications/digest.html.erb at main · discourse/discourse · GitHub
3 Mi Piace