utils.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:minimum-entropy 作者: DistrictDataLabs 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号