diff --git a/pixelocr/formatting.py b/pixelocr/formatting.py index 8c4c36e..07dd454 100644 --- a/pixelocr/formatting.py +++ b/pixelocr/formatting.py @@ -39,7 +39,7 @@ class OutputFormat(object): def fix_spaces(self, tagged_text): for tag, text in tagged_text: stripped_text = text.rstrip() - if len(stripped_text) < len(text): + if stripped_text and len(stripped_text) < len(text): traling_whitespace = text[len(stripped_text):] yield tag, stripped_text yield None, traling_whitespace