0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

🐛 Fixed bookmark card author/publisher spacing in member emails (#12134)

closes #12078

- Root cause was that pseudo class .kg-bookmark-author:after was not getting inlined to email newsletter or its preview.
  - That is where the margin and bullet-point content are added between author and publisher.
- Dependency juice supports an option inlinePseudoElements which is false by default.
- Fix was to set inlinePseudoElements to true when serializing post email.

Co-authored-by: Jeremy Davidson <jeremy@crossingcontour.com>
This commit is contained in:
Jeremy Davidson 2020-08-18 08:18:44 -07:00 committed by GitHub
parent 9f291b2d10
commit 681c96b5e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,7 +132,9 @@ const serialize = async (postModel, options = {isBrowserPreview: false}) => {
htmlTemplate = htmlTemplate.replace('%recipient.unsubscribe_url%', previewUnsubscribeUrl);
}
let juicedHtml = juice(htmlTemplate);
// Inline css to style attributes, turn on support for pseudo classes.
const juiceOptions = {inlinePseudoElements: true};
let juicedHtml = juice(htmlTemplate, juiceOptions);
// Force all links to open in new tab
let _cheerio = cheerio.load(juicedHtml);