Skip to content

Commit

Permalink
Merge branch '4.0.x' into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Jun 14, 2021
2 parents 7507989 + 8939a75 commit f14561d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGES
Expand Up @@ -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
--------
Expand Down
16 changes: 12 additions & 4 deletions sphinx/domains/changeset.py
Expand Up @@ -74,8 +74,10 @@ def run(self) -> List[Node]:
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
Expand All @@ -84,10 +86,16 @@ def run(self) -> List[Node]:

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)

Expand Down
3 changes: 2 additions & 1 deletion sphinx/texinputs/sphinxlatexliterals.sty
Expand Up @@ -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
Expand Down

0 comments on commit f14561d

Please sign in to comment.