Bug: MS Outlook style codes mess up behaviour of TB Compose Message window
Status: UNCONFIRMED
Priority: --
Created: 2021-07-01 06:01:45+00:00
Resolved: 2023-05-30 11:59:52+00:00

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

I'm using Thunderbird 78.8.1 on Ubuntu 18.04 under Unity.

Frequently, email chains that I respond to in Thunderbird contain <style> information introduced by other user agents, in particular MS Outlook. 
When replying to such messages, the style information for 'standard text' is overridden somehow, and I get bad formatting in my composed messages. For example, the 'body text' font gets changed to Calibri, which is not installed, and appears to result in Liberation Serif being substituted (even though I have the metric-equivalent Carlito installed on my system). 

It becomes annoying and rather difficult to provide a nice-looking email in response to nearly anything received from an MS Outlook user! My workaround is to select-all, then use the 'insert HTML', then remove the <style>...</style> block from the quoted email. That usually makes my own reply look good, but then messes up the formatting of the quoted text. There is no easy solution...


Actual results:

See attached screenshot. 

Here is the text of a minimum working example, which is the text extracted from the 'insert HTML' window while editing a mail reply, with personal text removed:

--- 8< ---
<p>asfasf</p>
<p>asfdsaf</p>
<ul>
  <li>safasdfas</li>
  <li>asfsaf</li>
</ul>
<p>sadfsaf<br>
</p>
<div class="moz-cite-prefix">On 1/7/21 2:21 pm, CCC - XX wrote:<br>
</div>
<blockquote type="cite"
cite="mid:SY4P282MB292074DB6CD0E67FB3C43821C2009@SY4P282MB2920.AUSP282.PROD.OUTLOOK.COM">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 15 (filtered medium)">
  <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
  <style>@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
	{font-family:Geneva;}p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{mso-style-priority:99;
	mso-style-link:"Plain Text Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;}p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;}span.PlainTextChar
	{mso-style-name:"Plain Text Char";
	mso-style-priority:99;
	mso-style-link:"Plain Text";
	font-family:"Calibri",sans-serif;}span.EmailStyle21
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}span.EmailStyle22
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:windowtext;}span.EmailStyle23
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}span.EmailStyle24
	{mso-style-type:personal;
	font-family:Geneva;
	color:windowtext;
	font-weight:normal;
	font-style:normal;}span.EmailStyle25
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}span.EmailStyle26
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}div.WordSection1
	{page:WordSection1;}ol
	{margin-bottom:0cm;}ul
	{margin-bottom:0cm;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
  <div class="WordSection1">
    <p class="MsoNormal"><span style="color:#1F497D">Hello John,<o:p></o:p></span></p>
   
  </div>
</blockquote>
--- 8< ---



Expected results:

I think that Thunderbird needs to do something smart about its application of stylesheets. For example, when quoting text from another email, perhaps the embedded styles need to be manipulated so that they only refer to the quoted text, not to the entire HTML. I am sure there are tools that could allow for that. Somehow the text formatting of the quoted text needs to be 'frozen in place' and not affect the main message body. (This reminds me also of the issue of respond to a message containing quoted <ol><li>...<li>...</ol> -- as soon as you started adding body text inbetween the list items, the they renumber to 1., 1., 1.. instead of keeping their original (quoted) numbering.