diff --git a/myst_parser/mocking.py b/myst_parser/mocking.py
index 7812de94..382596e2 100644
--- a/myst_parser/mocking.py
+++ b/myst_parser/mocking.py
@@ -181,9 +181,7 @@ def inline_text(
# so that the nested parse does not effect the current renderer,
# but we use the same env, so that link references, etc
# are added to the global parse.
- from myst_parser.docutils_renderer import DocutilsRenderer
-
- nested_renderer = DocutilsRenderer(self._renderer.md)
+ nested_renderer = self._renderer.__class__(self._renderer.md)
options = {k: v for k, v in self._renderer.config.items()}
options.update(
{
diff --git a/tests/test_sphinx/sourcedirs/basic/content.md b/tests/test_sphinx/sourcedirs/basic/content.md
index 76499e31..e3872f34 100644
--- a/tests/test_sphinx/sourcedirs/basic/content.md
+++ b/tests/test_sphinx/sourcedirs/basic/content.md
@@ -34,6 +34,10 @@ abcd *abc* [google](https://www.google.com)
````
+```{admonition} Title with [link](target2)
+Content
+```
+
(target2)=
```{figure} example.jpg
diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py
index 08d17055..1c6aa287 100644
--- a/tests/test_sphinx/test_sphinx_builds.py
+++ b/tests/test_sphinx/test_sphinx_builds.py
@@ -67,7 +67,7 @@ def test_basic(
"date": "2/12/1985",
"copyright": "MIT",
"other": "Something else",
- "wordcount": {"minutes": 0, "words": 53},
+ "wordcount": {"minutes": 0, "words": 57},
}
diff --git a/tests/test_sphinx/test_sphinx_builds/test_basic.resolved.sphinx3.xml b/tests/test_sphinx/test_sphinx_builds/test_basic.resolved.sphinx3.xml
index e04808ef..762dc6bd 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_basic.resolved.sphinx3.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_basic.resolved.sphinx3.xml
@@ -32,6 +32,14 @@
+ Title with + + + link + + +
++ Content +
+- 53 words | 0 min read + 57 words | 0 min read
+ Title with + + + link + + +
++ Content +
+- 53 words | 0 min read + 57 words | 0 min read
diff --git a/tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.xml index ee7c75a7..c793d318 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.xml +++ b/tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.xml @@ -32,6 +32,14 @@