Repository navigation
Use the cap-location value for a Jupyter cell's caption class - #15348
Open
SAMARTHJAISWAL wants to merge 1 commit into
Open
SAMARTHJAISWAL wants to merge 1 commit into
SAMARTHJAISWAL wants to merge 1 commit into
Conversation
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
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #15281.
For a Jupyter cell, the
cap-locationoption added the classcaption-<fig-cap-location value>instead ofcaption-<cap-location value>, because the block insrc/core/jupyter/jupyter.tsreadkFigCapLoc. Withfig-cap-locationunset the cell ended up withcaption-undefined. The knitr hook andsrc/core/handlers/base.tsalready use thecap-locationvalue; this changes the Jupyter engine to match.Tested:
tests/docs/smoke-all/2026/11/12/issue-15281.ipynb: a notebook with stored outputs (execute: enabled: false) with one cell settingcap-location: topplusfig-cap-location: margin, and one cell setting onlycap-location: bottom. Onmainthe rendered cells getdata-cap-location="margin"and"undefined". With this change they get"top"and"bottom"..ipynbsmoke tests locally onmainand 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):
AI-assisted PR