為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

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.

有幫助嗎?

問個問題

如果您還沒有帳號,您必須先登入帳號 來回覆文章。還沒有帳號的話,只能發問新問題