Alir3z4 / Alir3z4/html2text

Line breaks in links even when setting protect_links = true

Đang mở
#425 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
2.2k
Fork
296
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả


Html2text version: 2024.2.26
Python version: 3.11.12

```python
import html2text

h2t = html2text.HTML2Text()
h2t.protect_links = True
markdown = h2t.handle(html)
```

According to the [documentation](https://github.com/Alir3z4/html2text/blob/8917f5c83d8cf013110124a6b37331b2c29a0fff/docs/usage.md?plain=1#L71), this should protect URLs from line breaks, but it does not. It only places angle brackets around the URLs, which is not helpful. Currently the only way to truly avoid line breaks in links is to either use reference-style links, or set `body_width` to `0`, both of which make ugly markdown documents. It would be better if `protect_links` would allow links to extend beyond the body width, as the documentation implies.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.