@@ -146,11 +146,11 @@ def test_multiline_links() -> None:
146
146
147
147
148
148
def test_no_reference_with_space () -> None :
149
- """Check that references with spaces are not fixed."""
149
+ """Check that references with spaces are fixed."""
150
150
run_references_test (
151
- url_map = {"Foo bar" : "foo.html#Foo bar" },
151
+ url_map = {"Foo bar" : "foo.html#bar" },
152
152
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>' ,
154
154
)
155
155
156
156
@@ -203,12 +203,17 @@ def test_missing_reference_with_markdown_implicit() -> None:
203
203
)
204
204
205
205
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) ."""
208
208
run_references_test (
209
- url_map = {"a b" : "foo.html#Foo" },
209
+ url_map = {"* a b* " : "foo.html#Foo" },
210
210
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>' ,
212
217
)
213
218
214
219
0 commit comments