You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @sitepark-veltrup , about using jsoup: unfortunately, as mjml is a mix of xml/html, you can't really use a standard html parser: I did extend my own one with a series of custom hacks for handling some non intuitive cases:
My initial goal was to have a swappable html parser, but from some initial testing, it was not really possible as the parsed html was not generating the same DOM structure (you need some special handling for "tr/td" elements outside of tables and also for custom self closing elements).
If there is enough interest, what I'll most likely do is implement a subset of the css selector rules (the most common ones).
My html parser already has a Java api for selectors, I would "only" need to do a "css rules" string to java api conversion.
If you have some css rules that you consider to use / you are using in your templates, it would be nice if you could share them so I can understand how much effort I would need for covering your case.
thanks for the quick feedback.
First of all, that's great that you have created a pure Java implementation for MJML.
I am still evaluating to what extent this could be used productively for us and don't have any concrete cases yet. The limitation just caught my eye and I wondered if there might be a way forward in the future.
I'll be happy to get back to you if I have any cases.
The README says:
Could it be supported by using a different HTML parser?
Jsoup also supports CSS selectors. See Use CSS selectors to find elements
The text was updated successfully, but these errors were encountered: