features generate-docs: `$` sequences in NOTES.md and descriptions are expanded as String.replace patterns, splicing the README template into the output
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- cli
调研方向
模板在 src/spec-node/collectionCommonUtils/generateDocsCommandImpl.ts 的第170–182行附近填充,其中以字符串值调用了 .replace()。将针对用户提供内容(notes、name、description、选项描述)的这些调用替换为 replacer 函数,然后重新运行复现:包含 $ 的 NOTES.md 应原样出现在生成的 README.md 中,且模板不会出现第二份副本。当输出与预期文本一致,并且 $'、$& 和 $$ 也保持不变时,即完成。
由索引模型根据 Issue 内容生成。
描述
Problem
If a Feature's NOTES.md contains $` (for example the markdown `$`), the generated README.md gets a second copy of the README template at that point: the title, the description, and an "Example Usage" block with literal #{Registry}/#{Namespace}/<id>:#{Version} and #{Customizations}. $', $& and $$ also misbehave, and so do name, description and option descriptions in devcontainer-feature.json.
Repro (CLI 0.89.0; same on main at 155f8b2)
mkdir -p src/demo
echo '{ "id": "demo", "version": "1.0.0", "name": "Demo", "description": "A demo." }' > src/demo/devcontainer-feature.json
echo 'Escape quotes, `$` or backslashes.' > src/demo/NOTES.md
devcontainer features generate-docs -p src -n x/y
- Expected:
Escape quotes, `$` or backslashes. - Actual:
Escape quotes, `, then the template copy (# Demo (demo),## Example Usage,#{Registry}/#{Namespace}/demo:#{Version},#{Customizations}), then` or backslashes.
Cause
src/spec-node/collectionCommonUtils/generateDocsCommandImpl.ts:170-182 fills the template with .replace('#{…}', value). With a string replacement, String.prototype.replace expands $`, $', $& and $$ (MDN). The same code is in devcontainers/action src/generateDocs.ts:152-162.
Suggested fix
Pass a replacer function, as in .replace('#{Notes}', () => generateNotesMarkdown()), for every placeholder that takes user content.
Not the same as #1324, which is about how option values are sourced at build time.
- 主要语言
- TypeScript
- 星标
- 3k
- 派生
- 462
- 平均合并
- 13 小时 28 分钟
- 30 天内合并 PR
- 2
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
devcontainers/cli 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
devcontainers/cli#1203 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 68/100
devcontainers/cli#1178 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 45/100
devcontainers/cli#1324 ·
维护者通常 1 天内回复
-
`devcontainer build` fails on Buildx 0.37.2 because the generated Dockerfile is outside the Compose bake context可能已有人在做 @v-Kaniska244 于 4 天前认领。 未关闭
devcontainers/cli#1320 · 2 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
devcontainers/cli#1319 ·
维护者通常 1 天内回复
查看 devcontainers/cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
homarr-labs/dashboard-icons#2939 ·
维护者通常 1 天内回复
-
Agent/category reasoning variants are still checked against the stale model cache in chat.params未关闭opencode
难度 2/5 1-3 小时 新手友好度 75/100
code-yeongyu/oh-my-openagent#10003 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
nextcloud-libraries/nextcloud-dialogs#2669 ·
维护者通常 1 天内回复