diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index 1c0cf809b40..80c6e050135 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -442,8 +442,10 @@ def apply(self, **kwargs: Any) -> None: node['uri'] = msgstr continue - # literalblock do not need to be parsed as they do not contain inline syntax - if isinstance(node, LITERAL_TYPE_NODES): + # literalblock do not need to be parsed as they do not contain inline syntax, + # except for parsed-literals, but they use the same node type, so we differentiate + # them based on their number of children. + if isinstance(node, LITERAL_TYPE_NODES) and len(node.children) <= 1: node.children = [nodes.Text(msgstr)] # for highlighting that expects .rawsource and .astext() are same. node.rawsource = node.astext()