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

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