Blame SOURCES/fix-spurious-table-column-alignment-errors.patch

8995e4
diff --git a/docutils/parsers/rst/tableparser.py b/docutils/parsers/rst/tableparser.py
8995e4
index 2cd3879..fd24424 100644
8995e4
--- a/docutils/parsers/rst/tableparser.py
8995e4
+++ b/docutils/parsers/rst/tableparser.py
8995e4
@@ -511,8 +511,8 @@ class SimpleTableParser(TableParser):
8995e4
                 if i == lastcol and line[end:].strip():
8995e4
                     text = line[start:].rstrip()
8995e4
                     new_end = start + len(text)
8995e4
-                    columns[i] = (start, new_end)
8995e4
                     main_start, main_end = self.columns[-1]
8995e4
+                    columns[i] = (start, max(main_end, new_end))
8995e4
                     if new_end > main_end:
8995e4
                         self.columns[-1] = (main_start, new_end)
8995e4
                 elif line[end:nextstart].strip():
8995e4
diff --git a/test/test_parsers/test_rst/test_tables.py b/test/test_parsers/test_rst/test_tables.py
8995e4
index ed7e177..28b8070 100755
8995e4
--- a/test/test_parsers/test_rst/test_tables.py
8995e4
+++ b/test/test_parsers/test_rst/test_tables.py
8995e4
@@ -789,6 +789,56 @@ A table with three  columns.
8995e4
 """],
8995e4
 ["""\
8995e4
 ==============  ======
8995e4
+A simple table  this text extends to the right
8995e4
+cell 3          as does this text
8995e4
+==============  ======
8995e4
+""",
8995e4
+"""\
8995e4
+<document source="test data">
8995e4
+    
8995e4
+        <tgroup cols="2">
8995e4
+            <colspec colwidth="14">
8995e4
+            <colspec colwidth="30">
8995e4
+            
8995e4
+                <row>
8995e4
+                    <entry>
8995e4
+                        <paragraph>
8995e4
+                            A simple table
8995e4
+                    <entry>
8995e4
+                        <paragraph>
8995e4
+                            this text extends to the right
8995e4
+                <row>
8995e4
+                    <entry>
8995e4
+                        <paragraph>
8995e4
+                            cell 3
8995e4
+                    <entry>
8995e4
+                        <paragraph>
8995e4
+                            as does this text
8995e4
+"""],
8995e4
+["""\
8995e4
+==============  ======
8995e4
+A simple table  this text extends to the right
8995e4
+                continuation of cell 2
8995e4
+==============  ======
8995e4
+""",
8995e4
+"""\
8995e4
+<document source="test data">
8995e4
+    
8995e4
+        <tgroup cols="2">
8995e4
+            <colspec colwidth="14">
8995e4
+            <colspec colwidth="30">
8995e4
+            
8995e4
+                <row>
8995e4
+                    <entry>
8995e4
+                        <paragraph>
8995e4
+                            A simple table
8995e4
+                    <entry>
8995e4
+                        <paragraph>
8995e4
+                            this text extends to the right
8995e4
+                            continuation of cell 2
8995e4
+"""],
8995e4
+["""\
8995e4
+==============  ======
8995e4
 A simple table  with
8995e4
 no bottom       border
8995e4
 """,