Skip to content

fix(editor): open xhtml files as HTML - #3152

Open
og-orca wants to merge 1 commit into
Acode-Foundation:mainfrom
og-orca:xhtml-mode
Open

og-orca wants to merge 1 commit into
Acode-Foundation:mainfrom
og-orca:xhtml-mode

Conversation

@og-orca

@og-orca og-orca commented Dec 3, 2026 •

Copy link
Copy Markdown

Fixes #3150

.xhtml files opened as plain text. The HTML mode takes its extensions from @codemirror/language-data, which lists html and htm there and has xhtml only as an alias, so no mode claimed the file. I added xhtml and xht to the HTML mode, next to the other extra extensions.

before and after

The picture is the editor with the mode that getModeForPath("page.xhtml") returns, in a desktop browser. I did not run it on a phone.

  • The new test in modelist.test.js fails on main and passes here.
  • I compared the mode of every known extension with main, 252 in total. Only these two changed.
  • npm test with NODE_OPTIONS=--no-experimental-webstorage, because I have Node 25: 1367 of 1369 pass and one is skipped. The alpineNative test about V8 flags fails on main too.
  • biome ci on the changed files and npm run typecheck pass.

@greptile-apps

greptile-apps Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The change appears safe to merge.

Summary

Adds .xhtml and .xht to the HTML mode so these files no longer fall back to plain text.

  • XHTML files now open with HTML mode.

Reviews (1) · Last reviewed commit: "fix(editor): open xhtml files as HTML" · Reviewed by Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Bug] XHTML files dont't get the html syntax highlighter

1 participant