🐛 Fixed sending newsletters with counter-reset CSS styles in custom HTML (#17194)

fixes https://github.com/TryGhost/Team/issues/2937

Bumps juice to 9.1.0:
- Support for 'auto' width and height attributes
- Fixed a bug with counter-reset styles
- Dependencies updates
This commit is contained in:
Simon Backx 2023-07-04 10:18:16 +02:00 committed by GitHub
parent 1cc55eda2e
commit 1b33634495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 15 deletions

View File

@ -197,7 +197,7 @@
"jsdom": "22.1.0",
"jsonpath": "1.1.1",
"jsonwebtoken": "8.5.1",
"juice": "8.1.0",
"juice": "9.1.0",
"keypair": "1.0.4",
"knex": "2.4.2",
"knex-migrator": "5.1.5",

View File

@ -4080,7 +4080,7 @@ table.body figcaption a {
<tr>
<td dir=\\"ltr\\" width=\\"100%\\" style=\\"font-family: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;; font-size: 18px; vertical-align: top; color: #000000; background-color: #ffffff; text-align: center; padding: 32px 0 24px; border-bottom: 1px solid #e5eff5; border-bottom: 1px solid rgba(0, 0, 0, 0.12);\\" align=\\"center\\" bgcolor=\\"#ffffff\\" valign=\\"top\\">
<table class=\\"feedback-buttons\\" role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; margin: auto; width: auto; max-width: 600px;\\">
<table class=\\"feedback-buttons\\" role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; margin: auto; width: auto; max-width: 600px;\\" width=\\"auto\\">
<tr>
<td dir=\\"ltr\\" valign=\\"top\\" align=\\"center\\" style=\\"color: #000000; display: inline-block; vertical-align: top; font-family: inherit; font-size: 14px; text-align: center; padding: 0 4px 4px; cursor: pointer;\\" nowrap>
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-4/#/feedback/post-id/1/?uuid=member-uuid\\" target=\\"_blank\\" style=\\"color: #FF1A75; text-decoration: none; overflow-wrap: anywhere;\\">
@ -4790,7 +4790,7 @@ table.body figcaption a {
<tr>
<td dir=\\"ltr\\" width=\\"100%\\" style=\\"font-family: -apple-system, BlinkMacSystemFont, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;; font-size: 18px; vertical-align: top; color: #000000; background-color: #ffffff; text-align: center; padding: 32px 0 24px; border-bottom: 1px solid #e5eff5; border-bottom: 1px solid rgba(0, 0, 0, 0.12);\\" align=\\"center\\" bgcolor=\\"#ffffff\\" valign=\\"top\\">
<table class=\\"feedback-buttons\\" role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; margin: auto; width: auto; max-width: 600px;\\">
<table class=\\"feedback-buttons\\" role=\\"presentation\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" style=\\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; margin: auto; width: auto; max-width: 600px;\\" width=\\"auto\\">
<tr>
<td dir=\\"ltr\\" valign=\\"top\\" align=\\"center\\" style=\\"color: #000000; display: inline-block; vertical-align: top; font-family: inherit; font-size: 14px; text-align: center; padding: 0 4px 4px; cursor: pointer;\\" nowrap>
<a href=\\"http://127.0.0.1:2369/this-is-a-test-post-title-3/#ghost-comments\\" target=\\"_blank\\" style=\\"color: #FF1A75; text-decoration: none; overflow-wrap: anywhere;\\">

View File

@ -783,17 +783,19 @@ describe('Batch sending tests', function () {
assert(defaultNewsletter.get('show_comment_cta'), 'show_comment_cta should be true for this test');
await models.Newsletter.edit({feedback_enabled: true}, {id: defaultNewsletter.id});
const {html} = await sendEmail(agent, {
title: 'This is a test post title',
mobiledoc: mobileDocExample
});
try {
const {html} = await sendEmail(agent, {
title: 'This is a test post title',
mobiledoc: mobileDocExample
});
// Currently the link is not present in plaintext version (because no text)
assert.equal(html.match(/#ghost-comments/g).length, 3, 'Every email should have 3 buttons to comments');
await matchEmailSnapshot();
// undo
await models.Newsletter.edit({feedback_enabled: false}, {id: defaultNewsletter.id});
// Currently the link is not present in plaintext version (because no text)
assert.equal(html.match(/#ghost-comments/g).length, 3, 'Every email should have 3 buttons to comments');
await matchEmailSnapshot();
} finally {
// undo
await models.Newsletter.edit({feedback_enabled: false}, {id: defaultNewsletter.id});
}
});
it('Hides comments button for email only posts', async function () {

View File

@ -36,7 +36,7 @@
"bson-objectid": "2.0.4",
"cheerio": "0.22.0",
"handlebars": "4.7.7",
"juice": "8.1.0",
"juice": "9.1.0",
"moment-timezone": "0.5.23"
}
}

View File

@ -22101,7 +22101,18 @@ jsprim@^1.2.2:
array-includes "^3.1.5"
object.assign "^4.1.3"
juice@8.1.0, juice@^8.0.0:
juice@9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/juice/-/juice-9.1.0.tgz#3ef8a12392d44c1cd996022aa977581049a65050"
integrity sha512-odblShmPrUoHUwRuC8EmLji5bPP2MLO1GL+gt4XU3tT2ECmbSrrMjtMQaqg3wgMFP2zvUzdPZGfxc5Trk3Z+fQ==
dependencies:
cheerio "^1.0.0-rc.12"
commander "^6.1.0"
mensch "^0.3.4"
slick "^1.12.2"
web-resource-inliner "^6.0.1"
juice@^8.0.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/juice/-/juice-8.1.0.tgz#4ea23362522fe06418229943237ee3751a4fca70"
integrity sha512-FLzurJrx5Iv1e7CfBSZH68dC04EEvXvvVvPYB7Vx1WAuhCp1ZPIMtqxc+WTWxVkpTIC2Ach/GAv0rQbtGf6YMA==