Closed victornpb closed 2 years ago
I tried replicating the issue and the table is getting appropriately rendered, even in GitHub. Correct me if I am wrong. So this PR uses asciitables.js to generate a correctly formatted table and makes it readable in plain text format as well.
Ignore the js files inside src/
, I must have made some mistake in the last build and forgot to remove those.
It would be great if you can remove the js
files inside the src/
folder.
I renamed is as a feature instead, this is not really a "bugfix" anymore. Sorry for the mistake. I was parsing the output of notion-to-md with remark, and it isn't able to parse tables without an additional plugin.
I added a test case, and removed the src/*.js
files.
Is up to you if you still want to merge this, I'm ok if want to keep it as is, but if you're interested in this PR let me know if you want any changes, I'll happily update my branch. Disclaimer: I’m the author of this npm package.
Thanks for the contribution. I'll review the code and merge it.
hey @victornpb, can you switch to the markdown-table package from asciitable.js
and update the test file accordingly?
@victornpb Closing this issue, I have added markdown-table as dependency and updated test files accordingly. Will create a release shortly. Thank you.
I have a simple table in a page like this. The output does not produce a valid GitHub flavor markdown.
Current behavior
Markdown
Rendered
Name|Description|Required|Default ---|---|---|--- NOTION_SECRET|Notion API Token secret|✅| NOTION_DATABASE|Notion Database URL or ID (example: https://notion.so/00112233445566778899aabbccddeeff)|✅| FILTER_PROP|||Status FILTER_VALUES|||Published CONVERT_PROP_CASE|||snake ARTICLE_PATH|Path template to where to save markdown files||posts/{title}/README.md ASSETS_PATH|Path to save images, if started with . will be relative to ARTICLE_PATH, otherwise absolute||./ PARALLEL_PAGES|||25 PARALLEL_DOWNLOADS_PER_PAGE|||3 DOWNLOAD_IMAGE_TIMEOUT|||30 SKIP_DOWNLOADED_IMAGES|Skip downloading images if they already exist in the path||true DOWNLOAD_FRONTMATTER_IMAGES|Downloads image urls in the frontmatter||true
New behavior
I added proper ascii table compatible with GitHub markdown generation, which is also readable as plaintext, as per markdown principle.
Markdown
Rendered output
I need some guidance, I couldn't figure out how you generated the .js files on the side of the .ts files inside the src/ I can write some tests