With some emails, when a style tag is present (ex : in a group, and then would catch a position number and would replace the end tag 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 :
This is the one modified to DO CATCH the ending tag so it's correctly stored in the "end" variable and then correctly put back at the end : (without the non capturing "?:" :
With some emails, when a style tag is present (ex : in a group, and then would catch a position number and would replace the end tag 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 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