From a4fee1c01c5653d6a88911d83c8071cf5670cef9 Mon Sep 17 00:00:00 2001 From: Mark Amery Date: Wed, 16 Feb 2022 15:19:51 +0000 Subject: [PATCH] Fix pasted HTML being detected as MJML Currently, the plugin's `.tmLanguage` contains a `firstLineMatch` expression that matches any `` tag, `` tag, or `` 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 `` tags, not tags associated with other languages. Resolves https://github.com/mjmlio/mjml-syntax/issues/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: ``` test test ``` and ``` ``` 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). --- MJML.tmLanguage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MJML.tmLanguage b/MJML.tmLanguage index af3396f..6aa7319 100644 --- a/MJML.tmLanguage +++ b/MJML.tmLanguage @@ -7,7 +7,7 @@ mjml firstLineMatch - <!(?i:DOCTYPE)|<(?i:mjml)|<\?(?i:php) + <(?i:mjml) foldingStartMarker (?x) (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)\b.*?>