def preview(self):
"""Returns the first sentence of the post, with HTML tags
stripped, for use as a preview blurb."""
body_text = striptags(' '.join([
child.value.source for child in self.body
if child.block_type == 'rich_text'
]))
sentences = body_text.split('.')
return '.'.join(sentences[:1]) + '.'
评论列表
文章目录