@@ -146,11 +146,11 @@ def test_multiline_links() -> None:
146146
147147
148148def test_no_reference_with_space () -> None :
149- """Check that references with spaces are not fixed."""
149+ """Check that references with spaces are fixed."""
150150 run_references_test (
151- url_map = {"Foo bar" : "foo.html#Foo bar" },
151+ url_map = {"Foo bar" : "foo.html#bar" },
152152 source = "This [Foo bar][]." ,
153- output = " <p>This [ Foo bar][] .</p>" ,
153+ output = ' <p>This <a class="autorefs autorefs-internal" href="foo.html#bar"> Foo bar</a> .</p>' ,
154154 )
155155
156156
@@ -203,12 +203,17 @@ def test_missing_reference_with_markdown_implicit() -> None:
203203 )
204204
205205
206- def test_ignore_reference_with_special_char () -> None :
207- """Check that references are not considered if there is a space character inside ."""
206+ def test_reference_with_markup () -> None :
207+ """Check that references with markup are resolved (and need escaping to prevent rendering) ."""
208208 run_references_test (
209- url_map = {"a b" : "foo.html#Foo" },
209+ url_map = {"* a b* " : "foo.html#Foo" },
210210 source = "This [*a b*][]." ,
211- output = "<p>This [<em>a b</em>][].</p>" ,
211+ output = '<p>This <a class="autorefs autorefs-internal" href="foo.html#Foo"><em>a b</em></a>.</p>' ,
212+ )
213+ run_references_test (
214+ url_map = {"*a/b*" : "foo.html#Foo" },
215+ source = "This [`*a/b*`][]." ,
216+ output = '<p>This <a class="autorefs autorefs-internal" href="foo.html#Foo"><code>*a/b*</code></a>.</p>' ,
212217 )
213218
214219
0 commit comments