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

Undefined, Unknown tag. Better output? fail safely ? #50

Open
japrogramer opened this issue Jun 13, 2020 · 6 comments
Open

Undefined, Unknown tag. Better output? fail safely ? #50

japrogramer opened this issue Jun 13, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@japrogramer
Copy link

Hello I found this repo in reddit and have glanced at the source code.
I've tried the wasm example to quickly go thru a few templates.

While trying to render this template https://mjml.io/try-it-live/templates/austin
the output becomes 'undefined' which I know means that it has found a tag that mrml
does not recognize but the error is not very user friendly.

I'm new to mjml and have no idea which tags are valid so I don't know how to begin to debug this. Could there be a way to ignore unknown tags and continue rendering the known tags? maybe by ignoring all the child xml nodes.

More verbose output could also be helpful.

@jdrouet
Copy link
Owner

jdrouet commented Jun 14, 2020

Thank you for the feedback, I'll take a look at it!

@jdrouet jdrouet self-assigned this Jun 14, 2020
@jdrouet
Copy link
Owner

jdrouet commented Jun 14, 2020

Several things:

  • <mj-style inline="inline"> is not yet implemented
  • <mj-attributes> is not yet implemented

I'm working on it, it's in progress ;)

@jdrouet jdrouet added enhancement New feature or request good first issue Good for newcomers labels Jun 16, 2020
@devnacho
Copy link

is not yet implemented

Hi @jdrouet

Thanks for creating this library. I see that there's an issue for mj-attributes that is marked as done. Has this been released?

@jdrouet
Copy link
Owner

jdrouet commented Oct 3, 2020

@devnacho The mj-attributes bug should be fixed, but <mj-style inline="inline"> are not yet implemented.

@zachzurn
Copy link

zachzurn commented May 13, 2021

The (much slower) node cli has an option to provide a validation method when compiling templates.

Adding a validation option for the render subcommand seems like it would be useful for production use where we would want to render the template even if there was an erroneous tag/attribute in the markup.

Possible validation options:
strict: (default) fails/throws on any validation failure
warnings: possibly injects comments <!-- Invalid tag on like 45 column 15 --> right below the <head> tag for validation errors but renders without failing
silent: renders without any validation notices

@jdrouet
Copy link
Owner

jdrouet commented May 13, 2021

The latest refactoring of mrml has been made with that purpose. That's probably the next big thing I want to tackle.
But the error messages should already be improved.

jdrouet pushed a commit that referenced this issue Jul 23, 2023
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.153 to 1.0.154.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.153...v1.0.154)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants