test_html5lib.py 文件源码

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

项目:sack 作者: jofpin 项目源码 文件源码
def test_incomplete_declaration(self):
        # An incomplete declaration is treated as a comment.
        markup = 'a<!b <p>c'
        self.assertSoupEquals(markup, "a<!--b <p-->c")

        # Let's spell that out a little more explicitly.
        soup = self.soup(markup)
        str1, comment, str2 = soup.body.contents
        self.assertEqual(str1, 'a')
        self.assertEqual(comment.__class__, Comment)
        self.assertEqual(comment, 'b <p')
        self.assertEqual(str2, 'c')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号