Skip to content

Commit eccd1f3

Browse files
committed
1 parent c7c7657 commit eccd1f3

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

src/HTML5/Elements.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Elements
8383
"area" => 9, // NORMAL | VOID_TAG
8484
"article" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
8585
"aside" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
86-
"audio" => 65, // NORMAL | BLOCK_TAG
86+
"audio" => 1, // NORMAL
8787
"b" => 1,
8888
"base" => 9, // NORMAL | VOID_TAG
8989
"bdi" => 1,

test/HTML5/ElementsTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ public function testIsA()
393393
'address',
394394
'article',
395395
'aside',
396-
'audio',
397396
'blockquote',
398397
'canvas',
399398
'dd',

test/HTML5/Parser/DOMTreeBuilderTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,4 +679,30 @@ public function testIgnoreSelfClosingTag() {
679679
$dom = $this->parse($html);
680680
$this->assertSame(1, $dom->getElementsByTagName('div')->item(0)->childNodes->length);
681681
}
682+
683+
public function testIAudioInParagraph() {
684+
$html = <<<EOM
685+
<!DOCTYPE html>
686+
<html>
687+
<head>
688+
<title>testIllegalSelfClosingTag</title>
689+
</head>
690+
<body>
691+
<p>
692+
<audio preload="none" controls="controls">
693+
<source src="https://example.com/test.mp3" type="audio/mpeg" />
694+
Your browser does not support the audio element.
695+
</audio>
696+
</p>
697+
</body>
698+
</html>>
699+
</html>
700+
EOM;
701+
702+
$dom = $this->parse($html);
703+
$audio = $dom->getElementsByTagName('audio')->item(0);
704+
705+
$this->assertSame('p', $audio->parentNode->nodeName);
706+
$this->assertSame(3, $audio->childNodes->length);
707+
}
682708
}

0 commit comments

Comments
 (0)