html2text icon indicating copy to clipboard operation
html2text copied to clipboard

Unusual line break inside link when converting table

Open randomnoob opened this issue 7 years ago • 3 comments

I got some unusual line breaks inside links when converting tables

Input

raw = """<td align="center" width="211">
      <img alt="Algerian chorba with bird tongues 4" class="alignnone size-thumbnail wp-image-48225" height="150" src="https://www.amourdecuisine.fr/wp-content/uploads/2016/06/chorba-alg%C3%A9rienne-aux-langues-doiseaux-4-150x150.jpg" width="150"/>
      <a href="https://www.amourdecuisine.fr/article-chorba-algerienne-aux-langues-doiseaux.html" target="_blank">
       <strong>
        chorba bird languages
       </strong>
      </a>
     </td>"""

Output with line breaks in hyperlink

'![Algerian chorba with bird tongues 4](https://www.amourdecuisine.fr/wp-\ncontent/uploads/2016/06/chorba-alg%C3%A9rienne-aux-langues-\ndoiseaux-4-150x150.jpg) [ **chorba bird languages**\n](https://www.amourdecuisine.fr/article-chorba-algerienne-aux-langues-\ndoiseaux.html)\n\n'

html2text 2018.1.9 Python 3.6

randomnoob avatar May 23 '18 10:05 randomnoob

Is this solved?

otsab19 avatar Jun 15 '18 08:06 otsab19

I'm seeing this as well. The markdown tables are not rendered correctly.

macropin avatar Mar 14 '19 22:03 macropin

you could solve it by setting the value of text_maker.body_width, eg:text_maker.body_width = 2000

PowersYang avatar Oct 31 '19 06:10 PowersYang