html2text icon indicating copy to clipboard operation
html2text copied to clipboard

Links without text should be discarded

Open bilogic opened this issue 3 years ago • 0 comments

Hi there!

$html = "<a href='http://a.com'></a><a href='http://b.com'></a>";
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 one of the following, preferring the ones first mentioned

  1. [](http://a.com)[](http://b.com)
  2. Totally empty
  3. http://a.com http://b.com , additional space after each link

bilogic avatar May 14 '22 04:05 bilogic