Ghost/ghost/core/test/unit/server/services
Simon Backx 4534b693e4
Added test that validates output HTML of email template (#15365)
refs https://github.com/TryGhost/Team/issues/1871

This commit adds a test to the serialize method of `post-emaiserializer`. It checks whether the generated email HTML is valid and standard HTML5 and that all properties are escaped.

To do this validation, I depend on the new `html-validate` dev dependency. Just parsing the HTML with a HTML parser is not enough to guarantee that the HTML is okay.

Apart from that this fixes:
- Removed the sanitizeHTML method and replaced it with normal HTML escaping. We don't want to allow any HTML in the escaped fields. Whereas `sanitizeHTML` still allows valid HTML, but we don't want that and want the same behaviour as on the site. E.g., a post with a title `All your need to know about the <br /> tag` should actually render the same title and non-html content, being `All your need to know about the &lt;br /&gt; tag`
- The file, nft and audio card didn't (always) escape the injected HTML fields (new version @tryghost/kg-default-cards) 
- `@tryghost/string` is bumped because it contains the new escapeHtml method
2022-09-08 10:11:01 +02:00
..
adapter-manager Added JSDoc to adapter options resolver 2022-09-06 17:51:57 +08:00
api-version-compatibility Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
auth Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
frontend-data-service Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
mail Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
mega Added test that validates output HTML of email template (#15365) 2022-09-08 10:11:01 +02:00
members Reset magic link rate limiting upon successful login (#15345) 2022-09-01 08:54:14 -04:00
newsletters Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
notifications Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
permissions Deleted concept of external user 2022-08-11 16:05:00 +02:00
posts Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
redirects Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
route-settings Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
settings Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
settings-helpers 🐛 Fixed sending emails from email domain that includes www subdomain (#15348) 2022-09-02 16:57:59 +02:00
stripe 🐛 Fixed sending emails from email domain that includes www subdomain (#15348) 2022-09-02 16:57:59 +02:00
themes Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
url Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
users Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
webhooks Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
labs.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
limits.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
nft-oembed.test.js 🐛 Fixed OpenSea NFT OEmbeds (#15372) 2022-09-06 11:29:35 -04:00
slack.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
xmlrpc.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00