Merge branch 'main' into bytes-to-md

This commit is contained in:
Nishith Jain 2025-02-12 00:22:55 +05:30 committed by GitHub
commit 548273543a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -23,7 +23,7 @@ class RtfConverter(DocumentConverter):
"""
def convert(self, local_path, **kwargs) -> Union[None, DocumentConverterResult]:
# Bail if not a DOCX
# Bail if not a RTF
extension = kwargs.get("file_extension", "")
if extension.lower() != ".rtf":
return None

View file

@ -33,6 +33,10 @@ class _CustomMarkdownify(markdownify.MarkdownConverter):
prefix, suffix, text = markdownify.chomp(text) # type: ignore
if not text:
return ""
if el.find_parent("pre") is not None:
return text
href = el.get("href")
title = el.get("title")