diff --git a/src/cm/supportedModes.ts b/src/cm/supportedModes.ts index f16746a74..23b51840e 100644 --- a/src/cm/supportedModes.ts +++ b/src/cm/supportedModes.ts @@ -264,6 +264,8 @@ for (const lang of languages as readonly LanguageDescription[]) { filenames.push("Cargo.lock", "poetry.lock"); } else if (normalizedName === "protobuf" || modeId === "protobuf") { langExtensions.push("pb"); + } else if (normalizedName === "html") { + langExtensions.push("xhtml", "xht"); } const parts: string[] = []; diff --git a/tests/unit/modelist.test.js b/tests/unit/modelist.test.js index 612dacfcb..bfa85cda3 100644 --- a/tests/unit/modelist.test.js +++ b/tests/unit/modelist.test.js @@ -170,6 +170,10 @@ describe("getModeForPath", () => { expect(syntax).toContain("Table"); }); + it.each(["page.xhtml", "page.xht"])("opens %s as HTML", (path) => { + expect(getModeForPath(path).name).toBe("html"); + }); + it("matches the previous sort-and-scan result for built-in modes", () => { const paths = collectParityPaths(); expect(paths.length).toBeGreaterThan(100);