python-markdownify icon indicating copy to clipboard operation
python-markdownify copied to clipboard

TypeError is shown if html has wrong h tag

Open vokiput opened this issue 1 year ago • 0 comments

markdownify in ./.venv/lib/python3.8/site-packages (0.13.1)

The issue is found with atheris library

Code to reproduce markdownify("<hn>")

The error is:

Traceback (most recent call last):
  File "/home/redacted/code/other/atheris/pythonProject/test_unit_009-1.py", line 26, in <module>
    markdownify("<hn>")
  File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 433, in markdownify
    return MarkdownConverter(**options).convert(html)
  File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 105, in convert
    return self.convert_soup(soup)
  File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 108, in convert_soup
    return self.process_tag(soup, convert_as_inline=False, children_only=True)
  File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 151, in process_tag
    text += self.process_tag(el, convert_children_as_inline)
  File "/home/redacted/code/other/atheris/pythonProject/.venv/lib/python3.8/site-packages/markdownify/__init__.py", line 156, in process_tag
    text = convert_fn(node, text, convert_as_inline)
TypeError: convert_hn() missing 1 required positional argument: 'convert_as_inline'

vokiput avatar Aug 26 '24 19:08 vokiput