diff --git a/src/markitdown/_markitdown.py b/src/markitdown/_markitdown.py index b6acfe8..3ce0a0b 100644 --- a/src/markitdown/_markitdown.py +++ b/src/markitdown/_markitdown.py @@ -223,6 +223,9 @@ def _convert(self, html_content: str) -> Union[None, DocumentConverterResult]: assert isinstance(webpage_text, str) + # remove leading and trailing \n + webpage_text = webpage_text.strip() + return DocumentConverterResult( title=None if soup.title is None else soup.title.string, text_content=webpage_text,