html2text icon indicating copy to clipboard operation
html2text copied to clipboard

A PHP component to convert HTML into a plain text format

Results 20 html2text issues
Sort by recently updated
recently updated
newest added

# Input ```HTML ``` # Actual output ``` [obs-layout.png] ``` # Expected output ``` ![obs-layout.png](cid:ii_l388tk2h0) ``` 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...

hacktoberfest

![Capture d’écran 2022-11-02 à 12 16 56](https://user-images.githubusercontent.com/1840026/199476845-cf541a72-e1fc-4db8-a80d-ed9aaf0b6bfa.png) ``` >>> $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...

hacktoberfest

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...