Acabei de mesclar uma atualização, esta foi uma alteração mais fácil do que eu esperava. Isso deve evitar a maioria das quebras de layout quando for muito longo para o 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:

Não é um modelo editável como os outros, está no código-fonte do Discourse aqui: discourse/app/views/user_notifications/digest.html.erb at main · discourse/discourse · GitHub
3 curtidas