Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublime chooses MJML syntax when doing HTML #13

Closed
jwb96 opened this issue Jun 27, 2019 · 0 comments · Fixed by #15
Closed

Sublime chooses MJML syntax when doing HTML #13

jwb96 opened this issue Jun 27, 2019 · 0 comments · Fixed by #15

Comments

@jwb96
Copy link

jwb96 commented Jun 27, 2019

Since installing mjml-syntax, sublime text chooses MJML in the syntax menu when I paste HTML into a blank/new file. Cannot find documentation on how to fix.

ExplodingCabbage added a commit to ExplodingCabbage/mjml-syntax that referenced this issue Feb 16, 2022
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 mjmlio#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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant