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')
评论列表
文章目录