mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
Merged v5.12.4 into main
v5.12.4
This commit is contained in:
commit
dd2bfb8c0e
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ghost-admin",
|
||||
"version": "5.12.3",
|
||||
"version": "5.12.4",
|
||||
"description": "Ember.js admin client for Ghost",
|
||||
"author": "Ghost Foundation",
|
||||
"homepage": "http://ghost.org",
|
||||
|
@ -28,9 +28,10 @@ const sanitizeKeys = (obj, keys) => {
|
||||
module.exports = ({post, site, newsletter, templateSettings}) => {
|
||||
const date = new Date();
|
||||
const hasFeatureImageCaption = templateSettings.showFeatureImage && post.feature_image && post.feature_image_caption;
|
||||
const cleanPost = sanitizeKeys(post, ['title', 'excerpt', 'html', 'feature_image_alt', 'feature_image_caption']);
|
||||
const cleanPost = sanitizeKeys(post, ['title', 'excerpt', 'authors', 'feature_image_alt', 'feature_image_caption']);
|
||||
const cleanSite = sanitizeKeys(site, ['title']);
|
||||
const cleanNewsletter = sanitizeKeys(newsletter, ['name']);
|
||||
|
||||
return `<!doctype html>
|
||||
<html>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ghost",
|
||||
"version": "5.12.3",
|
||||
"version": "5.12.4",
|
||||
"description": "The professional publishing platform",
|
||||
"author": "Ghost Foundation",
|
||||
"homepage": "https://ghost.org",
|
||||
|
@ -120,9 +120,11 @@ describe('Mega template', function () {
|
||||
});
|
||||
|
||||
it('Correctly escapes the contents', function () {
|
||||
// TODO: check html escaping based on mobiledoc instead of invalid html: https://github.com/TryGhost/Team/issues/1871
|
||||
|
||||
const post = {
|
||||
title: 'I <3 Posts',
|
||||
html: '<div class="post-content-html">I am <100 years old</div>',
|
||||
html: '<div class="post-content-html">I am <100 years old</div>',
|
||||
feature_image: 'https://example.com/image.jpg',
|
||||
feature_image_alt: 'I <3 alt text',
|
||||
feature_image_caption: 'I <3 images'
|
||||
@ -196,7 +198,7 @@ describe('Mega template', function () {
|
||||
|
||||
should(html).containEql('class="custom"');
|
||||
// note that some part of rendering/sanitisation removes spaces from the style description
|
||||
should(html).containEql('style="font-weight:900;display:flex"');
|
||||
should(html).containEql('style="font-weight: 900; display: flex;"');
|
||||
});
|
||||
|
||||
it('Uses the post title as a fallback for the excerpt', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user