← Back to PRs

#22776: fix: restore export-session HTML template placeholders broken by Prettier

by miloudbelarebia open 2026-02-21 17:19 View on GitHub →
size: XS
## Summary Restores the `{{MARKED_JS}}`, `{{HIGHLIGHT_JS}}`, and `{{JS}}` placeholders in the export-session HTML template that were broken by Prettier auto-formatting. ## Problem Prettier reformatted single-line placeholders into multi-line JavaScript blocks: ```html <!-- Before (broken by Prettier) --> <script> { { MARKED_JS; } } </script> ``` The `.replace("{{MARKED_JS}}", ...)` calls in `commands-export-session.ts` look for the single-line `{{MARKED_JS}}` form, so the replacement silently fails and the exported HTML contains no JavaScript. ## Fix ```html <!-- After (with prettier-ignore to prevent re-formatting) --> <!-- prettier-ignore --> <script>{{MARKED_JS}}</script> ``` **1 file changed:** `src/auto-reply/reply/export-html/template.html` Fixes #22595 ## Local Validation - Verified placeholders match the `.replace()` patterns in `commands-export-session.ts` - Added `<!-- prettier-ignore -->` to prevent future Prettier reformatting ## Scope Single HTML template file. Zero logic changes. ## AI Assistance Claude Code assisted with identifying the Prettier reformatting pattern. ## Author **Miloud Belarebia** — [@miloudbelarebia](https://github.com/miloudbelarebia) <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixes broken JavaScript placeholders in the export-session HTML template that were reformatted by Prettier/oxfmt. The placeholders `{{MARKED_JS}}`, `{{HIGHLIGHT_JS}}`, and `{{JS}}` were split across multiple lines, causing `.replace()` calls in `commands-export-session.ts:92-97` to fail silently. The fix restores single-line format and adds `<!-- prettier-ignore -->` comments to prevent future auto-formatting. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with no risk - The fix is minimal, well-targeted, and directly addresses a clear bug. The change only affects formatting of template placeholders, with no logic changes. The `prettier-ignore` directive is a standard, widely-used pattern that prevents future reformatting issues. - No files require special attention <sub>Last reviewed commit: 1759c45</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs