Skip to content

Commit b3feaf0

Browse files
authored
fix(editor): open xhtml files as HTML (#3152)
Co-authored-by: kaventro <301901286+kaventro@users.noreply.github.com>
1 parent f25b3b8 commit b3feaf0

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/cm/supportedModes.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ for (const lang of languages as readonly LanguageDescription[]) {
264264
filenames.push("Cargo.lock", "poetry.lock");
265265
} else if (normalizedName === "protobuf" || modeId === "protobuf") {
266266
langExtensions.push("pb");
267+
} else if (normalizedName === "html") {
268+
langExtensions.push("xhtml", "xht");
267269
}
268270

269271
const parts: string[] = [];

‎tests/unit/modelist.test.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ describe("getModeForPath", () => {
170170
expect(syntax).toContain("Table");
171171
});
172172

173+
it.each(["page.xhtml", "page.xht"])("opens %s as HTML", (path) => {
174+
expect(getModeForPath(path).name).toBe("html");
175+
});
176+
173177
it("matches the previous sort-and-scan result for built-in modes", () => {
174178
const paths = collectParityPaths();
175179
expect(paths.length).toBeGreaterThan(100);

0 commit comments

Comments
 (0)