jobisoft / quicktext

An extension for Thunderbird that lets you create templates that can be easily inserted into your own emails.
Mozilla Public License 2.0
184 stars 52 forks source link

Thunderbird is not inserting rich (HTML) text behind a font tag. #378

Closed ViperGeek closed 11 months ago

ViperGeek commented 11 months ago

Version Info:

I recently upgraded to Thunderbird (TB) 115.2.2 (from 102) and lost the ability to insert HTML QuickText (QT) after any HTML text written in an e-mail. Inserting the QT as the first text in an HTML reply works fine, as does inserting plain text below written plain text.

When attempting to insert HTML QT below existing HTML, I receive the following errors in the TB Error Console:

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIHTMLEditor.insertHTML]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://quicktext/content/quicktext.js :: insertBody :: line 530"  data: no] [quicktext.js:530:22](chrome://quicktext/content/quicktext.js)
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsICommandController.getCommandStateWithParams]
    goUpdateCommandState chrome://messenger/content/messengercompose/ComposerCommands.js:210
    goUpdateComposerMenuItems chrome://messenger/content/messengercompose/ComposerCommands.js:281
    oncommandupdate chrome://messenger/content/messengercompose/messengercompose.xhtml:1
    observe chrome://messenger/content/messengercompose/editor.js:224
[ComposerCommands.js:257:13](chrome://messenger/content/messengercompose/ComposerCommands.js)
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsICommandController.getCommandStateWithParams]
    goUpdateCommandState chrome://messenger/content/messengercompose/ComposerCommands.js:210
    goUpdateComposerMenuItems chrome://messenger/content/messengercompose/ComposerCommands.js:281
    oncommandupdate chrome://messenger/content/messengercompose/messengercompose.xhtml:1
    observe chrome://messenger/content/messengercompose/editor.js:224
[ComposerCommands.js:257:13](chrome://messenger/content/messengercompose/ComposerCommands.js)

My test e-mail simply consists of:

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=">
  </head>
  <body>
    <font face="Cambria">This is new text.<br>
      <br>
      <br>
    </font>
  </body>
</html>

My QT HTML is pretty boring:

<pre>---
Dave Dugal                                 Support: +1-408-555-1212
Principal Security Engineer                Direct:  +1-978-555-1212
</pre>
jobisoft commented 11 months ago

You have a font tag in your example code, that is what causes the issue. In the exact same scenario, you are also not able to add a smiley from the smiley selector.

image

I do not know why the editor throws on adding content when the cursor is behind a font tag. It seems to be a bug in the editor code.

jobisoft commented 11 months ago

Please check my latest findings in https://github.com/jobisoft/quicktext/issues/377#issuecomment-1722322414. I think we can close this issue here as a dupe. Can you confirm my findings?

ViperGeek commented 11 months ago

Please check my latest findings in #377 (comment). I think we can close this issue here as a dupe. Can you confirm my findings?

Confirmed. ✅

jobisoft commented 11 months ago

Closed as dupe of #377

jobisoft commented 11 months ago

Filed a Thunderbird bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1857788