summaryrefslogtreecommitdiff
path: root/sphinx/util/nodes.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-07-29 01:35:50 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-08-02 00:27:24 +0900
commitc45f962b05106d91d64d9fa820a3951b694d9a6a (patch)
tree455f3297c930dc73dd13e5d9e74a8dede21609d1 /sphinx/util/nodes.py
parent57777da0bbb5e7126d2c90a6e550f9bdc2765df7 (diff)
downloadsphinx-git-c45f962b05106d91d64d9fa820a3951b694d9a6a.tar.gz
Fix #6620: i18n: classifiers of definition list are not translated with docutils-0.15
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 abbc432df..52e43c2e2 100644
--- a/sphinx/util/nodes.py
+++ b/sphinx/util/nodes.py
@@ -133,6 +133,9 @@ def apply_source_workaround(node: Element) -> None:
node.source = definition_list_item.source
node.line = definition_list_item.line - 1
node.rawsource = node.astext() # set 'classifier1' (or 'classifier2')
+ elif isinstance(node, nodes.classifier) and not node.source:
+ # docutils-0.15 fills in rawsource attribute, but not in source.
+ node.source = node.parent.source
if isinstance(node, nodes.image) and node.source is None:
logger.debug('[i18n] PATCH: %r to have source, line: %s',
get_full_module_name(node), repr_domxml(node))