diff --git a/news/changelog-1.12.md b/news/changelog-1.12.md index 9d1014a83a..c65a17a99f 100644 --- a/news/changelog-1.12.md +++ b/news/changelog-1.12.md @@ -52,6 +52,12 @@ All changes included in 1.12: - ([#15063](https://github.com/quarto-dev/quarto-cli/issues/15063)): Fix a format extension's own `language` file stopping the render with a "does not exist" error, and its `metadata-files` being ignored. Both now resolve relative to the extension's directory, and per-language files such as `_language-fr.yml` load beside the `language` file. (author: @mcanouil) +## Engines + +### `jupyter` + +- ([#15281](https://github.com/quarto-dev/quarto-cli/issues/15281)): Fix the `cap-location` cell option in Jupyter notebooks using the `fig-cap-location` value instead of its own. (author: @SAMARTHJAISWAL) + ## Other fixes and improvements - ([#14389](https://github.com/quarto-dev/quarto-cli/pull/14389)): Add `ar` (Arabic) language translation. The `skip-to-content`, `navigation-*-label`, `scrollable-*-label`, `link-external-newwindow-label`, `announcement-dismiss-label` and `revealjs-menu-button-label` keys use reviewed machine translation. (author: @ezAldinWaez) diff --git a/src/core/jupyter/jupyter.ts b/src/core/jupyter/jupyter.ts index 286bfb902c..909be78cab 100644 --- a/src/core/jupyter/jupyter.ts +++ b/src/core/jupyter/jupyter.ts @@ -1408,7 +1408,7 @@ async function mdFromCodeCell( classes.push(`tbl-column-${cell.options[kCellTblColumn]}`); } if (typeof cell.options[kCapLoc] === "string") { - classes.push(`caption-${cell.options[kFigCapLoc]}`); + classes.push(`caption-${cell.options[kCapLoc]}`); } if (typeof cell.options[kFigCapLoc] === "string") { classes.push(`fig-cap-location-${cell.options[kFigCapLoc]}`); diff --git a/tests/docs/smoke-all/2026/11/12/issue-15281.ipynb b/tests/docs/smoke-all/2026/11/12/issue-15281.ipynb new file mode 100644 index 0000000000..930a3cfd4d --- /dev/null +++ b/tests/docs/smoke-all/2026/11/12/issue-15281.ipynb @@ -0,0 +1,86 @@ +{ + "cells": [ + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "---\n", + "title: \"Jupyter cell option cap-location\"\n", + "format: html\n", + "execute:\n", + " enabled: false\n", + "_quarto:\n", + " tests:\n", + " html:\n", + " ensureHtmlElements:\n", + " - ['div#cell-cell-both.cell[data-cap-location=\"top\"]', 'div#cell-cell-cap-only.cell[data-cap-location=\"bottom\"]']\n", + " - ['div.cell[data-cap-location=\"margin\"]', 'div.cell[data-cap-location=\"undefined\"]']\n", + "---" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `cap-location` cell option sets the `caption-` class from its own value, not from `fig-cap-location`." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#| label: cell-both\n", + "#| cap-location: top\n", + "#| fig-cap-location: margin\n", + "1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#| label: cell-cap-only\n", + "#| cap-location: bottom\n", + "1" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}