Skip to content

MRML validate #8

@autonomous

Description

@autonomous

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions