This repository was archived by the owner on Sep 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
This repository was archived by the owner on Sep 25, 2018. It is now read-only.
Double encoding of entities. #6
Copy link
Copy link
Open
Labels
Description
When an string with HTML entities like is loaded, the returned document has these ampersands encoded again to   breaking the original HTML.
$payload = <<< 'HTML'
<html lang="en">
<head>
<meta charset="utf-8">
<title>
Hello world!
</title>
</head>
<body>
<h1>
Hello world!
</h1>
</body>
</html>
HTML;
$doc = \Layershifter\Gumbo\Parser::load($payload);
var_dump($doc->saveHTML());Output:
string(162) "<html lang="en"><head><meta charset="utf-8"><title>
Hello&nbsp;world!
</title></head><body><h1>
Hello&nbsp;world!
</h1></body></html>
"