为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Prevent quoted message HTML from affecting my response

  • 5 个回答
  • 1 人有此问题
  • 6 次查看
  • 最后回复者为 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.