jdrouet / mrml

Implementation of mjml in rust
MIT License
317 stars 18 forks source link

Mjml validation #364

Open autonomous opened 5 months ago

autonomous commented 5 months ago

When building mjml templates errors sometime sneak in. The templates are often large/complex, and debugging the root cause can be difficult.

I'd like to pass a template string to a MRML validate method, and have 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

Is this something you'd be open to?

jdrouet commented 5 months ago

Yeah, the error handling is something I should focus on soon 😉