_native.py 文件源码

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

项目:flask_system 作者: prashasy 项目源码 文件源码
def escape(s):
    """Convert the characters &, <, >, ' and " in string s to HTML-safe
    sequences.  Use this if you need to display text that might contain
    such characters in HTML.  Marks return value as markup string.
    """
    if hasattr(s, '__html__'):
        return s.__html__()
    return Markup(text_type(s)
        .replace('&', '&amp;')
        .replace('>', '&gt;')
        .replace('<', '&lt;')
        .replace("'", '&#39;')
        .replace('"', '&#34;')
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号