Open tennox opened 2 years ago
I think the issue (and #25) lies in this function's logic: https://github.com/mjmlio/vscode-mjml/blob/6417f0be61399da38750f2b007633975a6aeaf2f/src/helper.ts#L83
Issues I see:
<mj-style>
if it contains a <
or >
https://github.com/mjmlio/vscode-mjml/blob/6417f0be61399da38750f2b007633975a6aeaf2f/src/helper.ts#L86Possible workaround is using lazy / non-hungry matchers and ditch the [<>]
: <.*?style[^>]*?>(?:.+?)<.*?\/.*?style>
See demo
Parsing HTML via RegEx is known to break hell loose
Expected behavior
CSS inside
<mj-style>
can use<
and>
characters as expected, e.g.Actual behavior
>
or<
, the formatting breaks & does not indent (probably formats as text?)<
, additionally everything after that up to</mj-style>
is formatted in a single line<mj-style>
is replaced by<style>
(as in #25)Steps to reproduce the problem
MJML: Beautify
Code sample
Specifications
1.72.1
v1.0.5
Fedora Linux x64 5.19.14-300.fc37.x86_64
Other information
Managed to work around the issue using: