# Component: Compose Script **File:** `src/compose/compose.js` (loads `lib/settings.js`, `lib/marker.js` and `lib/quote.js` first, see `COMPOSE_SCRIPT_FILES`) **What:** Runs in the editor document of every compose window. Intercepts characters typed inside a quote, splits the quote and inserts the comment with its marker. Flow: [system-design.md](../architecture/system-design.md#3-key-press-inside-a-quote). **Important:** - `globalThis.__inlineCommentComposeLoaded` prevents the script from running twice (registration plus injection after install or update). - Changes to the text go through `document.execCommand`, so they end up in the editor's undo history. Only the fallback (manual split) changes the DOM directly. - The HTML comment is built as a DOM node by `createCommentNode()` (`lib/marker.js`) and handed to the editor as `execCommand("insertHTML", node.outerHTML)`. No HTML is assembled from strings, see [decision 0005](../decisions/0005-no-markup-sinks.md). - Markers in the message body: - quote: `blockquote[type=cite]` (HTML), `[_moz_quote=true]` (plain text) - own comment: `[data-inline-comment=""]`, marker: `[data-inline-comment-marker]` - Comments inside a quote (for example inline comments written earlier in the thread) count as part of the quote and are split like any other quoted text. - The script shows no user interface texts, so it does not use `_locales`. Date and time in the marker (`{date}`, `{time}`) are formatted in the application's locale. **Troubleshooting:** In the settings, under "Advanced", turn on "Diagnostic output in the error console". The messages appear in the error console of Thunderbird/Betterbird (`Ctrl+Shift+J`) and start with `[Inline Comment]`.