mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-22 11:51:17 +01:00
Handle unclosed br XML tags
This commit is contained in:
parent
1c7ce62802
commit
604ff7171c
@ -23,6 +23,7 @@ final class DOMEntities
|
||||
public function __construct(string $html)
|
||||
{
|
||||
$dom = new \DOMDocument();
|
||||
$html = \preg_replace("/\<br(\s*)?\/?\>/i", "\n", $html);
|
||||
$dom->loadxml("<body>" . \str_replace(['&', ''', '"', '&'], ['&', '\'', "\"", '&'], \trim($html)) . "</body>");
|
||||
$this->parseNode($dom->getElementsByTagName('body')->item(0), 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user