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

'undefined' in the last line of table markdown string #86

Closed
feilvan opened this issue May 19, 2023 · 6 comments
Closed

'undefined' in the last line of table markdown string #86

feilvan opened this issue May 19, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@feilvan
Copy link

feilvan commented May 19, 2023

Hello, I got this extra line when I'm trying to convert a table to md string

'\n' +
'| Table | Name |\n' +
'| ----- | ---- |\n' +
'| 1     | Aa   |\n' +
'| 2     | Bb   |\n' +
'\n' +
'undefined'

The block in Notion looks like this

image

Here's the md block (if needed)

{
  type: 'table',
  blockId: 'a50e6d08-ffee-428b-b0bd-fc464bb67e88',
  parent: '| Table | Name |\n| ----- | ---- |\n| 1     | Aa   |\n| 2     | Bb   |',
  children: [
    {
      type: 'table_row',
      blockId: 'bcce0040-dfb3-4328-af92-fae1eedcf393',
      parent: '',
      children: []
    },
    {
      type: 'table_row',
      blockId: '4e2cfa23-b872-4a88-8bd7-383e63c7879b',
      parent: '',
      children: []
    },
    {
      type: 'table_row',
      blockId: 'af86e7dd-77a4-4fa1-8123-dce55f1d164f',
      parent: '',
      children: []
    }
  ]
}
@souvikinator
Copy link
Owner

Seems like a bug. I'll fix it ASAP.

@souvikinator
Copy link
Owner

This is fixed now. Should be live in the coming update. Thank you for the contribution and using the library.

@souvikinator souvikinator added the bug Something isn't working label May 19, 2023
@feilvan
Copy link
Author

feilvan commented May 19, 2023

awesome! thanks for your hard work. this library is perfect for my need.

@souvikinator
Copy link
Owner

Glad to hear that! Thank you :))
The fix is now live in v3.0.1
Closing the issue, feel free to reopen if the issue still persists.

@ge9
Copy link

ge9 commented Jun 14, 2023

This happened again in 3.1.0.
I think we may need some code for case "table_row" near

case "table": {
.

@souvikinator
Copy link
Owner

I'm on it. I'll fix it and release a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants