summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfbu <jfbu@free.fr>2021-06-14 23:00:18 +0200
committerjfbu <jfbu@free.fr>2021-06-14 23:00:18 +0200
commitf14561da80c263b867b51e27a75c4f9cdacfeb29 (patch)
tree27b00e7b3684c93bdb1b2c20f94c32e56f63059d
parent7507989a5780fc7d9776f072da50cfe12887d979 (diff)
parent8939a75efaa911a12dbe6edccedf261e88bf7eef (diff)
downloadsphinx-git-f14561da80c263b867b51e27a75c4f9cdacfeb29.tar.gz
Merge branch '4.0.x' into 4.x
-rw-r--r--CHANGES6
-rw-r--r--sphinx/domains/changeset.py16
-rw-r--r--sphinx/texinputs/sphinxlatexliterals.sty3
3 files changed, 19 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 7e8658017..e75e38deb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -98,7 +98,11 @@ Features added
Bugs fixed
----------
-* 9313: LaTeX: complex table with merged cells broken since 4.0
+* #9330: changeset domain: :rst:dir:`versionchanged` with contents being a list
+ will cause error during pdf build
+* #9313: LaTeX: complex table with merged cells broken since 4.0
+* #9305: LaTeX: backslash may cause Improper discretionary list pdf build error
+ with Japanese engines
Testing
--------
diff --git a/sphinx/domains/changeset.py b/sphinx/domains/changeset.py
index 1b31e0248..81c81c288 100644
--- a/sphinx/domains/changeset.py
+++ b/sphinx/domains/changeset.py
@@ -74,8 +74,10 @@ class VersionChange(SphinxDirective):
if self.content:
self.state.nested_parse(self.content, self.content_offset, node)
classes = ['versionmodified', versionlabel_classes[self.name]]
- if len(node):
- if isinstance(node[0], nodes.paragraph) and node[0].rawsource:
+ if len(node) > 0 and isinstance(node[0], nodes.paragraph):
+ # the contents start with a paragraph
+ if node[0].rawsource:
+ # make the first paragraph translatable
content = nodes.inline(node[0].rawsource, translatable=True)
content.source = node[0].source
content.line = node[0].line
@@ -84,10 +86,16 @@ class VersionChange(SphinxDirective):
para = cast(nodes.paragraph, node[0])
para.insert(0, nodes.inline('', '%s: ' % text, classes=classes))
+ elif len(node) > 0:
+ # the contents do not starts with a paragraph
+ para = nodes.paragraph('', '',
+ nodes.inline('', '%s: ' % text, classes=classes),
+ translatable=False)
+ node.insert(0, para)
else:
+ # the contents are empty
para = nodes.paragraph('', '',
- nodes.inline('', '%s.' % text,
- classes=classes),
+ nodes.inline('', '%s.' % text, classes=classes),
translatable=False)
node.append(para)
diff --git a/sphinx/texinputs/sphinxlatexliterals.sty b/sphinx/texinputs/sphinxlatexliterals.sty
index 4d0312fc6..d2ba89ea7 100644
--- a/sphinx/texinputs/sphinxlatexliterals.sty
+++ b/sphinx/texinputs/sphinxlatexliterals.sty
@@ -765,7 +765,8 @@
% break at . , ; ? ! /
\sphinxbreaksviaactive
% break also at \
- \let\sphinx@textbackslash\textbackslash
+ \setbox8=\hbox{\textbackslash}%
+ \def\sphinx@textbackslash{\copy8}%
\let\textbackslash\sphinxtextbackslash
% by default, no continuation symbol on next line but may be added
\let\sphinxafterbreak\sphinxafterbreakofinlineliteral