Skip to content

fix(markdown-satteri): preserve fence languages with raw HTML - #17946

Merged
Princesseuh merged 1 commit into
withastro:mainfrom
odysseus0:codex/fix-satteri-fence-language
Sep 18, 2026
Merged

Princesseuh merged 1 commit into
withastro:mainfrom
odysseus0:codex/fix-satteri-fence-language

Conversation

@odysseus0

Copy link
Copy Markdown
Contributor

Changes

Fix fenced code highlighting when Sätteri's rawHtml feature is enabled. The HTML round trip drops internal data.lang metadata but preserves the language-* code class. Use that class as a fallback while keeping data.lang authoritative, so a TypeScript fence is highlighted as TypeScript instead of plaintext.

Includes a patch changeset for @astrojs/markdown-satteri.

Testing

Added a regression test through the real processor with raw HTML both enabled and disabled. The enabled case fails before this fix; all 22 package tests pass afterward. Package build, TypeScript project build, scoped Biome checks, changeset formatting, and git diff --check pass.

Docs

No documentation change needed; this restores the existing fenced-code behavior without changing configuration or APIs.

@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee16609

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the feat: markdown Related to Markdown (scope) label Sep 8, 2026
@ematipico

Copy link
Copy Markdown
Member

Please file a bug report first.

@matthewp

Copy link
Copy Markdown
Contributor

@Princesseuh what do you think?

@Princesseuh Princesseuh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great! I wonder if down the line this is something that should work differently in Sätteri itself, but this fix is fine.

@Princesseuh
Princesseuh merged commit 3fd16ee into withastro:main Sep 18, 2026
23 of 24 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: markdown Related to Markdown (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants