Merge branch 'main' into bytes-to-md
This commit is contained in:
commit
548273543a
2 changed files with 5 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ class RtfConverter(DocumentConverter):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def convert(self, local_path, **kwargs) -> Union[None, DocumentConverterResult]:
|
def convert(self, local_path, **kwargs) -> Union[None, DocumentConverterResult]:
|
||||||
# Bail if not a DOCX
|
# Bail if not a RTF
|
||||||
extension = kwargs.get("file_extension", "")
|
extension = kwargs.get("file_extension", "")
|
||||||
if extension.lower() != ".rtf":
|
if extension.lower() != ".rtf":
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ class _CustomMarkdownify(markdownify.MarkdownConverter):
|
||||||
prefix, suffix, text = markdownify.chomp(text) # type: ignore
|
prefix, suffix, text = markdownify.chomp(text) # type: ignore
|
||||||
if not text:
|
if not text:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
if el.find_parent("pre") is not None:
|
||||||
|
return text
|
||||||
|
|
||||||
href = el.get("href")
|
href = el.get("href")
|
||||||
title = el.get("title")
|
title = el.get("title")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue