Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: Dead-key apostrophe inserts extra quotes in the composer

已关闭 适合新手
#16,859 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@JohnnyBill 已经在做这个了。

开始于 2026年10月16日。

  • #16884 来自 @ElieSauveterre —— 已关闭,未合并
  • #20350 来自 @JohnnyBill —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
frontend

调研方向

从 composer 编辑器的 handleTextInput 开始(该组件是 ComposerPromptEditorTiptap,位于 apps/web),目前任何非空的替换范围都被视为选中的文本并用分隔符包裹。修复方式是区分临时的 dead-key 替换与真正的选中文本 —— 在包裹之前检查编辑器的选择是否为空。基于那个挂载 ComposerPromptEditorTiptap 并重放替换的聚焦 jsdom 测试来构建,断言在 plain 和 rich-text 两种模式下先出现 s' 再出现 s'il,并确认现有的 composer 测试仍然通过。

由索引模型根据 Issue 内容生成。

描述

bug via-triage
Area

apps/web, including the Linux desktop composer.

Steps to reproduce
  1. Use a keyboard layout where the apostrophe key is a dead key for accents.
  2. Type s in the composer with the caret at the end and no selected text.
  3. Press the single-quote key once, then Space to commit a literal apostrophe.
  4. Type il.
Expected behavior

The composer contains s' after step 3 and s'il after step 4. Accented letters should continue to compose normally.

Actual behavior

The composer contains s'´' after step 3, then s'il' after step 4. Accented letters work normally; committing an apostrophe is the broken case.

Impact

Frequent incorrect text when writing French with a dead-key keyboard layout.

Version and environment

Linux x64 desktop, 0.0.46-nightly.20261007.2774, also present in main at 611132c171f3a821bd2e32f22261135cef6330ac.

Investigation

The composer's handleTextInput treats any nonempty replacement range as selected text to surround with delimiters. ProseMirror can report a replacement range covering a provisional dead-key accent while the current editor selection is empty. Surrounding that accent with ' produces exactly s'´', then selects the accent so subsequent typing leaves a trailing apostrophe.

A focused test mounting the actual controlled ComposerPromptEditorTiptap in jsdom reproduces s'´' in both plain and rich-text modes when replaying this replacement. This is a replay of the editor's text-input boundary, not a native Linux keyboard-event capture.

Existing issues and PRs were searched for a duplicate. This report is specifically about committing a literal apostrophe, rather than accent composition or Markdown grave accents.

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
3 小时 20 分钟
30 天内合并 PR
208

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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