Merge pull request #4208 from tk0miya/4206_label_loses_paragraph_break

Fix #4206: latex: reST label between paragraphs loses paragraph break
This commit is contained in:
Takeshi KOMIYA 2017-11-01 22:23:39 +09:00 committed by GitHub
commit 26db2675b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,8 @@ Features added
Bugs fixed
----------
* #4206: latex: reST label between paragraphs loses paragraph break
Testing
--------

View File

@ -1919,6 +1919,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
# will be generated differently
if id.startswith('index-'):
return
# insert blank line, if the target follows a paragraph node
index = node.parent.index(node)
if index > 0 and isinstance(node.parent[index - 1], nodes.paragraph):
self.body.append('\n')
# do not generate \phantomsection in \section{}
anchor = not self.in_title
self.body.append(self.hypertarget(id, anchor=anchor))