Ich habe gerade ein Update zusammengeführt, das war eine einfachere Änderung als erwartet. Dies sollte das meiste Layout-Brechen vermeiden, wenn es für Gmail zu lang ist.
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:

Es ist keine bearbeitbare Vorlage wie die anderen, sie befindet sich hier im Discourse-Quellcode: discourse/app/views/user_notifications/digest.html.erb at main · discourse/discourse · GitHub
3 „Gefällt mir“