You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Incorrect file paths being logged when trying to validate .mjml files via glob
To Reproduce
Steps to reproduce the behavior:
Create a index.mjml file in a nested directory (./foo/bar/baz/index.mjml):
<%# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. %><mj-section><mj-column><mj-textcss-class="text-header"><spandata-l10n-id="verifyLoginCode-title">Is this you signing up?</span></mj-text></mj-column></mj-section><%- include('/partials/location/index.mjml') %><mj-section><mj-column><mj-textcss-class="text-body"><spandata-l10n-id="verifyLoginCode-prompt">
If yes, use this verification code in your registration form:
</span></mj-text><mj-textcss-class="code-large"><%- code %></mj-text><mj-textcss-class="text-body-no-margin"><spandata-l10n-id="verifyLoginCode-expiry-notice">It expires in 5 minutes.</span></mj-text></mj-column></mj-section><%- include('/partials/automatedEmailChangePassword/index.mjml') %>
pwd# /tmp/mjml-validate-test
tree foo/
foo/
└── bar/
└── baz/
└── index.mjml
## OR
find foo -type f # foo/bar/baz/index.mjml
Now, if I run npx mjml --validate "foo/**/*.mjml" in my root directory (/tmp/mjml-validate-test), I get the following validation errors:
Line 1 of /private/tmp/mjml-validate-test/foo/bar/baz/foo/bar/baz/index.mjml (%#) — Element %# doesn't exist or is not registered
Line 13 of /private/tmp/mjml-validate-test/foo/bar/baz/foo/bar/baz/index.mjml (%-) — Element %- doesn't exist or is not registered
Line 31 of /private/tmp/mjml-validate-test/foo/bar/baz/foo/bar/baz/index.mjml (%-) — Element %- doesn't exist or is not registered
Command line error:
Validation failed
Unfortunately, I don't know enough about mjml yet to know if <%- include('/partials/location/index.mjml') %> syntax is valid or if we're doing some pre/post processing internally, but that seems to explain these validator errors:
(%#) — Element %# doesn't exist or is not registered
(%-) — Element %- doesn't exist or is not registered
(%-) — Element %- doesn't exist or is not registered
<%- include('/partials/location/index.mjml') %> is not a MJML include (it's weird that the regexp does grab them tho)
cc @kmcb777 can you check if we didn't broke something while updating the watch ?
Describe the bug
Incorrect file paths being logged when trying to validate .mjml files via glob
To Reproduce
Steps to reproduce the behavior:
Create a index.mjml file in a nested directory (./foo/bar/baz/index.mjml):
Now, if I run npx mjml --validate "foo/**/*.mjml" in my root directory (/tmp/mjml-validate-test), I get the following validation errors:
Expected behavior
Actual behavior
Note how the "/foo/bar/baz/" file path part seems to be duplicated.
MJML environment (please complete the following information):
Email sending environment(for rendering issues):
Affected email clients (for rendering issues):
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: