#22776: fix: restore export-session HTML template placeholders broken by Prettier
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
#20816: fix(export-session): prevent Prettier from corrupting template plac...
by boris721 · 2026-02-19
90.8%
#22309: fix(export-session): render system prompt section and payload corre...
by AIflow-Labs · 2026-02-21
83.1%
#22695: fix(export): restore HTML template placeholders broken by formatter...
by lailoo · 2026-02-21
78.6%
#17244: fix: strip TTS tags from agent replies before delivery (#14652)
by robbyczgw-cla · 2026-02-15
72.0%
#20419: fix(webchat): explicitly pass gfm and breaks options to marked.parse()
by Limitless2023 · 2026-02-18
71.2%
#20423: fix(web-fetch): cap htmlToMarkdown input size to prevent catastroph...
by Limitless2023 · 2026-02-18
71.1%
#2716: Fix #2678: markdown horizontal rules not rendering in web chat
by Ambar-13 · 2026-01-27
70.1%
#6596: Fix pre-existing formatting issues causing CI failures
by ryancnelson · 2026-02-01
69.6%
#4249: fix(telegram): properly nest link tags inside bold/italic formatting
by pradeeppeddineni · 2026-01-29
69.6%
#20795: fix(markdown): prevent triple newlines after blockquotes
by novalis133 · 2026-02-19
69.5%