Jupyter cell option cap-location writes caption-<fig-cap-location value> class
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 90/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- jupyter, typescript
- 领域
- backend
调研方向
在 src/core/jupyter/jupyter.ts 中检查 kCapLoc 附近的单元格类代码块;issue 指出它在构建 caption 类时读取的是 kFigCapLoc。对比 hooks.R 中对同一选项的处理方式。完成标准是 Jupyter 使用 cap-location 的值作为 .caption-*,并且报告中的示例会生成 .caption-top .fig-cap-location-margin。
由索引模型根据 Issue 内容生成。
描述
Bug description
For a Jupyter cell, the cap-location cell option adds the class caption-<value of fig-cap-location> to the cell div instead of caption-<value of cap-location>.
The code is in src/core/jupyter/jupyter.ts (the cell-class block, near kCapLoc):
if (typeof cell.options[kCapLoc] === "string") {
classes.push(`caption-${cell.options[kFigCapLoc]}`); // reads kFigCapLoc, not kCapLoc
}
The knitr hook in hooks.R does it correctly (paste0("caption-", options[["cap-location"]])), so the two engines disagree for the same option.
Reproduction
I ran this on a stored notebook with quarto render t.ipynb --to html --no-execute -M keep-md:true and read the intermediate markdown. One code cell, with a PNG in its stored output, whose source is:
#| cap-location: top
#| fig-cap-location: margin
plot()
Result:
::: {#cell-0 .cell .caption-margin .fig-cap-location-margin execution_count=1}
Expected .caption-top .fig-cap-location-margin.
With cap-location set and fig-cap-location unset, the code above would produce .caption-undefined. I read that from the code and did not run it.
Other implementations that copied this block carry the same bug.
Environment
A development checkout of quarto-cli (quarto --version reports 99.9.9), macOS, Jupyter engine with stored outputs (--no-execute).
- 主要语言
- JavaScript
- 星标
- 6.1k
- 派生
- 478
- 平均合并
- 17 小时 36 分钟
- 30 天内合并 PR
- 139
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/quarto-cli 的其他 Issue
-
enhancement good-first-issue localization
难度 2/5 1-2 天 新手友好度 76/100
quarto-dev/quarto-cli#15289 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement localization
难度 2/5 1-3 小时 新手友好度 65/100
quarto-dev/quarto-cli#15268 · 1 条评论 ·
维护者通常 1 天内回复
-
html maintenance
难度 2/5 1-3 小时 新手友好度 84/100
quarto-dev/quarto-cli#15261 ·
维护者通常 1 天内回复
-
enhancement websites
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/quarto-cli#15255 · 1 条评论 ·
维护者通常 1 天内回复
-
quarto.json.decode does not raise on invalid JSON, so pcall cannot catch it可能已有人在做 @sogav21 于 4 天前认领。 未关闭bug lua
难度 2/5 1-3 小时 新手友好度 84/100
quarto-dev/quarto-cli#15226 ·
维护者通常 1 天内回复
查看 quarto-dev/quarto-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
help wanted Idea 💡 wdio-cli
难度 2/5 1-3 小时 新手友好度 66/100
webdriverio/webdriverio#16361 · 2 条评论 ·
维护者通常 1 天内回复
-
bug new-client
难度 1/5 1-3 小时 新手友好度 88/100
NUWCDIVNPT/stig-manager#2285 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
Fei2411/DeepSeek-Bot#922 · 1 个 reaction ·