rss_feeds.py 文件源码

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

项目:audio-feeder 作者: pganssle 项目源码 文件源码
def wrap_field(field):
    """
    Given a field, detect if it has special characters <, > or & and if so
    wrap it in a CDATA field.
    """
    if not isinstance(field, str):
        return field

    if html_chars.search(field):
        return '<![CDATA[' + field + ']]>'
    else:
        # If there's already escaped data like &amp;, I want to unescape it
        # first, so I can re-escape *everything*
        field = saxutils.unescape(field)

        return saxutils.escape(field)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号