MCPcopy Index your code
hub / github.com/mkdocs/mkdocs / test_entityref

Method test_entityref

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

Source from the content-addressed store, hash-verified

153 self.assertEqual(len(toc), 2)
154
155 def test_entityref(self):
156 md = dedent(
157 """
158 # Heading & 1
159 ## Heading > 2
160 ### Heading < 3
161 """
162 )
163 expected = dedent(
164 """
165 Heading &amp; 1 - #heading-1
166 Heading &gt; 2 - #heading-2
167 Heading &lt; 3 - #heading-3
168 """
169 )
170 toc = get_toc(get_markdown_toc(md))
171 self.assertEqual(str(toc).strip(), expected)
172 self.assertEqual(len(toc), 1)
173
174 def test_charref(self):
175 md = '# &#64;Header'

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