html2text
html2text copied to clipboard
A PHP component to convert HTML into a plain text format
# Input ```HTML ``` # Actual output ``` [obs-layout.png] ``` # Expected output ```  ``` Possible?
Often you just need the raw URL from an A tag. Added the parameter 'href' to the drop_links to return just the raw URL. Email clients like Gmail will correctly...
In your code you remove 'unnecessary empty lines': ```PHP // remove unnecessary empty lines $output = preg_replace("/\n\n\n*/im", "\n\n", $output); ``` This actually leads to the removal of intended empty lines...
 ``` >>> $html = 'ok' => "ok" >>> \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...
Hello, I've added new option "one_newline_tags". What do you think about this change? Sincerely Marcin Drazek
Hi there! ```PHP $html = ""; dd(\Soundasleep\Html2Text::convert($html)); ``` Produces `http://a.comhttp://b.com`, which produces incorrect HTML if placed through a markdown parser or auto link parser. I think the output should be...
Hello ! There is some code doing intentional removal of nodes when they are the last child of a node that also contained text. Here's a very simple example about...
Hi, When I call Html2Text::convert("``", ['drop_links' => true]); i got href instead empty I think result should be empty because i use option 'drop_links' => true
Parsing can be slow and sometimes we need the intermediate DOMDocument as well (to process links in code outside Html2Text, for instance). This PR restructures convert() so that it can...