mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1416916 - Syntax highlight .es# files r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D34191 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
4840805457
commit
c42d65aba2
@ -367,9 +367,9 @@ export function getMode(
|
||||
}
|
||||
}
|
||||
|
||||
// if the url ends with .marko we set the name to Javascript so
|
||||
// syntax highlighting works for marko too
|
||||
if (url && url.match(/\.marko$/i)) {
|
||||
// if the url ends with .marko or .es6 we set the name to Javascript so
|
||||
// syntax highlighting works for these file extensions too
|
||||
if (url && url.match(/\.marko|\.es6$/i)) {
|
||||
return { name: "javascript" };
|
||||
}
|
||||
|
||||
|
@ -461,6 +461,16 @@ describe("sources", () => {
|
||||
);
|
||||
expect(getMode(source, content)).toEqual({ name: "javascript" });
|
||||
});
|
||||
|
||||
it("es6", () => {
|
||||
const { source, content } = makeMockSourceAndContent(
|
||||
"http://localhost.com:7999/increment/sometestfile.es6",
|
||||
undefined,
|
||||
"does not matter",
|
||||
"function foo(){}"
|
||||
);
|
||||
expect(getMode(source, content)).toEqual({ name: "javascript" });
|
||||
});
|
||||
});
|
||||
|
||||
describe("getSourceLineCount", () => {
|
||||
|
Loading…
Reference in New Issue
Block a user