Hmmm, in that example, and in the full email source you messaged me (thank you!) the moz-do-not-send attribute should not affect the display of the <img> or <a> tags that that attribute appears in. The mozfilter is only looking at values in the class attribute, and I can’t immediately see anywhere else that it might get filtered.
As such I can’t work out why the link-with-alias’s content and href get separated out, unless for some reason the discourse importer is suddenly deciding to use the plain/text part of the Mime encoded email (which does have the text and URL separated). Why it would do that I don’t know.
In your test discourse setup can you try importing/emailing a thunderbird HTML email with both a link-with-alias and, say an embedded image or something else that will mark it out as the HTML part of the email?
I’m still thinking this might be discourse using the other mime parts (in this case a plain/text part followed by an image/… part of the email to create its markdown version, though why I don’t know. Perhaps an HTML validator is rejecting the text/html part because of strictly-non-validating attributes like moz-do-not-send!?
Could you do one more test, with the same post (some text with an image in the middle, but also make some (but not all) of the text bold, even just one work. I think that will determine if the text part is coming from a text/plain or text/html block.
And sorry to ask, but just to make sure, you have incoming_email_prefer_html set to true (checked)?!
Thanks @Flominator . I see that the emboldened text has become italicised, so it’s definitely not using the HTML directly, but it is picking up on the emphasis somehow. I wonder if the text/plain part of the email gets some kind of markup/down added – would you be able to PM me the email source like last time?
Hi @Flominator , thanks for the raw email. Looking at the text/plain alternative part of the email does indeed put asterisks around the text that’s in bold in the text/html part. Most markdown renderers (such as the one in discourse) interpret this as italicised. Here’s the text/plain segment copied and pasted on its own:
Bild in die Mitte dann wieder Text von dem ein Teil sogar fett
geschrieben ist
Gruß
Flo
which looks identical to your screenshot.
So what I think is happening is that the text/html segment is being rejected as invalid HTML (probably down to the non-standard moz-do-not-send attribute name in the a tags). This will require the patch to change how valid HTML is checked (possibly just removing those attributes) and I’m less confident how stable that will be without it going into the core code. I’ll have a look when I get some time.
Cela signifie que le patch joint dans un commentaire précédent échouera (probablement pas de manière « spectaculaire » mais il pourrait alors nécessiter une reconstruction pour que les mises à niveau reprennent) lorsque vous mettrez à niveau pour inclure ce nouveau commit (probablement votre prochaine mise à niveau).
Si vous l’avez appliqué automatiquement (par exemple avec une cmdgit apply dans votre app.yml comme décrit ci-dessus), vous devriez le supprimer avant votre prochaine mise à niveau. En fait, une reconstruction pourrait être nécessaire car ce commit pourrait ne pas s’appliquer car l’endroit dans receiver.rb où il voudra appliquer le diff du commit a déjà été modifié par le patch.
Je vais 1) supprimer la cmdgit apply de app.yml, 2) reconstruire l’application, 3) mettre à jour (si ce n’est pas déjà fait lors de la reconstruction). Je vous dirai comment cela se passe…
[10 minutes plus tard…]
Finalement, j’ai fait ceci à la place car cela ne nécessite aucun temps d’arrêt pendant la reconstruction.
supprimer le git apply pour le patch de app.yml (il suffit de le faire avant votre prochaine reconstruction du conteneur d’application)
annuler le fichier patché avec :
i) launcher enter app
ii) (maintenant dans le conteneur d’application) cd /var/www/discourse git checkout ./lib/email/receiver.rb exit
mettre à jour discourse en utilisant la mise à jour de l’administrateur web