def htmlize(text):
"""
This helper method renders Markdown then uses Bleach to sanitize it as
well as convert all links to actual links.
"""
text = bleach.clean(text, strip=True) # Clean the text by stripping bad HTML tags
text = markdown(text) # Convert the markdown to HTML
text = bleach.linkify(text) # Add links from the text and add nofollow to existing links
return text
# Compile regular expression functions for query normalization
评论列表
文章目录