martian icon indicating copy to clipboard operation
martian copied to clipboard

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

Open gleuch opened this issue 1 year ago • 0 comments

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."
          }
        }
      ]
    }
  }
]

gleuch avatar May 10 '23 02:05 gleuch