Fixed formatting.

This commit is contained in:
Adam Fourney
2024-12-17 15:27:06 -08:00
parent a571021199
commit 8d5f16ecd2
2 changed files with 25 additions and 17 deletions

View File

@@ -222,6 +222,7 @@ class HtmlConverter(DocumentConverter):
text_content=webpage_text,
)
class RSSConverter(DocumentConverter):
"""Convert RSS / Atom type to markdown"""
@@ -253,7 +254,9 @@ class RSSConverter(DocumentConverter):
return result
def _parse_atom_type(self, doc: minidom.Document) -> Union[None, DocumentConverterResult]:
def _parse_atom_type(
self, doc: minidom.Document
) -> Union[None, DocumentConverterResult]:
"""Parse the type of an Atom feed.
Returns None if the feed type is not recognized or something goes wrong.
@@ -288,7 +291,9 @@ class RSSConverter(DocumentConverter):
except BaseException as _:
return None
def _parse_rss_type(self, doc: minidom.Document) -> Union[None, DocumentConverterResult]:
def _parse_rss_type(
self, doc: minidom.Document
) -> Union[None, DocumentConverterResult]:
"""Parse the type of an RSS feed.
Returns None if the feed type is not recognized or something goes wrong.
@@ -340,7 +345,9 @@ class RSSConverter(DocumentConverter):
except BaseException as _:
return content
def _get_data_by_tag_name(self, element: minidom.Element, tag_name: str) -> Union[str, None]:
def _get_data_by_tag_name(
self, element: minidom.Element, tag_name: str
) -> Union[str, None]:
"""Get data from first child element with the given tag name.
Returns None when no such element is found.
"""
@@ -352,6 +359,7 @@ class RSSConverter(DocumentConverter):
return fc.data
return None
class WikipediaConverter(DocumentConverter):
"""Handle Wikipedia pages separately, focusing only on the main document content."""