feat: add mjml extension to html language (#5505)

master
Laurin Quast 2018-12-07 14:01:40 +01:00 committed by Ika
parent cd28c22dbe
commit 9d1fb93e86
6 changed files with 99 additions and 1 deletions

View File

@ -21,6 +21,11 @@ const languages = [
since: "1.15.0",
parsers: ["html"],
vscodeLanguageIds: ["html"]
},
extend: {
extensions: [
".mjml" // MJML is considered XML in Linguist but it should be formatted as HTML
]
}
}),
createLanguage(require("linguist-languages/data/vue"), {

View File

@ -0,0 +1,65 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`empty.mjml 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
| printWidth
=====================================input======================================
<mjml></mjml>
=====================================output=====================================
<mjml></mjml>
================================================================================
`;
exports[`head.mjml 1`] = `
====================================options=====================================
parsers: ["html"]
printWidth: 80
| printWidth
=====================================input======================================
<mjml>
<mj-head>
<mj-title>
The green fix eats mango.
</mj-title>
<mj-breakpoint width="600px" />
<mj-preview>Do
you like cheese? We do!</mj-preview>
<mj-attributes>
<mj-text
align="left" color="#000"
font-family="-apple-system,BlinkMacSystemFont,Helvetica,sans-serif" />
</mj-attributes>
</mj-head>
</mjml>
=====================================output=====================================
<mjml>
<mj-head>
<mj-title> The green fix eats mango. </mj-title>
<mj-breakpoint width="600px" />
<mj-preview>Do you like cheese? We do!</mj-preview>
<mj-attributes>
<mj-text
align="left"
color="#000"
font-family="-apple-system,BlinkMacSystemFont,Helvetica,sans-serif"
/>
</mj-attributes>
</mj-head>
</mjml>
================================================================================
`;

View File

@ -0,0 +1 @@
<mjml></mjml>

25
tests/html_mjml/head.mjml Normal file
View File

@ -0,0 +1,25 @@
<mjml>
<mj-head>
<mj-title>
The green fix eats mango.
</mj-title>
<mj-breakpoint width="600px" />
<mj-preview>Do
you like cheese? We do!</mj-preview>
<mj-attributes>
<mj-text
align="left" color="#000"
font-family="-apple-system,BlinkMacSystemFont,Helvetica,sans-serif" />
</mj-attributes>
</mj-head>
</mjml>

View File

@ -0,0 +1 @@
run_spec(__dirname, ["html"]);

View File

@ -906,7 +906,8 @@ exports[`CLI --support-info (stdout) 1`] = `
\\".inc\\",
\\".st\\",
\\".xht\\",
\\".xhtml\\"
\\".xhtml\\",
\\".mjml\\"
],
\\"linguistLanguageId\\": 146,
\\"name\\": \\"HTML\\",