Skip to content

Commit

Permalink
Fix: Video loosing aspect when editing source code
Browse files Browse the repository at this point in the history
  • Loading branch information
awcodes committed Nov 17, 2023
1 parent 39dbf62 commit 2539562
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Extensions/Nodes/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ public function addAttributes(): array
return str_contains($DOMNode->getAttribute('class'), 'responsive') ?? false;
},
],
'data-aspect-width' => [
'default' => null,
'parseHTML' => function ($DOMNode) {
return $DOMNode->firstChild->getAttribute('data-aspect-width');
}
],
'data-aspect-height' => [
'default' => null,
'parseHTML' => function ($DOMNode) {
return $DOMNode->firstChild->getAttribute('data-aspect-height');
}
]
];
}

Expand Down
12 changes: 12 additions & 0 deletions src/Extensions/Nodes/YouTube.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ public function addAttributes(): array
return str_contains($DOMNode->getAttribute('class'), 'responsive') ?? false;
},
],
'data-aspect-width' => [
'default' => null,
'parseHTML' => function ($DOMNode) {
return $DOMNode->firstChild->getAttribute('data-aspect-width');
}
],
'data-aspect-height' => [
'default' => null,
'parseHTML' => function ($DOMNode) {
return $DOMNode->firstChild->getAttribute('data-aspect-height');
}
]
];
}

Expand Down

0 comments on commit 2539562

Please sign in to comment.