File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818AUTO_REF_RE = re .compile (
1919 r"<span data-(?P<kind>autorefs-identifier|autorefs-optional|autorefs-optional-hover)="
2020 r'("?)(?P<identifier>[^"<>]*)\2>(?P<title>.*?)</span>' ,
21+ flags = re .DOTALL ,
2122)
2223"""A regular expression to match mkdocs-autorefs' special reference markers
2324in the [`on_post_page` hook][mkdocs_autorefs.plugin.AutorefsPlugin.on_post_page].
Original file line number Diff line number Diff line change @@ -111,6 +111,15 @@ def test_reference_to_relative_path() -> None:
111111 )
112112
113113
114+ def test_multiline_links () -> None :
115+ """Check that links with multiline text are recognized."""
116+ run_references_test (
117+ url_map = {"foo-bar" : "foo.html#bar" },
118+ source = "This [Foo\n bar][foo-bar]." ,
119+ output = '<p>This <a class="autorefs autorefs-internal" href="foo.html#bar">Foo\n bar</a>.</p>' ,
120+ )
121+
122+
114123def test_no_reference_with_space () -> None :
115124 """Check that references with spaces are not fixed."""
116125 run_references_test (
You can’t perform that action at this time.
0 commit comments