summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2006-12-09 00:59:23 +0000
committergoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2006-12-09 00:59:23 +0000
commit8b3a70b05439b6a1c3ca2e72aa74cb25da2020ef (patch)
tree4bfe8d7b73a12625a734ce73e743049ff6c0f574
parent881629c2b094c287890683ebef32b3ed08aaa2c6 (diff)
downloaddocutils-8b3a70b05439b6a1c3ca2e72aa74cb25da2020ef.tar.gz
fixed bug with multi-line attributions in block quote directives (epigraph etc.)
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@4824 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--docutils/parsers/rst/states.py7
-rwxr-xr-xtest/test_parsers/test_rst/test_directives/test_block_quotes.py6
2 files changed, 10 insertions, 3 deletions
diff --git a/docutils/parsers/rst/states.py b/docutils/parsers/rst/states.py
index 71cfaa523..50f5dd082 100644
--- a/docutils/parsers/rst/states.py
+++ b/docutils/parsers/rst/states.py
@@ -1145,7 +1145,9 @@ class Body(RSTState):
return (indented, None, None, None, None)
def check_attribution(self, indented, attribution_start):
- """Check attribution shape
+ """
+ Check attribution shape.
+ Return the index past the end of the attribution, and the indent.
"""
indent = None
i = attribution_start + 1
@@ -1157,6 +1159,9 @@ class Body(RSTState):
indent = len(line) - len(line.lstrip())
elif len(line) - len(line.lstrip()) != indent:
return None, None # bad shape; not an attribution
+ else:
+ # return index of line after last attribution line:
+ i += 1
return i, (indent or 0)
def parse_attribution(self, indented, line_offset):
diff --git a/test/test_parsers/test_rst/test_directives/test_block_quotes.py b/test/test_parsers/test_rst/test_directives/test_block_quotes.py
index d650f439f..d56f49e3d 100755
--- a/test/test_parsers/test_rst/test_directives/test_block_quotes.py
+++ b/test/test_parsers/test_rst/test_directives/test_block_quotes.py
@@ -26,7 +26,8 @@ generic_tests = [
This is another block quote.
- -- Another Attribution
+ -- Another Attribution,
+ Second Line
""",
"""\
<document source="test data">
@@ -39,7 +40,8 @@ generic_tests = [
<paragraph>
This is another block quote.
<attribution>
- Another Attribution
+ Another Attribution,
+ Second Line
"""],
# TODO: Add class option.
["""\