# 在移动设备上的富文本模式下，代码块无法创建新行

**URL:** https://meta.discourse.org/t/cannot-create-new-lines-in-codeblocks-in-rich-text-mode-on-mobile/378842
**Category:** Bug
**Tags:** composer, mobile
**Created:** [2025年八月16日 04:22 UTC](https://meta.discourse.org/t/cannot-create-new-lines-in-codeblocks-in-rich-text-mode-on-mobile/378842 "2025-08-16T04:22:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [2025年八月16日 04:22 UTC](https://meta.discourse.org/t/cannot-create-new-lines-in-codeblocks-in-rich-text-mode-on-mobile/378842/1 "2025-08-16T04:22:11Z")

</div>

在移动设备上的代码块中，我似乎无法通过按键盘上的回车键来添加新行。

可复现步骤：

1. 打开帖子编辑器
2. 如果您不在富文本模式，请切换到富文本模式
3. 转到“更多”部分（带圆圈和加号的那个；我忘了它的实际名称）
4. 点击“预格式化文本”
5. 在代码块中添加一些文本
6. 尝试通过点击回车键 ↩ 来添加新行
7. 您无法做到！

在 Android 设备上，三星 A14。

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2025年八月16日 04:38 UTC](https://meta.discourse.org/t/cannot-create-new-lines-in-codeblocks-in-rich-text-mode-on-mobile/378842/2 "2025-08-16T04:38:02Z")

</div>

~~我在 iPhone 上可以轻松做到这一点，所以我猜你用的是安卓。~~ 🧐

编辑：算了，我明白了——我是通过先输入然后高亮来预格式化文本，但你说得对，它会创建一个完整的块，然后你就被困住了，或者你必须留一个空行。 🤔

编辑 2：看起来我在 iPhone 上的 Chrome 浏览器中只需点击下方即可。 Safari 则不然……

---

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [2025年八月16日 04:51 UTC](https://meta.discourse.org/t/cannot-create-new-lines-in-codeblocks-in-rich-text-mode-on-mobile/378842/3 "2025-08-16T04:51:21Z")

</div>

此外：如果在先前多行代码块中输入换行符，最后一行将被删除。

（在 Android 上）
