def collapse_and_strip_tags(text: str) -> str:
'''
Strips HTML tags and collapases newlines in the given string.
Example:
>>> collapse_and_strip_tags('\\n\\n<p>hi james</p>\\n\\n\\n')
'\\nhi james\\n'
'''
return re.sub(r'\n+', '\n', strip_tags(text))
评论列表
文章目录