summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-03-22 13:25:46 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-03-22 13:25:46 +0000
commitc12f45f08b42a00cef2615efd0b5901897e3fced (patch)
tree561eaaa317a357b7b920f83b986687992e17b022
parent497d6bc94ccbacc063f069e46f7ae68de89c89f8 (diff)
downloaddocutils-c12f45f08b42a00cef2615efd0b5901897e3fced.tar.gz
Fix [ 157 ] Line block parsing does not like system message.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7638 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--HISTORY.txt4
-rw-r--r--docutils/parsers/rst/states.py2
-rwxr-xr-xtest/test_parsers/test_rst/test_line_blocks.py23
3 files changed, 28 insertions, 1 deletions
diff --git a/HISTORY.txt b/HISTORY.txt
index 27a05cf98..33df75179 100644
--- a/HISTORY.txt
+++ b/HISTORY.txt
@@ -33,6 +33,10 @@ Changes Since 0.10
- Apply [ 3599485 ] node source/line information for sphinx translation.
+* docutils/parsers/rst/states.py
+
+ - Fix [ 157 ] Line block parsing doesn't like system message.
+
* docutils/transforms/references.py
- Fix [ 3607029 ] traceback with embedded alias pointing to missing target.
diff --git a/docutils/parsers/rst/states.py b/docutils/parsers/rst/states.py
index 7b5f708e6..a148ddae2 100644
--- a/docutils/parsers/rst/states.py
+++ b/docutils/parsers/rst/states.py
@@ -1594,7 +1594,7 @@ class Body(RSTState):
def nest_line_block_lines(self, block):
for index in range(1, len(block)):
- if block[index].indent is None:
+ if getattr(block[index], 'indent', None) is None:
block[index].indent = block[index - 1].indent
self.nest_line_block_segment(block)
diff --git a/test/test_parsers/test_rst/test_line_blocks.py b/test/test_parsers/test_rst/test_line_blocks.py
index 553667279..f9ca0eac3 100755
--- a/test/test_parsers/test_rst/test_line_blocks.py
+++ b/test/test_parsers/test_rst/test_line_blocks.py
@@ -300,6 +300,29 @@ This is not
<line>
* is not recognized.
"""],
+["""\
+System messages can appear in place of lines:
+
+| `uff <test1>`_
+| `uff <test2>`_
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ System messages can appear in place of lines:
+ <line_block>
+ <line>
+ <reference name="uff" refuri="test1">
+ uff
+ <target dupnames="uff" ids="uff" refuri="test1">
+ <system_message backrefs="id1" level="2" line="3" source="test data" type="WARNING">
+ <paragraph>
+ Duplicate explicit target name: "uff".
+ <line>
+ <reference name="uff" refuri="test2">
+ uff
+ <target dupnames="uff" ids="id1" refuri="test2">
+"""],
]