Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tablemode fixes for restruturedtext tables #315

Merged

Conversation

R1dO
Copy link
Contributor

@R1dO R1dO commented Sep 10, 2017

With tablemode activated I noticed tables broke once restructuredtext tables contained rows consisting of multiple lines.

It can be seen when using the following table:

   +--------+---------------------------------------------------------+
   | Header | If this is 2 rows, it will show the same error          |
   +========+=========================================================+
   | single | All is still good                                       |
   +--------+---------------------------------------------------------+
   | double | Next one will break when changing text.                 |
   |        | Make sure breakage is not due to an empty line          |
   +--------+---------------------------------------------------------+
   | single | Will still show a wrong line                            |
   +--------+---------------------------------------------------------+
   | double | Lines are odd again, next one will be fine              |
   |        |                                                         |
   +--------+---------------------------------------------------------+
   | single | Everything ok                                           |
   +--------+---------------------------------------------------------+
   | double | DELETE ME to remove content as well (even line)         |
   |        | DELETE ME PLEASE to show errors in gridlines (odd line) |
   +--------+---------------------------------------------------------+
   | single | INSERT TEXT to remove content when a line is long       |
   +--------+---------------------------------------------------------+
   | single | Just to prove it is not due to being the bottom line    |
   +--------+---------------------------------------------------------+

Deleting would produce tables like:

   +--------+------------------------------------------------+
   | Header | If this is 2 rows, it will show the same error |
   +========+================================================+
   | single | All is still good                              |
   +--------+------------------------------------------------+
   | double | Next one will break when changing text.        |
   |        | Make sure breakage is not due to an empty line |
   +--------+---------------------------------------------------------+
   | single | Will still show a wrong line                   |
   +--------+---------------------------------------------------------+
   | double | Lines are odd again, next one will be fine     |
   |        |                                                |
   +--------+------------------------------------------------+
   | single | Everything ok                                  |
   +--------+------------------------------------------------+
   | double |  to remove content as well (even line)         |
   |        | DELETE ME PLEASE to show errors in gridlines ( |
   +--------+---------------------------------------------------------+
   | single | INSERT TEXT to remove content when a line is l |
   +--------+---------------------------------------------------------+
   | single | Just to prove it is not due to being the botto |
   +--------+---------------------------------------------------------+

or

   +--------+------------------------------------------------+
   | Header | If this is 2 rows, it will show the same error |
   +========+================================================+
   | single | All is still good                              |
   +--------+------------------------------------------------+
   | double | Next one will break when changing text.        |
   |        | Make sure breakage is not due to an empty line |
   +--------+---------------------------------------------------------+
   | single | Will still show a wrong line                   |
   +--------+---------------------------------------------------------+
   | double | Lines are odd again, next one will be fine     |
   |        |                                                |
   +--------+------------------------------------------------+
   | single | Everything ok                                  |
   +--------+------------------------------------------------+
   | double | DELETE ME to remove content as well (even line)|
   |        |  to show errors in gridlines (odd line)------- |
   +--------+---------------------------------------------------------+
   | single | INSERT TEXT to remove content when a line is l |
   +--------+---------------------------------------------------------+
   | single | Just to prove it is not due to being the botto |
   +--------+---------------------------------------------------------+

Inserting would produce:

   +--------+---------------------------------------------------------+
   | Header | If this is 2 rows, it will show the same error          |
   +========+=========================================================+
   | single | All is still good                                       |
   +--------+---------------------------------------------------------+
   | double | Next one will break when changing text.                 |
   |        | Make sure breakage is not due to an empty line          |
   +--------+---------------------------------------------------------+
   | single | Will still show a wrong line                            |
   +--------+---------------------------------------------------------+
   | double | Lines are odd again, next one will be fine              |
   |        |                                                         |
   +--------+---------------------------------------------------------+
   | single | Everything ok                                           |
   +--------+---------------------------------------------------------+
   | double | DELETE ME to remove content as well (even line)         |
   |        | DELETE ME PLEASE to show errors in gridlines (odd line) |
   +--------+---------------------------------------------------------+
   | single | INSERT INSERT TEXT to remove content when a line is kin |
   +--------+---------------------------------------------------------+
   | single | Just to prove it is not due to being the bottom line    |
   +--------+---------------------------------------------------------+

This was tested using the latest master.

The fix from this PR would prevent the latter three errors.

Kind regards

Should prevent tablemode errors when using rows > 1 line.

Note: Does not solve problem when cells span multiple rows.
@mitya57 mitya57 merged commit 07f2a0b into retext-project:master Sep 11, 2017
@mitya57
Copy link
Member

mitya57 commented Sep 11, 2017

Thanks a lot!

@R1dO R1dO deleted the tablemodeAllowArbitraryRowHeights branch September 11, 2017 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants