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