Skip to content

[Bug]: Inline code formatting not applied consistently with backticks #4467

Closed
@marwan37

Description

Which packages did you experience the bug in?

extension-code

What Tiptap version are you using?

2.2.0-rc.3

What’s the bug you are facing?

This issue was originally identified in the BlockNote project. For additional context and discussions, see Issue #338 in BlockNote.

When using backticks to format inline code, the expected behavior is that any text enclosed between two backticks should be formatted as inline code, regardless of the surrounding characters. However, the current implementation in TipTap does not consistently apply this formatting, especially when the backticks are surrounded by characters like parentheses, brackets, or other punctuation marks.

Issue can be replicated from the TipTap playground for the Code extension:
TipTapPlayground-Code

What browser are you using?

Chrome

Code example

No response

What did you expect to happen?

I expected that any text enclosed between two backticks, irrespective of surrounding characters, would be consistently formatted as inline code. This behavior should be uniform across different contexts and scenarios.

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖

Metadata

Assignees

No one assigned

    Labels

    Category: Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.Type: BugThe issue or pullrequest is related to a bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions