mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix: paragraphs in versionmodified are ignored when it has no dangling paragraphs.
This commit is contained in:
@@ -194,11 +194,11 @@ class VersionChange(Directive):
|
||||
inodes, messages = self.state.inline_text(self.arguments[1],
|
||||
self.lineno+1)
|
||||
node.extend(inodes)
|
||||
if self.content:
|
||||
self.state.nested_parse(self.content, self.content_offset, node)
|
||||
ret = [node] + messages
|
||||
else:
|
||||
ret = [node]
|
||||
if self.content:
|
||||
self.state.nested_parse(self.content, self.content_offset, node)
|
||||
env = self.state.document.settings.env
|
||||
# XXX should record node.source as well
|
||||
env.note_versionchange(node['type'], node['version'], node, node.line)
|
||||
|
||||
@@ -208,6 +208,15 @@ Version markup
|
||||
.. deprecated:: 0.6
|
||||
Boring stuff.
|
||||
|
||||
.. versionadded:: 1.2
|
||||
|
||||
First paragraph of versionadded.
|
||||
|
||||
.. versionchanged:: 1.2
|
||||
First paragraph of versionchanged.
|
||||
|
||||
Second paragraph of versionchanged.
|
||||
|
||||
|
||||
Code blocks
|
||||
-----------
|
||||
|
||||
@@ -145,6 +145,11 @@ HTML_XPATH = {
|
||||
(".//abbr[@title='abbreviation']", '^abbr$'),
|
||||
# version stuff
|
||||
(".//span[@class='versionmodified']", 'New in version 0.6'),
|
||||
(".//p[@class='versionadded']/span[@class='versionmodified']",
|
||||
tail_check('First paragraph of versionadded')),
|
||||
(".//p[@class='versionchanged']/span[@class='versionmodified']",
|
||||
tail_check('First paragraph of versionchanged')),
|
||||
(".//p", 'Second paragraph of versionchanged'),
|
||||
# footnote reference
|
||||
(".//a[@class='footnote-reference']", r'\[1\]'),
|
||||
# created by reference lookup
|
||||
|
||||
Reference in New Issue
Block a user