test_qqhtml.py 文件源码

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

项目:qqmbr 作者: ischurov 项目源码 文件源码
def test_refs_with_separator(self):
        doc = r"""\chapter Hello \label sec:first

\chapter World \label sec:other

See
\ref[section][sec:first] and \ref[section][sec:other] for details.
"""
        parser = QqParser()
        formatter = QqHTMLFormatter()
        parser.allowed_tags.update(formatter.uses_tags())
        tree = parser.parse(doc)
        formatter.root = tree
        print(tree.as_list())
        html = formatter.do_format()
        soup = BeautifulSoup(html, "html.parser")
        self.assertEqual(soup("a")[2].contents[0], "section 1")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号