Alir3z4 / Alir3z4/html2text

Unexpected backslash

Đang mở
#347 3 bình luận 0 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ả

Hi!

- Version by `html2text --version`: 2020.1.16
- Test script: ` + direction`
- Python version `python --version` `Python 3.9.0`

Given ` + direction`, html2text give an unexpected backslash:
```
$ cat html
+ direction
$ html2text html
![](/bar.png) \+ direction
```

This is due to ` + direction` received by `handle_data`, it's given to `escape_md_section`, which escapes the `+` to avoid it being interpreted as a unordered list item if I understand correctly. But here, the `+`, not being at the beginning of the line can't be interpreted as a list (or can it? ¹) so I think it should not be escaped, what do you think?

In fact there's cases where a list can be interepreted as so while not being sticked to the beginning of the line, for example in a quote:

> - a quoted
> - unordered
> - list

But - Here
its - not
a - list
no - need to escape

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.