Alir3z4 / Alir3z4/html2text

proposal - default bodywidth to `None`

Đang mở
#265 0 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ả

`bodywidth` is currently specified in an init argument, defaulting to `config.BODY_WIDTH`.

https://github.com/Alir3z4/html2text/blob/master/html2text/__init__.py#L43

A problem with this approach: the `__init__` function creates the default value for bodywidth when it is interpreted. changing the value of `config.BODY_WIDTH`after importing html2text will have no effect.

I propose the following:

1. change the init value `bodywidth=None`
2. change the following line:

```
- self.body_width = bodywidth # covered in cli
+ self.body_width = bodywidth if bodywidth is not None else config.BODY_WIDTH # covered in cli
```

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.