test_html5lib.py 文件源码

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

项目:sack 作者: jofpin 项目源码 文件源码
def test_document_ends_with_incomplete_declaration(self):
        soup = self.soup('<p>a<!b')
        # This becomes a string 'a'. The incomplete declaration is ignored.
        # Compare html5lib, which turns it into a comment.
        s, comment = soup.p.contents
        self.assertEqual(s, 'a')
        self.assertTrue(isinstance(comment, Comment))
        self.assertEqual(comment, 'b')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号