soundasleep / html2text

A PHP component to convert HTML into a plain text format
MIT License
475 stars 135 forks source link

error for correct url with multiple get params #99

Open maximepvrt opened 2 years ago

maximepvrt commented 2 years ago

Capture d’écran 2022-11-02 à 12 16 56

>>> $html = '<a href="https://www.google.com?utm_source=croix&utm_campaign=croix">ok</a>'
=> "<a href="https://www.google.com?utm_source=croix&utm_campaign=croix">ok</a>"

>>> \Soundasleep\Html2Text::convert($html);
PHP Warning:  DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 1 in /Users/maxime/Repos/benevolt-app/vendor/soundasleep/html2text/src/Html2Text.php on line 171
=> "[ok](https://www.google.com?utm_source=croix&utm_campaign=croix)"

>>> $html = '<a href="https://www.google.com?utm_source=croix">ok</a>'
=> "<a href="https://www.google.com?utm_source=croix">ok</a>"

>>> \Soundasleep\Html2Text::convert($html);
=> "[ok](https://www.google.com?utm_source=croix)"