mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 Fixed HTML escaping of feature_image_caption in newsletters
no issue feature_image_caption was escaped in the new email stability flow, while that should not happen (bold/underline/...).
This commit is contained in:
parent
8a8bd60d1c
commit
b50e3915ea
2 changed files with 15 additions and 1 deletions
|
@ -743,5 +743,19 @@ describe('Batch sending tests', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('HTML-content', function () {
|
||||
it('Does not HTML escape feature_image_caption', async function () {
|
||||
const {html, plaintext} = await sendEmail({
|
||||
feature_image: 'https://example.com/image.jpg',
|
||||
feature_image_caption: 'Testing <b>feature image caption</b>'
|
||||
});
|
||||
// Check html contains text without escaping
|
||||
assert.match(html, /Testing <b>feature image caption<\/b>/);
|
||||
|
||||
// Check plaintext version dropped the bold tag
|
||||
assert.match(plaintext, /Testing feature image caption/);
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: Replacement fallbacks
|
||||
});
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
</tr>
|
||||
{{#if post.feature_image_caption }}
|
||||
<tr>
|
||||
<td class="feature-image-caption" align="center">{{post.feature_image_caption}}</td>
|
||||
<td class="feature-image-caption" align="center">{{{post.feature_image_caption}}}</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
Loading…
Add table
Reference in a new issue