Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ All changes included in 1.7:
- ([#11951](https://github.com/quarto-dev/quarto-cli/issues/11951)): Raw LaTeX table without `tbl-` prefix label for using Quarto crossref are now correctly passed through unmodified.
- ([#11967](https://github.com/quarto-dev/quarto-cli/issues/11967)): Produce a better error message when YAML metadata with `!expr` tags are used outside of `knitr` code cells.
- ([#12117](https://github.com/quarto-dev/quarto-cli/issues/12117)): Color output to stdout and stderr is now correctly rendered for `html` format in the Jupyter and Julia engines.
- ([#12167](https://github.com/quarto-dev/quarto-cli/issues/12167)): Figure numbering for multiple top-level figures and not as Sub-Figures.
- ([#12264](https://github.com/quarto-dev/quarto-cli/issues/12264)): Upgrade `dart-sass` to 1.85.1.
- ([#12238](https://github.com/quarto-dev/quarto-cli/issues/12238)): Do not truncate very long console errors (e.g. in Jupyter Notebook with backtrace).
- ([#12338](https://github.com/quarto-dev/quarto-cli/issues/12338)): Add an additional workaround for the SCSS parser used in color variable extraction.
Expand Down
21 changes: 17 additions & 4 deletions src/core/jupyter/jupyter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { ensureDirSync, walkSync } from "../../deno_ral/fs.ts";
import { dirname, extname, join, relative } from "../../deno_ral/path.ts";
import { warning } from "../../deno_ral/log.ts";
import * as colors from "fmt/colors";
import { decodeBase64 as base64decode } from "encoding/base64";
import { stringify } from "../yaml.ts";
Expand Down Expand Up @@ -1554,10 +1555,22 @@ async function mdFromCodeCell(

for (const { index, output } of sortedOutputs) {
// compute output label
const outputLabel = label && labelCellContainer && isDisplayData(output)
? (label + "-" + nextOutputSuffix++)
: label;

let outputLabel_tmp = label;
if (label &&
(
labelCellContainer ||
(Array.isArray(sortedOutputs) && (sortedOutputs.length > 1))
) &&
isDisplayData(output)) {
outputLabel_tmp = label + "-" + nextOutputSuffix++;
// If the user specifies a top-level array for images but also labels give a warning.
if (labelCellContainer === false &&
(Array.isArray(sortedOutputs) == true && (sortedOutputs.length > 1))
) {
warning("Warning: using multiple top-level figures with labels might result in unwanted behaviour: " + label)
}
}
const outputLabel = outputLabel_tmp
// If this output has been marked to not be displayed
// just continue
if (output.metadata?.[kQuartoOutputDisplay] === false) {
Expand Down
Loading