Skip to content

Commit

Permalink
remove leading and trailing \n for HtmlConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeyuTeng96 authored Jan 6, 2025
1 parent 05b78e7 commit 08a45fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/markitdown/_markitdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 08a45fa

Please sign in to comment.