We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5944f1 commit e33858dCopy full SHA for e33858d
‎src/Document.php‎
@@ -74,7 +74,8 @@ public function html(): string
74
// Remove XML declaration/comment that libxml2 may add
75
// Handles both <?xml encoding="UTF-8"> and any comments libxml2 adds
76
$html = preg_replace('/^<\?xml[^>]*>\s*/i', '', $html);
77
- $html = preg_replace('/^<!--[^>]*-->\s*/', '', $html);
+ // Use non-greedy match to handle comments containing > characters
78
+ $html = preg_replace('/^<!--.*?-->\s*/s', '', $html);
79
80
return trim($html);
81
}
0 commit comments