fix: paragraphs in versionmodified are ignored when it has no dangling paragraphs.

This commit is contained in:
Nozomu Kaneko
2013-01-06 18:05:49 +09:00
parent 7b443298a3
commit 7630467f84
3 changed files with 16 additions and 2 deletions

View File

@@ -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)

View File

@@ -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
-----------

View File

@@ -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