question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add more options to control the HTML output

See original GitHub issue

Is your feature request related to a problem? Please describe. MJML strips self-closing tags of the final forward slash (example: <img /> becomes <img>), both in beautified and non-beautified HTML, and (if I’m not missing something) there’s no way to control this.

Describe the solution you’d like It would be nice to have an option to control this and other behaviors, such as an argument like --config.stripSlashes=false or something along those lines.

It would be super cool to have the option to specify the path of a configuration file, something like a .mjmlrc or mjml-config.json.

Describe alternatives you’ve considered Right now the only option is to manually modify the outputted HTML.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
nevneincommented, Feb 25, 2019

Thank you guys, it was indeed Juice’s fault, and juicePreserveTags did solve the issue. Here’s the config I’ve used, for the sake of completeness and in case anyone stumbles here: --config.juicePreserveTags='{"imgTag": { "start": "<img", "end": "/>" }, "brTag": { "start": "<br", "end": "/>" }}' Of course you can add as many self-closing tags as you like, contrary to my initial belief the styles will be inlined anyway, and this works even for img tags generated by mj-image.

Thank you again, keep up the good work ❤️

1reaction
kmcb777commented, Feb 25, 2019

Hi @nevnein the inlining is handled by the juice library.

Right now the only juice option that we expose is juicePreserveTags you can see an example in the cli documentation (but you can also use this option when using mjml as a node library) https://github.com/mjmlio/mjml/blob/next/packages/mjml-cli/README.md Maybe it can do the trick

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Output element - HTML: HyperText Markup Language
The HTML element is a container element into which a site or app can inject the results of a calculation or the outcome...
Read more >
HTML output Tag - W3Schools
Perform a calculation and show the result in an <output> element: ... The <output> tag is used to represent the result of a...
Read more >
Class HtmlOutput | Apps Script - Google Developers
append (addedContent), HtmlOutput, Appends new content to the content of ... X-Frame-Options header, which controls clickjacking prevention.
Read more >
3.1 HTML document | R Markdown: The Definitive Guide
We recommend that you read this full section before you learn other output formats, because other formats have several features in common with...
Read more >
HTML Options - Quarto
fontcolor. Sets the CSS color property. ; linkcolor. For HTML output, sets the CSS color property on all links. For LaTeX output, The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found