Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark <video> tag as inline element #232

Merged
merged 1 commit into from
Apr 26, 2023

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.

None yet

2 participants