-
Notifications
You must be signed in to change notification settings - Fork 59
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
IndexError
when Table(..., header=None)
#15
Comments
I just pushed a fix that should work, but since I had to touch several parts of the code I wouldn't be surprised if I missed something. BTW, TravisCI is failing right now because I can't get pandoc to install on their docker containers, but the tests are passing on my side |
I recently have experimented quite a few different ways of setting up travis for pandoc project. Do you want me to pull request on the travis setup? (and you want |
Yes, I think I also suspect there's a bug that pops up only in some systems and that might be picked up by Travis in this case. I need to change the JSON loading code to fix that for good, but that would probably wait a few days unless you or someone else spot that bug on the field (so it's not only Travis's specific config that gives the bug) |
I tried updating panflute, but the version is still 1.4.2. By the way, can you provide a quicker way to check version like the attribute Thanks. |
I can confirm 1.4.3 works. I installed using |
Having a .version variable makes sense; I'll probably follow suggestion 3 of this link |
EG: >>> import panflute >>> panflute.__version__ '1.4.5'
I think this one need to reopen: from panflute import *
x = [Para(Str('Something')), Para(Space, Str('else'))]
c1 = TableCell(*x)
c2 = TableCell(Header(Str('Title')))
rows = [TableRow(c1, c2)]
table = Table(*rows, header=None)
print(convert_text([table], input_format='panflute', output_format='native')) will output [Table [] [AlignDefault,AlignDefault] [0.0,0.0]
[]
[[[Para [Str "Something"]
,Para [Space,Str "else"]]
,[Header 1 ("",[],[]) [Str "Title"]]]]] Notice the 2nd line is an empty "list". pandoc seems to parse this just fine. But the problem is when this is passed to panflute, panflute will complain And in the case when pandoc has no header row, it will output a "list" of "list" that looks like this: [[]
,[]] So even if pandoc is fine with |
Just submitted a fix:
|
Hi,
From
Table(*args, *, header=None, caption=None, alignment=None, width=None)
, the default value ofheader
isNone
. However, using a modified version of the docstring:will result in
It would be the same if the last line becomes
table = Table(*rows, header=None)
.So it always expected a list as long as the no. of columns.
Thanks.
The text was updated successfully, but these errors were encountered: