summaryrefslogtreecommitdiff
path: root/sphinx/util/nodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/nodes.py')
-rw-r--r--sphinx/util/nodes.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py
index 2568ea4aa..0bfecce9e 100644
--- a/sphinx/util/nodes.py
+++ b/sphinx/util/nodes.py
@@ -57,6 +57,8 @@ def apply_source_workaround(node):
node.source = definition_list_item.source
node.line = definition_list_item.line - 1
node.rawsource = node.astext() # set 'classifier1' (or 'classifier2')
+ if isinstance(node, nodes.image) and node.source is None:
+ node.source, node.line = node.parent.source, node.parent.line
if isinstance(node, nodes.term):
# strip classifier from rawsource of term
for classifier in reversed(node.parent.traverse(nodes.classifier)):
@@ -80,6 +82,7 @@ def apply_source_workaround(node):
nodes.title,
nodes.rubric,
nodes.line,
+ nodes.image,
))):
node.source = find_source_node(node)
node.line = 0 # need fix docutils to get `node.line`