Skip to content

[Bug] Editing code blocks is very buggy #409

Description

@matous-volf

Bug Description

When I try to edit a code block with a specific code, it behaves extremely strangely and I absolutely cannot do the changes I wish.

Steps to Reproduce

  1. Create a new page.
  2. Create a code block.
  3. Paste
                for page_id in new_book.page_ids.iter() {
                  /*
                  a part of the key. */
    into the block.
  4. Try to insert a space after the dot in the comment.
  5. Observe
    • the cursor jumping to new_book,
    • the removal of the _ from page_id,
    • the italics (should not appear in a code block).

Expected Behavior

The editing should behave normally.

Browser and Version

Firefox 151.0.4

AppFlowy Version(s)

cloud 0.15.22, web 0.14.9

Screenshots

(I'm pressing space when focused in the code block and the cursor is just after ..)

Screencast.From.2026-06-19.08-46-28.webm

Logs and Console Output

On Ctrl+Z:

Invalid delete positions (start: 20, end: 20) for text length 20, skipping text deletion

Additional Context

It seems it is related to the underscores and applying them as italics formatters.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions