MCPcopy
hub / github.com/mkdocs/mkdocs / test_nested_anchor

Method test_nested_anchor

mkdocs/tests/structure/toc_tests.py:132–153  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

130 self.assertEqual(len(toc), 2)
131
132 def test_nested_anchor(self):
133 md = dedent(
134 """
135 # Heading 1
136 ## Heading 2
137 # Heading 3
138 ### Heading 4
139 ### <a href="/">Heading 5</a>
140 """
141 )
142 expected = dedent(
143 """
144 Heading 1 - #heading-1
145 Heading 2 - #heading-2
146 Heading 3 - #heading-3
147 Heading 4 - #heading-4
148 Heading 5 - #heading-5
149 """
150 )
151 toc = get_toc(get_markdown_toc(md))
152 self.assertEqual(str(toc).strip(), expected)
153 self.assertEqual(len(toc), 2)
154
155 def test_entityref(self):
156 md = dedent(

Callers

nothing calls this directly

Calls 3

dedentFunction · 0.90
get_tocFunction · 0.90
get_markdown_tocFunction · 0.90

Tested by

no test coverage detected