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

in PDF, Body is empty with certain emails, because the function processStyleTags(html) breaks the </style> ending tag #18

Open
emmanueljarri opened this issue Dec 9, 2020 · 0 comments

Comments

@emmanueljarri
Copy link

emmanueljarri commented Dec 9, 2020

With some emails, when a style tag is present (ex : <style type="text/css">) the function processStyleTags(html)
would NOT catch and keep the end tag </style> in a group, and then would catch a position number and would replace the end tag </style> with the location number, thus breaking the HTML syntax, thus implying a blank body in the generated PDF.

This is the original regex , with the wrongfully "NO CATCH" instruction :

return html.replace(/(<style[^>]*>)(.*?)(?:<\/style>)/gi, function(m, tag, style, end) {

This is the one modified to DO CATCH the ending tag </style> so it's correctly stored in the "end" variable and then correctly put back at the end : (without the non capturing "?:" :

return html.replace(/(<style[^>]*>)(.*?)(<\/style>)/gi, function(m, tag, style, end) {

Now for me it does generate the PDF correctly for emails with <style> tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant