Skip to content

Use the cap-location value for a Jupyter cell's caption class - #15348

Open
SAMARTHJAISWAL wants to merge 1 commit into
quarto-dev:mainfrom
SAMARTHJAISWAL:fix/jupyter-cap-location
Open

SAMARTHJAISWAL wants to merge 1 commit into
quarto-dev:mainfrom
SAMARTHJAISWAL:fix/jupyter-cap-location

Conversation

@SAMARTHJAISWAL

Copy link
Copy Markdown

Description

Fixes #15281.

For a Jupyter cell, the cap-location option added the class caption-<fig-cap-location value> instead of caption-<cap-location value>, because the block in src/core/jupyter/jupyter.ts read kFigCapLoc. With fig-cap-location unset the cell ended up with caption-undefined. The knitr hook and src/core/handlers/base.ts already use the cap-location value; this changes the Jupyter engine to match.

Tested:

  • New smoke test tests/docs/smoke-all/2026/11/12/issue-15281.ipynb: a notebook with stored outputs (execute: enabled: false) with one cell setting cap-location: top plus fig-cap-location: margin, and one cell setting only cap-location: bottom. On main the rendered cells get data-cap-location="margin" and "undefined". With this change they get "top" and "bottom".
  • Ran all .ipynb smoke tests locally on main and on this branch. The only difference is the new test, which now passes. The 2 other failures happen on both, because they need Jupyter installed and it isn't on my machine.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR (not needed, bug fix only)
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

The cap-location cell option added caption-<fig-cap-location> to the cell,
so the caption followed fig-cap-location, or got caption-undefined when that
was unset. The knitr engine already uses the cap-location value.

Fixes quarto-dev#15281
@posit-snyk-bot

posit-snyk-bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jupyter cell option cap-location writes caption-<fig-cap-location value> class

2 participants