AI Integration on Italic Links

Open
#2,077 1 comment 0 reactions 1 assignee View on GitHub

@YousefED is already working on this.

Since Oct 8, 2025.

Assessment

This issue has not been assessed yet.

Description

bug:P3

Describe the bug
Trying to perform any action using the BlockNote AI Integration on an italic link fails with the following error:

Trying to perform any action using the BlockNote AI Integration on an italic link fails with the following error:
e3e6529578fa2cc6.js:1 Uncaught (in promise) ChunkExecutionError: Tool execution failed: html diff
    at Object.transform (e3e6529578fa2cc6.js:1:460951)Caused by: Error: html diff
    at Object.ep [as rebaseTool] (e3e6529578fa2cc6.js:1:483874)
    at async Object.execute (e3e6529578fa2cc6.js:1:481423)
    at async Object.transform (e3e6529578fa2cc6.js:1:460871)
transform @ e3e6529578fa2cc6.js:1
312de30df321b361.js:1 Error calling LLM ChunkExecutionError: Tool execution failed: html diff
    at Object.transform (e3e6529578fa2cc6.js:1:460951)Caused by: Error: html diff
    at Object.ep [as rebaseTool] (e3e6529578fa2cc6.js:1:483874)
    at async Object.execute (e3e6529578fa2cc6.js:1:481423)
    at async Object.transform (e3e6529578fa2cc6.js:1:460871) (5) [{…}, {…}, {…}, {…}, {…}]
(anonymous) @ 312de30df321b361.js:1
invokeAI @ e3e6529578fa2cc6.js:1
await in invokeAI
onItemClick @ e3e6529578fa2cc6.js:1
onItemClick @ e3e6529578fa2cc6.js:1
i2 @ c9e188f9efdcb6cb.js:1
(anonymous) @ c9e188f9efdcb6cb.js:1
nS @ c9e188f9efdcb6cb.js:1
i9 @ c9e188f9efdcb6cb.js:1
cu @ c9e188f9efdcb6cb.js:1
ca @ c9e188f9efdcb6cb.js:1
l @ 312de30df321b361.js:1

Object that should be transformed( at async Object.transform (e3e6529578fa2cc6.js:1:460871) (5) [{…}, {…}, {…}, {…}, {…}]):

[
    {
        "role": "system",
        "id": "document-state-intro",
        "parts": [
            {
                "type": "text",
                "text": "You're manipulating a selected part of a text document using HTML blocks. \n      Make sure to follow the json schema provided and always include the trailing $ in ids.\n      List items are 1 block with 1 list item each, so block content `<ul><li>item1</li></ul>` is valid, but `<ul><li>item1</li><li>item2</li></ul>` is invalid. We'll merge them automatically.\n      This is the selection as an array of html blocks:"
            }
        ]
    },
    {
        "role": "system",
        "id": "document-state-selection",
        "parts": [
            {
                "type": "text",
                "text": "[{\"id\":\"30714b89-769b-4a60-af60-43eda8b6611b$\",\"block\":\"<p><em><a target=\\\"_blank\\\" rel=\\\"noopener noreferrer nofollow\\\" href=\\\"https://test.de\\\">Italic Link</a></em></p>\"}]"
            }
        ]
    },
    {
        "role": "system",
        "id": "document-state-context",
        "parts": [
            {
                "type": "text",
                "text": "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:"
            },
            {
                "type": "text",
                "text": "[{\"block\":\"<h1>Open source software</h1>\"},{\"block\":\"<p>Open source software refers to computer programs whose source code is made available to the public, allowing anyone to view, modify, and distribute the code. This model stands in contrast to proprietary software, where the source code is kept secret and only the original creators have the right to make changes. Open projects are developed collaboratively, often by communities of developers from around the world, and are typically distributed under licenses that promote sharing and openness.</p>\"},{\"block\":\"<p>One of the primary benefits of open source is the promotion of digital autonomy. By providing access to the source code, these programs empower users to control their own technology, customize software to fit their needs, and avoid vendor lock-in. This level of transparency also allows for greater security, as anyone can inspect the code for vulnerabilities or malicious elements. As a result, users are not solely dependent on a single company for updates, bug fixes, or continued support.</p>\"},{\"block\":\"<p>Additionally, open development fosters innovation and collaboration. Developers can build upon existing projects, share improvements, and learn from each other, accelerating the pace of technological advancement. The open nature of these projects often leads to higher quality software, as bugs are identified and fixed more quickly by a diverse group of contributors. Furthermore, using open source can reduce costs for individuals, businesses, and governments, as it is often available for free and can be tailored to specific requirements without expensive licensing fees.<br><strong>Alphabet:</strong> Könnte bis 2030 wertvoller als Nvidia und Palantir zusammen werden (<em><a target=\\\"_blank\\\" rel=\\\"noopener noreferrer nofollow\\\" href=\\\"https://www.fool.com/investing/2025/09/28/prediction-1-artificial-intelligence-ai-stock-will/\\\">Deep Dive</a></em>)</p>\"},{\"block\":\"<ul><li><p class=\\\"bn-inline-content\\\"><strong>Alphabet: </strong>Könnte bis 2030 wertvoller als Nvidia und <em>Palantir</em> zusammen werden (<em><a target=\\\"_blank\\\" rel=\\\"noopener noreferrer nofollow\\\" href=\\\"https://test.de\\\">Link</a></em>)</p></li></ul>\"},{\"block\":\"<p><em><a target=\\\"_blank\\\" rel=\\\"noopener noreferrer nofollow\\\" href=\\\"https://test.de\\\">Italic Link</a></em></p>\"},{\"block\":\"<p></p>\"}]"
            }
        ]
    },
    {
        "role": "user",
        "id": "user-prompt",
        "parts": [
            {
                "type": "text",
                "text": "Fix spelling"
            }
        ]
    },
    {
        "id": "fE0QgMXRatuwYRaE",
        "role": "assistant",
        "parts": [
            {
                "type": "step-start"
            },
            {
                "type": "tool-applyDocumentOperations",
                "toolCallId": "call_vJXGLjTAP7h7xLpmPd1T7u6Z",
                "state": "output-available",
                "input": {
                    "operations": [
                        {
                            "type": "update",
                            "id": "30714b89-769b-4a60-af60-43eda8b6611b$",
                            "block": "<p><em><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://test.de\">Italics Link</a></em></p>"
                        }
                    ]
                },
                "output": {
                    "status": "error",
                    "error": "Tool execution failed: html diff"
                },
                "callProviderMetadata": {
                    "openai": {
                        "itemId": "fc_0b266fd264e1ca5c0068e4f7c10fb08194b12954197b951e2f"
                    }
                }
            }
        ]
    }
]

To Reproduce

  1. Create Italic link ( https://stackblitz.com/edit/github-dvx2rbxa?file=src%2FApp.tsx)
  2. Perform any action using the BlockNote AI Integration
  3. Review the error in the console

The bug can alternatively be reproduced using this example of the official documentation

Misc

  • Node version: Node.js v20.19.1
  • Package manager: NPM
  • Browser: Chrome Version 140.0.7339.133
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖
Dominant language
TypeScript
Stars
10.2k
Forks
772
Avg merge
3d 11h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TypeCellOS/BlockNote

All issues in TypeCellOS/BlockNote

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.