Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

Prevent quoted message HTML from affecting my response

  • 5 отговора
  • 1 има този проблем
  • 1 изглед
  • Последен отговор от david

more options

I am using Thunderbird 115 with mostly default settings. When I compose a brand new message, pressing the Enter key inserts a new paragraph, with extra line spacing, and pressing Shift+Enter inserts a line break with single line spacing. This is how I want things.

I am experiencing a problem when replying to emails from a particular sender. Their emails HTML code contains a "<style>" element that removes the extra spacing for paragraphs:

<style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>

When replying to their emails, their HTML is inserted as quoted text, and the "<style>" element affects the whole email, including my response as I compose it. As a result, when I press Enter, I no longer see the extra line spacing, and Enter or Shift+Enter results look the same in the HTML version of my email. Yet they insert different content, and in fact the plain text version of the email still adds two line jumps for paragraphs vs a single jump for line breaks, and I cannot tell while composing.

Then, when I send my email, the recipient email reader (e.g. GMail or Office) appears to somehow pick up the difference again, so my paragraphs are displayed again with extra line spacing. This is an issue, because I cannot tell the difference between paragraphs and line breaks, they look the same to me, and I end up using both interchangeably. But they don't look the same to the recipient, and the resulting response looks messed up.

How can I prevent the quoted email from overriding styles in my own response?

I tried installing the CustomCSS addon to add my own "<style>" element, but unfortunately it gets added at the top of the document, and the quoted response's "<style>" element comes afterwards, thus overriding anything I set.

Perhaps the sender's configuration is at fault (they should not use a global "<style>" like this), but they are a customer, and it would not be appropriate for me to ask them to fix their email configuration.

The only "solution" I can think of is to switch to "Body text" as default style, such that paragraph blocks are never used. I think it is a shame to loose this feature, but at least there is no surprises.

I am using Thunderbird 115 with mostly default settings. When I compose a brand new message, pressing the Enter key inserts a new paragraph, with extra line spacing, and pressing Shift+Enter inserts a line break with single line spacing. This is how I want things. I am experiencing a problem when replying to emails from a particular sender. Their emails HTML code contains a "<style>" element that removes the extra spacing for paragraphs: <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style> When replying to their emails, their HTML is inserted as quoted text, and the "<style>" element affects the whole email, including my response as I compose it. As a result, when I press Enter, I no longer see the extra line spacing, and Enter or Shift+Enter results look the same in the HTML version of my email. Yet they insert different content, and in fact the plain text version of the email still adds two line jumps for paragraphs vs a single jump for line breaks, and I cannot tell while composing. Then, when I send my email, the recipient email reader (e.g. GMail or Office) appears to somehow pick up the difference again, so my paragraphs are displayed again with extra line spacing. This is an issue, because I cannot tell the difference between paragraphs and line breaks, they look the same to me, and I end up using both interchangeably. But they don't look the same to the recipient, and the resulting response looks messed up. How can I prevent the quoted email from overriding styles in my own response? I tried installing the CustomCSS addon to add my own "<style>" element, but unfortunately it gets added at the top of the document, and the quoted response's "<style>" element comes afterwards, thus overriding anything I set. Perhaps the sender's configuration is at fault (they should not use a global "<style>" like this), but they are a customer, and it would not be appropriate for me to ask them to fix their email configuration. The only "solution" I can think of is to switch to "Body text" as default style, such that paragraph blocks are never used. I think it is a shame to loose this feature, but at least there is no surprises.

Всички отговори (5)

more options

The switch to body text seems a workable solution, but have you tried responding in plain text? It seems that should work.

Полезно?

more options

david said

The switch to body text seems a workable solution, but have you tried responding in plain text? It seems that should work.

Thanks, that would work yes, but I then loose the ability to respond with HTML which is not acceptable (our HR-required signature uses HTML).

Полезно?

more options

If email to this client is infrequent, would you feel comfortable removing the style element? Thunderbird has addons that make editing raw HTML rather easy.

Полезно?

more options

david said

If email to this client is infrequent, would you feel comfortable removing the style element? Thunderbird has addons that make editing raw HTML rather easy.

This also works, but is quite painful. I have to scroll to locate the offending style element (including scrolling past the fairly large binary PNG data of an image in my signature). If I could setup a rule to automatically remove this, that would be great. Otherwise, this will remain a workaround; I feel this is something any user could have problems with, and not everyone has developer skills to edit HTML.

Alternatively, adding a rule so that all "p" elements inserted by Thunderbird use a style override of my choosing (which would preserve the line spacing) would be nicer, but I don't know of any addon that can do that.

Полезно?

more options

One final thought from me... consider developing a template with an opposite style statement that you could use when writing to that client. Alternatively, you could respond by rightclicking and selecting 'edit as new' and respond above the client's text. Ok, stick a fork in me; I'm done. Good luck.

Полезно?

Задаване на въпрос

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.