Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mypy reports ignore_anchors isn't an attribute #415

Open
PanderMusubi opened this issue May 8, 2024 · 1 comment
Open

Mypy reports ignore_anchors isn't an attribute #415

PanderMusubi opened this issue May 8, 2024 · 1 comment

Comments

@PanderMusubi
Copy link

Mypy reports this error:

mypy a.py 
a.py:3: error: "HTML2Text" has no attribute "ignore_anchors"  [attr-defined]
Found 1 error in 1 file (checked 1 source file)

Version by html2text --version 2024.2.26

Python version python --version Python 3.10.12

Test script a.py

from html2text import HTML2Text
a = HTML2Text()
a.ignore_anchors = True
a.ignore_images = True
a.ignore_emphasis = True
a.ignore_tables = True
@genevieve-me
Copy link

I have a similar question about decode_errors. I initialize html2text = html2text.HTML2Text() and set some options html2text.single_line_break = True; html2text.decode_errors = "replace". However, looking at cli.py, it seems that unlike other options, decode_errors can only be passed as an arg, not set in this way?

html = data.decode(args.encoding, args.decode_errors)

I would like to make use of this option even though I'm not running html2text from the CLI, so please let me know if I'm misunderstanding and how I can set it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants