html.py 文件源码

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

项目:ome-model 作者: ome 项目源码 文件源码
def is_safe_elem(self, tag, attrs):
        """Determine whether the given element should be considered safe for
        inclusion in the output.

        :param tag: the tag name of the element
        :type tag: QName
        :param attrs: the element attributes
        :type attrs: Attrs
        :return: whether the element should be considered safe
        :rtype: bool
        :since: version 0.6
        """
        if tag not in self.safe_tags:
            return False
        if tag.localname == 'input':
            input_type = attrs.get('type', '').lower()
            if input_type == 'password':
                return False
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号