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

Paragraph text with multiple dollar amounts incorrectly creates an equation block. #48

Open
gleuch opened this issue May 10, 2023 · 0 comments

Comments

@gleuch
Copy link

gleuch commented May 10, 2023

Problem

Paragraph text with multiple dollar amounts incorrectly creates an equation block.

Working Example

markdownToBlock('A painting by John Doe sold for $9M at auction. A previous piece of his sold for $5M last year.');

Actual Result

Generated JSON block

[
  {
    "object": "block",
    "type": "paragraph",
    "paragraph": {
      "rich_text": [
        {
          "type": "text",
          "annotations": {
            "bold": false,
            "strikethrough": false,
            "underline": false,
            "italic": false,
            "code": false,
            "color": "default"
          },
          "text": {
            "content": "A painting by John Doe sold for "
          }
        },
        {
          "type": "equation",
          "annotations": {
            "bold": false,
            "strikethrough": false,
            "underline": false,
            "italic": false,
            "code": false,
            "color": "default"
          },
          "equation": {
            "expression": "9M at auction. A previous piece of his sold for "
          }
        },
        {
          "type": "text",
          "annotations": {
            "bold": false,
            "strikethrough": false,
            "underline": false,
            "italic": false,
            "code": false,
            "color": "default"
          },
          "text": {
            "content": "5M last year."
          }
        }
      ]
    }
  }
]

Screenshot when saved to Notion API
Screen Shot 2023-05-09 at 22 11 15

Expected Result

[
  {
    "object": "block",
    "type": "paragraph",
    "paragraph": {
      "rich_text": [
        {
          "type": "text",
          "annotations": {
            "bold": false,
            "strikethrough": false,
            "underline": false,
            "italic": false,
            "code": false,
            "color": "default"
          },
          "text": {
            "content": "A painting by John Doe sold for $9M at auction. A previous piece of his sold for $5M last year."
          }
        }
      ]
    }
  }
]
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

No branches or pull requests

1 participant