diff --git a/html2text/__init__.py b/html2text/__init__.py index 1a3c8e6..cf759d9 100644 --- a/html2text/__init__.py +++ b/html2text/__init__.py @@ -855,13 +855,13 @@ def o( self.outcount += 1 def handle_data(self, data: str, entity_char: bool = False) -> None: + data = data.strip() if not data: # Data may be empty for some HTML entities. For example, # LEFT-TO-RIGHT MARK. return if self.stressed: - data = data.strip() self.stressed = False self.preceding_stressed = True elif self.preceding_stressed: