- self.text = self.text + "\n\n"
- self.currentparagraph = ""
- self.inparagraph = True
+ self.text = self.text + u'\n\n'
+ if self.inparagraph:
+ self.text = self.text \
+ + u'\n'.join(textwrap.wrap(self.currentparagraph, 70))
+ self.currentparagraph = u''
+ self.inparagraph = True
+ elif tag.lower() == "pre":
+ self.text = self.text + "\n"
+ self.inpre = True
+ self.inparagraph = False
+ self.inblockquote = False
+ elif tag.lower() == "ul":
+ self.item = u''
+ self.inul = True
+ self.text = self.text + "\n"
+ elif tag.lower() == "li" and self.inul:
+ if not self.initem:
+ self.initem = True
+ self.item = u''
+ else:
+ self.text = self.text \
+ + u' * ' \
+ + u'\n '.join([a.strip() for a in textwrap.wrap(self.item, 67)]) \
+ + u'\n'
+ self.item = u''