yourtempo / tempo-email-parser

MIT License
132 stars 14 forks source link

Broken HTML, even without modifying anything #24

Closed Soreine closed 4 years ago

Soreine commented 4 years ago

I'm still investigating the different issues with an "Order Confirmation" email. And I found that just passing it through cheerio, in and out, is enough to break it somehow.

Screenshots, before and after going through Cheerio@0.22.0 ![image](https://user-images.githubusercontent.com/5644953/72549857-c97c4780-3891-11ea-9aab-0c39393b2d59.png) --- ![image](https://user-images.githubusercontent.com/5644953/72549902-e0229e80-3891-11ea-846c-91e09f96e280.png)

The code I wrote uses cheerio@0.22.0, the same version than TalonJS, which uses htmlparser2 to parse the HTML. I tried upgrading cheerio@1.0.0-rc3 and it no longer breaks the HTML. It is still in beta, but uses parse5 instead of htmlparser2. parse5 seems stricter than htmlparser2.

I need to adapt the code though, because Cheerio's behavior changed.