Skip to content

Commit a4fee1c

Browse files
Fix pasted HTML being detected as MJML
Currently, the plugin's `.tmLanguage` contains a `firstLineMatch` expression that matches any `<!doctype ...>` tag, `<mjml>` tag, or `<!php` tag. This doesn't make much sense, since MJML documents start with an `<mjml>` tag, and caused pasting a HTML document into a new file in Sublime to automatically enable the MJML syntax highlighting instead of the HTML syntax highlighting. This change fixes the regex so that it will only match `<mjml>` tags, not tags associated with other languages. Resolves #13 To test this, I cloned the package to my local Packages folder (i.e. the alternate installation flow described in this package's docs) and tried pasting the following snippets of code into new tabs in Sublime: ``` <!doctype html> test test ``` and ``` <?php echo "test test" ``` and ``` <mjml> <mj-body> </mj-body> </mjml> ``` Before I made this change, pasting either the HTML snippet or the MJML snippets caused Sublime to select MJML syntax highlighting. After I made this change, all three snippets trigger the correct syntax highlighting (i.e. HTML, PHP, and MJML respectively).
1 parent fd2a8c4 commit a4fee1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MJML.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<string>mjml</string>
88
</array>
99
<key>firstLineMatch</key>
10-
<string>&lt;!(?i:DOCTYPE)|&lt;(?i:mjml)|&lt;\?(?i:php)</string>
10+
<string>&lt;(?i:mjml)</string>
1111
<key>foldingStartMarker</key>
1212
<string>(?x)
1313
(&lt;(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)\b.*?&gt;

0 commit comments

Comments
 (0)