mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Fixed missing amp-youtube properties (#15880)
fixes: https://github.com/TryGhost/Ghost/issues/15878 - Fix `amp-youtube` component, add mandatory `width` and `height` properties. Also change the `layout` property to `responsive`, so that the width adapts to mobile devices. --- Error log: `The mandatory attribute 'height' is missing in tag 'amp-youtube'.` Documentation `amp-youtube`: https://amp.dev/documentation/components/amp-youtube
This commit is contained in:
parent
68d3faf77c
commit
64329d716e
1 changed files with 5 additions and 1 deletions
|
@ -108,7 +108,7 @@ allowedAMPAttributes = {
|
|||
'amp-audio': ['src', 'width', 'height', 'autoplay', 'loop', 'muted', 'controls'],
|
||||
'amp-iframe': ['src', 'srcdoc', 'width', 'height', 'layout', 'frameborder', 'allowfullscreen', 'allowtransparency',
|
||||
'sandbox', 'referrerpolicy'],
|
||||
'amp-youtube': ['src', 'layout', 'frameborder', 'autoplay', 'loop', 'data-videoid', 'data-live-channelid']
|
||||
'amp-youtube': ['src', 'layout', 'frameborder', 'autoplay', 'loop', 'data-videoid', 'data-live-channelid', 'width', 'height']
|
||||
};
|
||||
|
||||
function getAmperizeHTML(html, post) {
|
||||
|
@ -193,6 +193,10 @@ module.exports = async function amp_content() { // eslint-disable-line camelcase
|
|||
$('audio').children('source').remove();
|
||||
$('audio').children('track').remove();
|
||||
|
||||
$('amp-youtube').attr('layout', 'responsive');
|
||||
$('amp-youtube').attr('height', '350');
|
||||
$('amp-youtube').attr('width', '600');
|
||||
|
||||
ampHTML = $.html();
|
||||
|
||||
// @TODO: remove this, when Amperize supports HTML sanitizing
|
||||
|
|
Loading…
Add table
Reference in a new issue