Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _clean_emphasis_tags(self, text):
- touchups = [[re.compile(r'<i>\xa0'), ' <i>'],
- [re.compile(r'\xa0</i>'), '</i> '],
- [re.compile(r'<b>\xa0'), ' <b>'],
- [re.compile(r'\xa0</b>'), '</b> ']]
- touched_up = text
- for touchup in touchups:
- touched_up = touchup[0].sub(touchup[1], touched_up)
- return touched_up
- def _html_to_markdown(self, text, as_body=False, upload_images=True):
- text = _clean_emphasis_tags(text)
- if as_body:
- text = self.body_parser.parse(text, upload_images=upload_images)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement