- isallwhitespace = data.strip()
- if isallwhitespace != "" and self.text[-1] == "\n":
- self.text = self.text + unicode(data, "utf-8").strip() + u' '
+ isallwhitespace = data.strip() == ""
+ if not isallwhitespace:
+ self.text = self.text + unicode(data, "utf-8").strip() + u' '