Alir3z4 / Alir3z4/html2text

Non-int margin value in html style attributes

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

Hi,

I got a value error(**ValueError: invalid literal for int() with base 10: 'au'**) while reading style string for a html tag. The attribute was margin-left and its value was auto instead of an integer/float.

```
Traceback (most recent call last):
File "C:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\minton\dashboard\views.py", line 98, in post
pages_count, html_files = comparePDFHTMLV2(INPUT_FILES)
File "C:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\minton\dashboard\file_compare\pdfhtmlcompare.py", line 306, in comparePDFHTMLV2
html_parser.parseV2(htmlPath)
File "C:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\minton\dashboard\file_compare\parser.py", line 78, in parseV2
htmlModel = structure_model(htmlPath)
File "C:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\minton\dashboard\file_compare\html_model_creation.py", line 342, in structure_model text_tagged = tagContent(content, Flag=True)
File "C:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\minton\dashboard\file_compare\html_model_creation.py", line 100, in tagContent
return H2T.handle(content)
File "c:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\virtual-env\lib\site-packages\html2text\__init__.py", line 142, in handle
self.feed(data)
File "c:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\virtual-env\lib\site-packages\html2text\__init__.py", line 139, in feed
super().feed(data)
File "C:\Users\keshav.bohra\AppData\Local\Programs\Python\Python37\lib\html\parser.py", line 111, in feed
self.goahead(0)
File "C:\Users\keshav.bohra\AppData\Local\Programs\Python\Python37\lib\html\parser.py", line 171, in goahead
k = self.parse_starttag(i)
File "C:\Users\keshav.bohra\AppData\Local\Programs\Python\Python37\lib\html\parser.py", line 345, in parse_starttag
self.handle_starttag(tag, attrs)
File "c:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\virtual-env\lib\site-packages\html2text\__init__.py", line 191, in handle_starttag
self.handle_tag(tag, dict(attrs), start=True)
File "c:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\virtual-env\lib\site-packages\html2text\__init__.py", line 598, in handle_tag
nest_count = self.google_nest_count(tag_style)
File "c:\Users\keshav.bohra\PycharmProjects\git\content-comparison-advisor\virtual-env\lib\site-packages\html2text\__init__.py", line 877, in google_nest_count
nest_count = int(style["margin-left"][:-2]) // self.google_list_indent
ValueError: invalid literal for int() with base 10: 'au'
```

- Version by `2020.1.16`
- Python version `3.7.5`

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.