#4503·harper

Highlights are not painted when the page already contains an element with Harper's highlight style id

Author: brakloCreated Sep 30, 2026Updated Oct 1, 2026
Labelsfirefox-plugin

Describe the bug Harper finds the lints and the suggestion popup opens when I click the word, but the words are not underlined. It happens when the edited document already contains an element with the id harper-highlight-style-Spelling (or another lint kind), for example a stale <style> element that came in with quoted content.

insertHighlightStyle() in packages/lint-framework/src/lint/Highlights.ts only checks document.getElementById(styleId) and returns early when it finds anything. The highlights are registered in CSS.highlights, but Harper's own ::highlight() rule is never inserted, so nothing is painted.

To Reproduce

  1. Send a message from the Thunderbird compose window with Harper running in it (so Harper's <style id="harper-highlight-style-Spelling"> ends up in the sent HTML; see #1425 for how the extension runs there).
  2. Open that message with "Edit as New" or reply to it. Thunderbird keeps the <style> element in the compose document but empties its rules.
  3. Type a misspelled word.
  4. The word is not underlined. Clicking it still opens the suggestion popup.

Expected behavior Misspelled words are underlined regardless of what elements the edited content contains.

Platform Thunderbird compose window, with the Firefox build of the extension repackaged as a MailExtension. The check itself is browser independent, so any page carrying an element with that id should behave the same, but I only reproduced it in Thunderbird.

Additional context I will open a pull request with a fix. I worked on this with an AI agent. I have reviewed the AI parts and edited them when appropriate.