Cobertos / md2notion

A better Notion.so Markdown importer
MIT License
655 stars 65 forks source link

Uploading markdown with tables fails #6

Closed coryodaniel closed 4 years ago

coryodaniel commented 4 years ago

Uploading a markdown file with a table throws an error. I tried a variety of formatting ---, :---, etc and got the same results.

# Great README

| Table Example | Simple |
| ------------- | ------ |
| Lorem         | true   |

Error:


Uploading CollectionViewBlock, 1/1 (100.0%)Traceback (most recent call last):
  File "./bin/upload.py", line 79, in <module>
    upload(markdown, current_page)
  File "/usr/local/lib/python3.7/site-packages/md2notion/upload.py", line 95, in upload
    uploadBlock(blockDescriptor, notionPage, mdFile.name, imagePathFunc)
  File "/usr/local/lib/python3.7/site-packages/md2notion/upload.py", line 48, in uploadBlock
    newBlock.collection = client.get_collection(
Cobertos commented 4 years ago

Hmm, was that all there was to the error?

I'll test this in a couple days, currently moving houses. There's a test for the table conversion so that should work (and it looks like the error is coming from the uploading portion so that sounds right). I'll have to check that and figure out a good way to write tests for upload.py

Cobertos commented 4 years ago

@coryodaniel Should be fixed now, added a bunch more tests for that section as well.