html2text icon indicating copy to clipboard operation
html2text copied to clipboard

markdown link was truncated because the limit of BODY_WIDTH 78

Open Yuelioi opened this issue 3 years ago • 0 comments

today, i try it to convert html to md,but img url is not right

in the __init__.py , optwrap function

# line 918
wrapped = wrap(
  para,
  self.body_width,
  break_long_words=False,
  subsequent_indent=indent,
)

this will limit url to 78, maybe we change it to ( like this ? ):

if (para.startswith("![]")):
  wrapped = wrap(
      para,
      999,
      break_long_words=False,
      subsequent_indent=indent,
  )
else:
  wrapped = wrap(
      para,
      self.body_width,
      break_long_words=False,
      subsequent_indent=indent,
  )

Yuelioi avatar Aug 31 '22 09:08 Yuelioi