Skip to content

Commit

Permalink
Fix width and height attributes in video tags (Fix #1875)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Jul 29, 2019
1 parent 03658fa commit fbde20e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
12 changes: 7 additions & 5 deletions config/tags.php
Expand Up @@ -106,7 +106,7 @@
if (empty($tag->link) === true) {
return $img;
}

if ($link = $tag->file($tag->link)) {
$link = $link->url();
} else {
Expand Down Expand Up @@ -227,13 +227,15 @@
'html' => function ($tag) {
$video = Html::video(
$tag->value,
$tag->kirby()->option('kirbytext.video.options', [])
$tag->kirby()->option('kirbytext.video.options', []),
[
'height' => $tag->height ?? $tag->kirby()->option('kirbytext.video.height'),
'width' => $tag->width ?? $tag->kirby()->option('kirbytext.video.width'),
]
);

return Html::figure([$video], $tag->caption, [
'class' => $tag->class ?? $tag->kirby()->option('kirbytext.video.class', 'video'),
'height' => $tag->height ?? $tag->kirby()->option('kirbytext.video.height'),
'width' => $tag->width ?? $tag->kirby()->option('kirbytext.video.width'),
'class' => $tag->class ?? $tag->kirby()->option('kirbytext.video.class', 'video'),
]);
}
],
Expand Down
@@ -0,0 +1 @@
<figure class="video"><iframe allowfullscreen height="200" src="https://player.vimeo.com/video/115805751" width="200"></iframe></figure>
@@ -0,0 +1 @@
(video: https://vimeo.com/115805751 width: 200 height: 200)

0 comments on commit fbde20e

Please sign in to comment.