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

Notion has changed link_to_page to mention for @ links #101

Closed
kmlbgn opened this issue Dec 21, 2023 · 4 comments
Closed

Notion has changed link_to_page to mention for @ links #101

kmlbgn opened this issue Dec 21, 2023 · 4 comments

Comments

@kmlbgn
Copy link

kmlbgn commented Dec 21, 2023

Notion has changed the type for its @ links , also the href is now absolute and only uses the page id instead of the old SomePageTitle-PageID format.

 {
    "type": "mention",
    "mention": {
        "type": "page",
        "page": {
            "id": "9aa7ca32-eadd-4151-bec4-88c534773fca"
        }
    },
    "annotations": {
        "bold": false,
        "italic": false,
        "strikethrough": false,
        "underline": false,
        "code": false,
        "color": "default"
    },
    "plain_text": "Untitled",
    "href": "https://www.notion.so/9aa7ca32eadd4151bec488c534773fca"
},
{
    "object": "block",
    "id": "ac5a6780-4379-4fec-873d-f6aa5f91e64c",
    "parent": {
        "type": "page_id",
        "page_id": "9fad7f0e-9e49-4e7a-97b6-6008911cceeb"
    },
    "created_time": "2023-12-18T14:16:00.000Z",
    "last_edited_time": "2023-12-18T14:18:00.000Z",
    "created_by": {
        "object": "user",
        "id": "1d84dd47-93aa-4d90-94bf-e85c17ca9367"
    },
    "last_edited_by": {
        "object": "user",
        "id": "1d84dd47-93aa-4d90-94bf-e85c17ca9367"
    },
    "has_children": false,
    "archived": false,
    "type": "paragraph",
    "paragraph": {
        "rich_text": [
            {
                "type": "mention",
                "mention": {
                    "type": "page",
                    "page": {
                        "id": "9aa7ca32-eadd-4151-bec4-88c534773fca"
                    }
                },
                "annotations": {
                    "bold": false,
                    "italic": false,
                    "strikethrough": false,
                    "underline": false,
                    "code": false,
                    "color": "default"
                },
                "plain_text": "D1 P1",
                "href": "https://www.notion.so/9aa7ca32eadd4151bec488c534773fca"
            },
            {
                "type": "text",
                "text": {
                    "content": " ",
                    "link": null
                },
                "annotations": {
                    "bold": false,
                    "italic": false,
                    "strikethrough": false,
                    "underline": false,
                    "code": false,
                    "color": "default"
                },
                "plain_text": " ",
                "href": null
            }
        ],
        "color": "default"
    },
    "developer_survey": "https://notionup.typeform.com/to/bllBsoI4?utm_source=postman",
    "request_id": "c3c44aab-1f80-42d0-a21a-4b701c78c0b9"
}
@nickjtchfind
Copy link

@kmlbgn how were you able to bypass this? Thanks

@souvikinator
Copy link
Owner

@tictaqqn and @nickjtchfind apologies for the super late response. I'm working on the version 4 and will be taking this up, would like to have your feedback on how this specific use case can be added to v4.
here is the discussion link: #112

@souvikinator
Copy link
Owner

souvikinator commented Jan 5, 2025

@kmlbgn thanks for the report. There's no breaking change, right? The output still looks the same to me. Also it seems like both mention and link_to_page seem to coexist. I'll add extra condition thanks :)

here is the notion page:
image

output:
image

@nickjtchfind can you be a bit more elaborate about bypass?

@souvikinator
Copy link
Owner

Alright so as the doc says the mention block is not actually a block but rather a part of rich_text object which is why even after change it continues to work without breaking. Ex: A paragraph block can have rich_text object with one of the elements of types mention.

link_to_page and link_preview block type continues to exist.

closing the issue. thank you for your contribution. If this is leading to some issues feel free to reopen it :)

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

3 participants