allow BeautifulSoup objects to be converted

This commit is contained in:
AlexVonB
2022-01-23 11:00:19 +01:00
parent 9d0b839b73
commit 0a1343a538
3 changed files with 22 additions and 0 deletions

View File

@@ -96,6 +96,9 @@ class MarkdownConverter(object):
def convert(self, html):
soup = BeautifulSoup(html, 'html.parser')
return self.convert_soup(soup)
def convert_soup(self, soup):
return self.process_tag(soup, convert_as_inline=False, children_only=True)
def process_tag(self, node, convert_as_inline, children_only=False):