summaryrefslogtreecommitdiff
path: root/sphinx/util/docfields.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-24 16:34:47 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-24 16:34:47 +0900
commit51d500833e391c182f536e83a5d62d5e90ce8ca9 (patch)
treefb854309b759773feb83e7e4bbc91e3ed3cb2b00 /sphinx/util/docfields.py
parent375fb52fe402d46d633e321ce8f20c1aa61c49b9 (diff)
parent41ee2d6e6595d0eefb4a2b752fd79a3451382d5a (diff)
downloadsphinx-git-51d500833e391c182f536e83a5d62d5e90ce8ca9.tar.gz
Merge branch '3.x' into 7774_remove_develop.rst
Diffstat (limited to 'sphinx/util/docfields.py')
-rw-r--r--sphinx/util/docfields.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/sphinx/util/docfields.py b/sphinx/util/docfields.py
index c07bc7f66..3fc72340a 100644
--- a/sphinx/util/docfields.py
+++ b/sphinx/util/docfields.py
@@ -5,13 +5,12 @@
"Doc fields" are reST field lists in object descriptions that will
be domain-specifically transformed to a more appealing presentation.
- :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
+ :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import warnings
-from typing import Any, Dict, List, Tuple, Union
-from typing import cast
+from typing import Any, Dict, List, Tuple, Union, cast
from docutils import nodes
from docutils.nodes import Node
@@ -23,8 +22,9 @@ from sphinx.util.typing import TextlikeNode
if False:
# For type annotation
from typing import Type # for python3.5.1
- from sphinx.environment import BuildEnvironment
+
from sphinx.directive import ObjectDescription
+ from sphinx.environment import BuildEnvironment
def _is_single_paragraph(node: nodes.field_body) -> bool:
@@ -295,6 +295,7 @@ class DocFieldTransformer:
self.directive.domain,
target,
contnode=content[0],
+ env=self.directive.state.document.settings.env
)
if _is_single_paragraph(field_body):
paragraph = cast(nodes.paragraph, field_body[0])