File picker button labels show HTML entities for file names with special characters
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
阅读 lib/filepicker-builder.ts 第 218–241 行附近的内容,这里会创建选择器按钮的默认标签,并查找相关的标签测试。检查 gettext 如何转义占位符值,以及标签如何作为文本渲染。更新标签,使包含撇号和与号的名称能原样显示,然后添加一个覆盖这些字符的测试。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The file picker button labels that contain a file or folder name show HTML entities when the name contains characters like ', &, < or ", e.g. Choose Tom's folder or Copy to A & B.
The labels are built with the gettext wrapper, which HTML-escapes placeholder values by default:
label = t('Choose {file}', { file: target })
// …
label: target ? t('Copy to {target}', { target }) : t('Copy'),
// …
label: target ? t('Move to {target}', { target }) : t('Move'),
The result is then rendered as plain button text (not as HTML), so the escaped entities are shown literally.
Originally reported in nextcloud/server#55191 for the "Set default folder for accepted shares" picker in the personal sharing settings, but it affects every picker using these default buttons (e.g. "Copy to …" / "Move to …" in the Files app).
To Reproduce
Found by code reading and the screenshot in nextcloud/server#55191.
- Create a folder named
Tom's files. - Open a file picker that uses the default buttons (e.g. "Move or copy" in Files) and select that folder.
- The button shows
Copy to Tom's files.
Expected behavior
The labels show the plain name: either pass the placeholders unescaped (the labels are rendered as text, so no HTML escaping is needed there) or skip escaping for these button labels, with a test for a name containing ' and &.
- 主要语言
- TypeScript
- 星标
- 19
- 派生
- 10
- 平均合并
- 17 小时 4 分钟
- 30 天内合并 PR
- 30
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nextcloud-libraries/nextcloud-dialogs 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
nextcloud-libraries/nextcloud-dialogs#2772 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
nextcloud-libraries/nextcloud-dialogs#2771 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
nextcloud-libraries/nextcloud-dialogs#2756 · 1 个 reaction ·
维护者通常 1 天内回复
-
1. to develop
难度 2/5 1-3 小时 新手友好度 65/100
nextcloud-libraries/nextcloud-dialogs#2669 · 1 条评论 ·
维护者通常 1 天内回复
-
1. to develop
难度 4/5 3-5 天 新手友好度 48/100
nextcloud-libraries/nextcloud-dialogs#2510 · 2 条评论 ·
维护者通常 1 天内回复
查看 nextcloud-libraries/nextcloud-dialogs 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Make the "%" unit spacing the same in the web and in A10可能已有人在做 @kragent66-glitch 今天认领。 未关闭bug good first issue
难度 2/5 1-3 小时 新手友好度 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 条评论 ·
-
Editor: leave an uploaded or inserted image's alt text empty, so the preview asks for a description未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 65/100
sveltejs/svelte.dev#2417 ·
维护者通常 1 天内回复
-
[Bug]: A Markdown link with both a :line suffix and a #L fragment opens a path containing ":line"未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复