Skip to content

Disable compressHTML: it ate spaces at inline-tag boundaries - #35

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
claude/awesome-zhukovsky-fe07ea
Jul 29, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
claude/awesome-zhukovsky-fe07ea

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

What

One-line config change: compressHTML: false in astro.config.mjs.

Why

Astro's default HTML compression removes the newline+indent when a line break sits adjacent to an inline tag, so source like lives in\n <a …>catalog.json</a> rendered as "lives incatalog.json" with no space. #34 fixed the instances in the copy it touched by keeping the boundary space on the tag's line, but a grep of the built output shows the artifact is everywhere:

  • the footer on all 10 pages (site:pegma-dev/pegma.dev, Agents:install skill)
  • index.html: "events.Storage Core"
  • examples.html: "lives incatalog.json", "fixturesource" (×3 recipes)
  • skill.html: ~8 joins ("markdown:https://…", "and,catalog.json", …)
  • stack.html, roadmap.html, staff/support.html, staff/support/ticket.html: assorted word<code> joins

Why config instead of a source sweep

Note for after #34 merges: the comment it adds in Base.astro about keeping boundary whitespace on one line becomes moot (harmless, but can be dropped).

Verification

  • Rebuilt and re-grepped dist/*.html for text<a/text<code>/</a>text-style joins: zero matches (was ~35).
  • Spot-checked previously broken boundaries — newline+indent now preserved, which browsers collapse to a single space.
  • npm run check clean (astro check + both tsc projects).

🤖 Generated with Claude Code

Astro's default compressHTML removes the newline+indent when a line
break sits next to an inline tag, so source like
"lives in\n  <a …>catalog.json</a>" rendered as "lives incatalog.json".
A build-output grep found the joined-word artifact on every page:
the footer on all 10 pages, plus index ("events.Storage Core"),
examples ("fixturesource"), skill, stack, roadmap, and staff pages.

Turning compression off fixes the class instead of policing every
line break next to an <a>/<code>/<strong>. Cost is negligible once
Cloudflare compresses the response: 27.3 KB -> 28.9 KB gzipped
across all 10 pages (raw 80.4 KB -> 99.5 KB).

Verified: rebuilt and re-grepped dist/ for text<tag and tag>text
joins (zero matches); npm run check is clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 29, 2026 19:35
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Grok Grok Build Review — no issues

Review complete. No issues found — the changes look solid.

This change correctly disables Astro HTML compression to eliminate a documented class of whitespace bugs at inline-element boundaries. The configuration is applied at the right layer, the failure mode is accurately described, and the residual transfer-size cost is acceptable given edge compression. No correctness, security, or maintainability issues are present in this diff.

Reviewed commit eedf206 · workflow run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Disables Astro’s HTML minification to prevent whitespace loss at text↔inline-tag boundaries, which has been causing visible word-joins across multiple pages in the built site.

Changes:

  • Set compressHTML: false in astro.config.mjs to stop Astro from collapsing boundary whitespace.
  • Added an explanatory comment describing the rendering artifact this avoids.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread astro.config.mjs Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@FlyOverCoderKY
FlyOverCoderKY merged commit 55fa7b4 into main Jul 29, 2026
2 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/awesome-zhukovsky-fe07ea branch July 29, 2026 19:49
FlyOverCoderKY added a commit that referenced this pull request Jul 29, 2026
* Disable compressHTML: it ate spaces at inline-tag boundaries

Astro's default compressHTML removes the newline+indent when a line
break sits next to an inline tag, so source like
"lives in\n  <a …>catalog.json</a>" rendered as "lives incatalog.json".
A build-output grep found the joined-word artifact on every page:
the footer on all 10 pages, plus index ("events.Storage Core"),
examples ("fixturesource"), skill, stack, roadmap, and staff pages.

Turning compression off fixes the class instead of policing every
line break next to an <a>/<code>/<strong>. Cost is negligible once
Cloudflare compresses the response: 27.3 KB -> 28.9 KB gzipped
across all 10 pages (raw 80.4 KB -> 99.5 KB).

Verified: rebuilt and re-grepped dist/ for text<tag and tag>text
joins (zero matches); npm run check is clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Drop stale compressHTML comment in Base.astro footer

The rule it stated — keep boundary whitespace on the tag's line —
stopped applying when #35 disabled compressHTML; the constraint now
lives as a comment in astro.config.mjs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants