Skip to content

Conversation

@HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Apr 26, 2023

The <video> tag is incorrectly marked as a block element, while it's actually an inline one according to MDN.

This causes the following problem:

use Masterminds\HTML5;

$html5 = new HTML5();
$dom = $html5->loadHTMLFragment('<p>Test: <video><source src="/path/to/video.mp4" /></video></p>');
echo $html5->saveHTML($dom);

Result:

<p>Test: </p><video><source src="/path/to/video.mp4"></video>

Even though having a <video> tag inside a <p> tag is valid HTML, it gets moved outside the <p> tag.

@goetas
Copy link
Member

goetas commented Apr 26, 2023

thank you

@HypeMC HypeMC deleted the video-is-inline branch April 26, 2023 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants