|
From: <mi...@us...> - 2013-03-22 13:25:49
|
Revision: 7638
http://sourceforge.net/p/docutils/code/7638
Author: milde
Date: 2013-03-22 13:25:46 +0000 (Fri, 22 Mar 2013)
Log Message:
-----------
Fix [ 157 ] Line block parsing does not like system message.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/test/test_parsers/test_rst/test_line_blocks.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2013-03-22 08:53:56 UTC (rev 7637)
+++ trunk/docutils/HISTORY.txt 2013-03-22 13:25:46 UTC (rev 7638)
@@ -33,6 +33,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.
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2013-03-22 08:53:56 UTC (rev 7637)
+++ trunk/docutils/docutils/parsers/rst/states.py 2013-03-22 13:25:46 UTC (rev 7638)
@@ -1594,7 +1594,7 @@
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)
Modified: trunk/docutils/test/test_parsers/test_rst/test_line_blocks.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_line_blocks.py 2013-03-22 08:53:56 UTC (rev 7637)
+++ trunk/docutils/test/test_parsers/test_rst/test_line_blocks.py 2013-03-22 13:25:46 UTC (rev 7638)
@@ -300,6 +300,29 @@
<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">
+"""],
]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|