Skip to content

[Bug]: Inserting inline code removes preceding non-whitespace characters #6358

@mejo-

Description

@mejo-

Affected Packages

extensions-code

Version(s)

2.12.0

Bug Description

When inserting inline code with a preceding non-whitespace character, the preceding character gets removed.

To reproduce, type a, then backtick, then code, then again backtick. You would expect to see "acode". Instead, the "a" got removed.

This bug got introduced in Tiptap 2.11.0 with PR #5916. The PR removes named capturing groups and lookbehind assertions from the input regex as apparently Safari < 16.4 doesn't support them.

An earlier PR #4468 introduced those to fix the problem that the input regex matched only backticks at the beginning of a line or preceded by a whitespace.

Browser Used

Firefox

Code Example URL

No response

Expected Behavior

Typing a followed by backtick + code + backtick should not remove the a.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions