Skip to content

Multiple fixes related to parsing and error handling#5

Open
timakro wants to merge 4 commits intosmartboyathome:masterfrom
timakro:master
Open

Multiple fixes related to parsing and error handling#5
timakro wants to merge 4 commits intosmartboyathome:masterfrom
timakro:master

Conversation

@timakro
Copy link

@timakro timakro commented Dec 23, 2018

b39d70a fixes some cell layouts which will now be parsed correctly. The simplest table which was not working was this one:

+-+-+
| | |
+-+ |
| | |
+-+-+

Also the first table from the reStructuredText guide is working now.

1f484db implements a new error handling strategy. Instead of trying to render the invalid text block as text ourselves we keep it on the list of blocks to be processed and reject it in the next call to our test method.

d299058 fixes an exception with malformed tables with different line lengths. Those tables for example used to cause an exception to be thrown:

+-+-+
| | |
+-+-+
| |
+-+

+-+
|
+-+

@haichao0817
Copy link

It will cause error while there are some other code characters in table such as
+----+-----+
| eng| 中文|
+----+-----+
the row length won't be same number.
in line 635: if block[cur_row][cur_col] == '+':
that would cause IndexError: string index out of range

@WillDaSilva
Copy link

I've created a fork of this project to maintain it, and make it available via PyPI

Your contributions would be appreciated there @timakro. Feel free to open an MR or issue.

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.

3 participants