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

MRML validate #8

Open
autonomous opened this issue Dec 28, 2023 · 1 comment
Open

MRML validate #8

autonomous opened this issue Dec 28, 2023 · 1 comment

Comments

@autonomous
Copy link

Is your feature request related to a problem? Please describe.
When building mjml templates errors sometime sneak in. The templates are often large/complex, and a debugging what the root cause of the error is is difficult.

Describe the solution you'd like
I'd like to pass a template string to a MRML validate method, and it returns a collection of the errors it has encountered. An output similar to what mjml-cli -v produces would be amazing:

$ mjml -v malformed.mjml
Line 8 of test.mjml (b) — Element b doesn't exist or is not registered

Command line error:
Validation failed

... for example:

errors = MRML.validate("...")
[
  "Line 8 (b) - Element b doesn't exist or is not registered",
  ...
]

Is this something you'd be open to?

@jonian
Copy link
Member

jonian commented Jan 9, 2024

Hi @autonomous, thanks for the report. The mrml rust library does not provide a validate method. You can open an issue there and if it gets implemented I will add it to mrml-ruby.

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

No branches or pull requests

2 participants