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

"parse-text-from-any-block-type" example bug fixed (not printing ordinary "rich_text" blocks) #462

Closed
wants to merge 1 commit into from

Conversation

adasq
Copy link

@adasq adasq commented Oct 3, 2023

The current version doesn't support a general rich_text case, for the following block:

{
  type: 'rich_text',
  rich_text: [
    {
      type: 'text',
      text: [Object],
      annotations: [Object],
      plain_text: 'plain!',
      href: null
    }
  ]
}

The first if condition:

if (block[block.type].rich_text) {
        // This will be an empty string if it's an empty line.
        text = getPlainTextFromRichText(block[block.type].rich_text)
    }

doesn't cover it, as it resolves to block.rich_text.rich_text.

@adasq adasq changed the title Example bug fix "parse-text-from-any-block-type" example gub fixed (not printing ordinary "rich_text" blocks) Oct 3, 2023
@adasq adasq changed the title "parse-text-from-any-block-type" example gub fixed (not printing ordinary "rich_text" blocks) "parse-text-from-any-block-type" example bug fixed (not printing ordinary "rich_text" blocks) Oct 3, 2023
@christinewa
Copy link
Contributor

Hey, thanks for opening this PR. We're doing some git history cleanup and need to close the PR as it'll become invalid. Afterwards, please reclone the repo and you can reopen the PR. Thanks for your patience and sincere apologies for the trouble.

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.

2 participants