0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixed EmailRenderer stripping inline width tags from images (#18587)

no issue

- product card outputs the original width/height of the image in emails
which results in overflown images in Outlook
- Combined with https://github.com/TryGhost/Koenig/pull/983/files, this
change fixes rendering for product card images in Outlook

---------

Co-authored-by: Sodbileg Gansukh <sodbileg.gansukh@gmail.com>
This commit is contained in:
Chris Raible 2023-11-01 15:05:39 -07:00 committed by GitHub
parent fb34e285fc
commit 0c972d8276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View file

@ -370,8 +370,8 @@ class EmailRenderer {
// Juice HTML (inline CSS)
const juice = require('juice');
juice.heightElements = ['TABLE', 'TD', 'TH'];
juice.widthElements = ['TABLE', 'TD', 'TH'];
juice.heightElements = ['TABLE', 'TD', 'TH', 'IMG'];
juice.widthElements = ['TABLE', 'TD', 'TH', 'IMG'];
html = juice(html, {inlinePseudoElements: true, removeStyleTags: true});
// happens after inlining of CSS so we can change element types without worrying about styling

View file

@ -637,8 +637,7 @@ a[data-flickr-embed] img {
.kg-image-card img {
display: block;
margin: 0 auto;
width: auto;
height: auto !important;
height: auto;
}
.kg-bookmark-container {

View file

@ -685,8 +685,8 @@ a[data-flickr-embed] img {
.kg-image-card img {
display: block;
margin: 0 auto;
width: auto;
height: auto !important;
/* width: auto;
height: auto !important; */
}
.kg-bookmark-container {