Skip to content

Commit 706dda7

Browse files
committed
Added support for ivopetkov/html5-dom-document-php v2.0.
1 parent 721d732 commit 706dda7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"require": {
1515
"php": ">=7.0.0",
16-
"ivopetkov/html5-dom-document-php": "~1.1"
16+
"ivopetkov/html5-dom-document-php": "2.*"
1717
},
1818
"require-dev": {
1919
"phpunit/phpunit": "6.*",

src/HTMLServerComponentsCompiler.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
namespace IvoPetkov;
1111

12+
use IvoPetkov\HTML5DOMDocument;
13+
1214
/**
1315
* HTML Server Components compiler. Converts components code into HTML code.
1416
*/
@@ -139,14 +141,14 @@ public function process($content, array $options = [])
139141
};
140142

141143
$disableLevelProcessing = false;
142-
$domDocument = new \IvoPetkov\HTML5DOMDocument();
144+
$domDocument = new HTML5DOMDocument();
143145
if ($content instanceof \IvoPetkov\HTMLServerComponent) {
144-
$domDocument->loadHTML($getComponentResultHTML($content));
146+
$domDocument->loadHTML($getComponentResultHTML($content), HTML5DOMDocument::ALLOW_DUPLICATE_IDS);
145147
if (isset($options['recursive']) && $options['recursive'] === false) {
146148
$disableLevelProcessing = true;
147149
}
148150
} else {
149-
$domDocument->loadHTML($content);
151+
$domDocument->loadHTML($content, HTML5DOMDocument::ALLOW_DUPLICATE_IDS);
150152
}
151153
if (!$disableLevelProcessing) {
152154
$tagsQuerySelector = implode(',', $tagNames);

0 commit comments

Comments
 (0)