Files
inline-comment/.docs/decisions/0002-split-quote-via-editor.md
T
Oliver_Herb 9053327486 Inline Comment 0.2.0 - initial public release
Thunderbird/Betterbird add-on (Manifest V3): typing inside a quote splits
the quote and inserts your own text with a marker such as [OH]:.

- English and German user interface
- Licensed under the Mozilla Public License 2.0
- English documentation, JSDoc lint gate, 87 tests (node:test + jsdom)
2026-11-24 12:07:09 +01:00

1.4 KiB
Raw Blame History

0002 – Let the editor split the quote, manual split only as fallback

Date: 2026-11-24 · Status: accepted, to be confirmed by the manual test

Context

The original concept was to split the <blockquote> directly in the DOM. Direct DOM changes bypass the editor: Ctrl+Z then does not work reliably, and nested quotes have to be handled by hand. The Thunderbird mail editor, however, already splits quotes itself when Enter is pressed inside a quote, right up to the outermost quote.

Decision

Default (splitMode = "native"): trigger execCommand("insertParagraph"), which is the same action as Enter. If the caret is outside every quote afterwards, the comment is inserted with insertHTML (HTML messages) or insertText (plain-text messages). Both steps end up in the undo history.

If the editor does not split the quote, insertParagraph is reverted with undo and the manual split (splitCiteAtRange) is used instead. The manual split can also be selected permanently in the settings ("Advanced" → "Split the quote" → "by the add-on").

Consequences

  • Ctrl+Z may need two steps (comment, then split).
  • Whether insertParagraph via execCommand splits the quote exactly like the Enter key can only be verified in the real editor. The automatic fallback keeps the add-on working if it does not.
  • The manual split is not part of the editor's undo history.