AppFlowy-IO / AppFlowy-IO/AppFlowy-Web

[Bug] Editing code blocks is very buggy

未关闭
#409 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
326
派生
167
平均合并
17 小时 6 分钟
30 天内合并 PR
72

描述

### 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
```rs
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 `.`.)

https://github.com/user-attachments/assets/6b205061-2229-4da4-8b71-234a751bf55b

### 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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。