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

Fixed issue with cell merges ruining offset spans. #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

r-dgreen
Copy link

Found a bug while working with data2rst and grid2data functions.

Given a table like this:

+-----+--------+-------+
| 0,0 | 0,1    | 0,2   |
+=====+========+=======+
| 1,0 | 1,1    | 1,2   |
+-----+--------+-------+
| 2,0 | 2,1        2,2 |
|     |                |
+-----+ 3,1        3,2 |
| 3,0 |                |
|     +--------+-------+
| 4,0 | 4,1    | 4,2   |
+-----+--------+-------+

When run through grid2data and back through data2rst the table gets converted to this:

+-----+--------+-------+
| 0,0 | 0,1    | 0,2   |
+=====+========+=======+
| 1,0 | 1,1    | 1,2   |
+-----+--------+-------+
| 2,0 | 2,1        2,2 |
|     |                |
+-----| 3,1        3,2 |
| 3,0 |                |
|     +--------+-------+
| 4,0 | 4,1    | 4,2   |
+-----+--------+-------+

The border between cell 2,0/3,0, and span 2,1 gets converted from + to |

When converting this new table with grid2data it creates a broken set of spans (runtests/test_rstspan.py against the original merge_cells.py to see this happen.

I've included a fix with merge_cells.py that prioritizes + when merging cells together.

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.

None yet

1 participant