Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quarto inspect fails with !expr metadata #10039

Closed
rmflight opened this issue Jun 17, 2024 · 8 comments · Fixed by #10199
Closed

quarto inspect fails with !expr metadata #10039

rmflight opened this issue Jun 17, 2024 · 8 comments · Fixed by #10199
Assignees
Labels
bug Something isn't working regression Functionality that used to work but now is broken.
Milestone

Comments

@rmflight
Copy link

Bug description

Given a qmd document with multiple, computed figure captions generated using {glue}, quarto render happily renders the document. However, quarto inspect fails with a YAMLError: unknown tag

Steps to reproduce

---
title: "A Good Title"
date: last-modified
date-format: YYYY-MM-DD HH:mm
format: 
  html:
    self-contained: true
---

This is an example showing how to use {glue} in figure captions.

First, we set up our multiple variables.

```{r}
#| label: use-variables
library(ggplot2)
library(glue)
data(mtcars)
use_vars = c("mpg", "hp", "wt")

plot_list = list(mpg = ggplot(mtcars, aes(x = disp, y = mpg)) + geom_point(),
                 hp = ggplot(mtcars, aes(x = disp, y = hp)) + geom_point(),
                 wt = ggplot(mtcars, aes(x = disp, y = wt)) + geom_point())
```

And then multiple figures with different captions.

```{r}
#| label: fig-disp-other
#| fig-cap: !expr glue::glue("This should be {use_vars}")
#| fig-keep: all
purrr::walk(plot_list, \(in_plot){
  print(in_plot)
})
```

Expected behavior

I expect if quarto render works, then quarto inspect should work as well.

Actual behavior

quarto inspect generates an error.

Your environment

  • Running from the terminal.
  • Pop!OS 22.04 (Ubuntu based)
  • quarto 1.5.45

Quarto check output

  Deno version 1.41.0: OK
  Typst version 0.11.0: OK

[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.45
Path: /opt/quarto/bin

[✓] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/rmflight/.TinyTeX/bin/x86_64-linux
Version: 2022

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.10.12
Path: /usr/bin/python3
Jupyter: (None)

  Jupyter is not available in this Python installation.
  Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
Version: 4.3.0
Path: /rmflight_stuff/software/R-4.3.0
LibPaths:
- /home/rmflight/Projects/personal/targets_quarto_yaml/renv/library/R-4.3/x86_64-pc-linux-gnu
- /home/rmflight/.cache/R/renv/sandbox/R-4.3/x86_64-pc-linux-gnu/3f5517f9
knitr: 1.47
rmarkdown: 2.27

[✓] Checking Knitr engine render......OK

@rmflight rmflight added the bug Something isn't working label Jun 17, 2024
@mcanouil
Copy link
Collaborator

First self-contained was superseded nearly two years ago. The correct and documented option is embed-resources.

Regarding !expr, that's a knitr trick but in the end it's not valid YAML.
Quarto CLI cannot know what fig-cap: !expr glue::glue("This should be {use_vars}") is.
For short, !expr makes it hard if not impossible to provide YAML validation which is what is happening in your example.

I'll defer to @cscheid but I'm not sure Quarto can do something about this.

@rmflight
Copy link
Author

I get that the inspect CLI can't know what it is. And maybe this is part of the problem of deferring to the underlying engine for the render, in that quarto render works, when in this case I guess I expect it to fail, just as quarto inspect does.

@mcanouil
Copy link
Collaborator

mcanouil commented Jun 17, 2024

The syntax is still valid for knitr. Quarto won't break knitr features.

That's tricky as Quarto tries to be agnostics of the engine (Jupyter, Julia, and knitr).

@svraka
Copy link

svraka commented Jul 2, 2024

I just ran into the same issue after upgrading to 1.5. The example by @rmflight is rendered the same way on 1.4.556 and 1.5.52 but quarto inspect fails on 1.5.52.

The problem persist when quoting YAML tag literals. Take these files, which differ how YAML comments are quoted.

tag_double_quoted.qmd:

---
title: YAML tag literals, double quoted
---

```{r}
#| label: setup
#| include: false
library(ggplot2)

p <- split(mtcars, mtcars[["cyl"]])
p <- lapply(p, \(x) ggplot(x, aes(x = wt, y = mpg)) +
                      geom_point())
```

```{r}
#| label: plot
#| fig-cap: !expr "names(p)[[1]]"
p[[1]]
```

tag_single_quoted.qmd

---
title: YAML tag literals, single quoted
---

```{r}
#| label: setup
#| include: false
library(ggplot2)

p <- split(mtcars, mtcars[["cyl"]])
p <- lapply(p, \(x) ggplot(x, aes(x = wt, y = mpg)) +
                      geom_point())
```

```{r}
#| label: plot
#| fig-cap: !expr 'names(p)[[1]]'
p[[1]]
```

tag_plain.qmd:

---
title: YAML tag literals, plain
---

```{r}
#| label: setup
#| include: false
library(ggplot2)

p <- split(mtcars, mtcars[["cyl"]])
p <- lapply(p, \(x) ggplot(x, aes(x = wt, y = mpg)) +
                      geom_point())
```

```{r}
#| label: plot
#| fig-cap: !expr names(p)[[1]]
p[[1]]
```

All three are rendered properly under 1.4.556 and 1.5.52, all pass quarto inspect under 1.4.556, and all fail under 1.5.52. See output under the fold.

`quarto inspect` output
PS C:\Users\svraka\scratch\quarto_yaml_tag_literals> foreach ($v in @("1.4.556", "1.5.52")) { ls tag*.qmd | ForEach-Object { Write-Host $_; Invoke-Expression ("~\scoop\apps\quarto\{0}\bin\quarto inspect {1}" -f $v,$_) } }
C:\Users\svraka\scratch\quarto_yaml_tag_literals\tag_double_quoted.qmd
{
  "quarto": {
    "version": "1.4.556"
  },
  "engines": [
    "knitr"
  ],
  "formats": {
    "html": {
      "identifier": {
        "display-name": "HTML",
        "target-format": "html",
        "base-format": "html"
      },
      "execute": {
        "fig-width": 7,
        "fig-height": 5,
        "fig-format": "retina",
        "fig-dpi": 96,
        "df-print": "default",
        "error": false,
        "eval": true,
        "cache": null,
        "freeze": false,
        "echo": true,
        "output": true,
        "warning": true,
        "include": true,
        "keep-md": false,
        "keep-ipynb": false,
        "ipynb": null,
        "enabled": null,
        "daemon": null,
        "daemon-restart": false,
        "debug": false,
        "ipynb-filters": [],
        "ipynb-shell-interactivity": null,
        "plotly-connected": true,
        "engine": "knitr"
      },
      "render": {
        "keep-tex": false,
        "keep-typ": false,
        "keep-source": false,
        "keep-hidden": false,
        "prefer-html": false,
        "output-divs": true,
        "output-ext": "html",
        "fig-align": "default",
        "fig-pos": null,
        "fig-env": null,
        "code-fold": "none",
        "code-overflow": "scroll",
        "code-link": false,
        "code-line-numbers": false,
        "code-tools": false,
        "tbl-colwidths": "auto",
        "merge-includes": true,
        "inline-includes": false,
        "preserve-yaml": false,
        "latex-auto-mk": true,
        "latex-auto-install": true,
        "latex-clean": true,
        "latex-min-runs": 1,
        "latex-max-runs": 10,
        "latex-makeindex": "makeindex",
        "latex-makeindex-opts": [],
        "latex-tlmgr-opts": [],
        "latex-input-paths": [],
        "latex-output-dir": null,
        "link-external-icon": false,
        "link-external-newwindow": false,
        "self-contained-math": false,
        "format-resources": [],
        "notebook-links": true
      },
      "pandoc": {
        "standalone": true,
        "wrap": "none",
        "default-image-extension": "png",
        "to": "html",
        "output-file": "tag_double_quoted.html"
      },
      "language": {
        "toc-title-document": "Table of contents",
        "toc-title-website": "On this page",
        "related-formats-title": "Other Formats",
        "related-notebooks-title": "Notebooks",
        "source-notebooks-prefix": "Source",
        "other-links-title": "Other Links",
        "code-links-title": "Code Links",
        "launch-dev-container-title": "Launch Dev Container",
        "launch-binder-title": "Launch Binder",
        "article-notebook-label": "Article Notebook",
        "notebook-preview-download": "Download Notebook",
        "notebook-preview-download-src": "Download Source",
        "notebook-preview-back": "Back to Article",
        "manuscript-meca-bundle": "MECA Bundle",
        "section-title-abstract": "Abstract",
        "section-title-appendices": "Appendices",
        "section-title-footnotes": "Footnotes",
        "section-title-references": "References",
        "section-title-reuse": "Reuse",
        "section-title-copyright": "Copyright",
        "section-title-citation": "Citation",
        "appendix-attribution-cite-as": "For attribution, please cite this work as:",
        "appendix-attribution-bibtex": "BibTeX citation:",
        "title-block-author-single": "Author",
        "title-block-author-plural": "Authors",
        "title-block-affiliation-single": "Affiliation",
        "title-block-affiliation-plural": "Affiliations",
        "title-block-published": "Published",
        "title-block-modified": "Modified",
        "title-block-keywords": "Keywords",
        "callout-tip-title": "Tip",
        "callout-note-title": "Note",
        "callout-warning-title": "Warning",
        "callout-important-title": "Important",
        "callout-caution-title": "Caution",
        "code-summary": "Code",
        "code-tools-menu-caption": "Code",
        "code-tools-show-all-code": "Show All Code",
        "code-tools-hide-all-code": "Hide All Code",
        "code-tools-view-source": "View Source",
        "code-tools-source-code": "Source Code",
        "tools-share": "Share",
        "tools-download": "Download",
        "code-line": "Line",
        "code-lines": "Lines",
        "copy-button-tooltip": "Copy to Clipboard",
        "copy-button-tooltip-success": "Copied!",
        "repo-action-links-edit": "Edit this page",
        "repo-action-links-source": "View source",
        "repo-action-links-issue": "Report an issue",
        "back-to-top": "Back to top",
        "search-no-results-text": "No results",
        "search-matching-documents-text": "matching documents",
        "search-copy-link-title": "Copy link to search",
        "search-hide-matches-text": "Hide additional matches",
        "search-more-match-text": "more match in this document",
        "search-more-matches-text": "more matches in this document",
        "search-clear-button-title": "Clear",
        "search-text-placeholder": "",
C:\Users\svraka\scratch\quarto_yaml_tag_literals\tag_plain.qmd
{
  "quarto": {
    "version": "1.4.556"
  },
  "engines": [
    "knitr"
  ],
  "formats": {
    "html": {
      "identifier": {
        "display-name": "HTML",
        "target-format": "html",
        "base-format": "html"
      },
      "execute": {
        "fig-width": 7,
        "fig-height": 5,
        "fig-format": "retina",
        "fig-dpi": 96,
        "df-print": "default",
        "error": false,
        "eval": true,
        "cache": null,
        "freeze": false,
        "echo": true,
        "output": true,
        "warning": true,
        "include": true,
        "keep-md": false,
        "keep-ipynb": false,
        "ipynb": null,
        "enabled": null,
        "daemon": null,
        "daemon-restart": false,
        "debug": false,
        "ipynb-filters": [],
        "ipynb-shell-interactivity": null,
        "plotly-connected": true,
        "engine": "knitr"
      },
      "render": {
        "keep-tex": false,
        "keep-typ": false,
        "keep-source": false,
        "keep-hidden": false,
        "prefer-html": false,
        "output-divs": true,
        "output-ext": "html",
        "fig-align": "default",
        "fig-pos": null,
        "fig-env": null,
        "code-fold": "none",
        "code-overflow": "scroll",
        "code-link": false,
        "code-line-numbers": false,
        "code-tools": false,
        "tbl-colwidths": "auto",
        "merge-includes": true,
        "inline-includes": false,
        "preserve-yaml": false,
        "latex-auto-mk": true,
        "latex-auto-install": true,
        "latex-clean": true,
        "latex-min-runs": 1,
        "latex-max-runs": 10,
        "latex-makeindex": "makeindex",
        "latex-makeindex-opts": [],
        "latex-tlmgr-opts": [],
        "latex-input-paths": [],
        "latex-output-dir": null,
        "link-external-icon": false,
        "link-external-newwindow": false,
        "self-contained-math": false,
        "format-resources": [],
        "notebook-links": true
      },
      "pandoc": {
        "standalone": true,
        "wrap": "none",
        "default-image-extension": "png",
        "to": "html",
        "output-file": "tag_plain.html"
      },
      "language": {
        "toc-title-document": "Table of contents",
        "toc-title-website": "On this page",
        "related-formats-title": "Other Formats",
        "related-notebooks-title": "Notebooks",
        "source-notebooks-prefix": "Source",
        "other-links-title": "Other Links",
        "code-links-title": "Code Links",
        "launch-dev-container-title": "Launch Dev Container",
        "launch-binder-title": "Launch Binder",
        "article-notebook-label": "Article Notebook",
        "notebook-preview-download": "Download Notebook",
        "notebook-preview-download-src": "Download Source",
        "notebook-preview-back": "Back to Article",
        "manuscript-meca-bundle": "MECA Bundle",
        "section-title-abstract": "Abstract",
        "section-title-appendices": "Appendices",
        "section-title-footnotes": "Footnotes",
        "section-title-references": "References",
        "section-title-reuse": "Reuse",
        "section-title-copyright": "Copyright",
        "section-title-citation": "Citation",
        "appendix-attribution-cite-as": "For attribution, please cite this work as:",
        "appendix-attribution-bibtex": "BibTeX citation:",
        "title-block-author-single": "Author",
        "title-block-author-plural": "Authors",
        "title-block-affiliation-single": "Affiliation",
        "title-block-affiliation-plural": "Affiliations",
        "title-block-published": "Published",
        "title-block-modified": "Modified",
        "title-block-keywords": "Keywords",
        "callout-tip-title": "Tip",
        "callout-note-title": "Note",
        "callout-warning-title": "Warning",
        "callout-important-title": "Important",
        "callout-caution-title": "Caution",
        "code-summary": "Code",
        "code-tools-menu-caption": "Code",
        "code-tools-show-all-code": "Show All Code",
        "code-tools-hide-all-code": "Hide All Code",
        "code-tools-view-source": "View Source",
        "code-tools-source-code": "Source Code",
        "tools-share": "Share",
        "tools-download": "Download",
        "code-line": "Line",
        "code-lines": "Lines",
        "copy-button-tooltip": "Copy to Clipboard",
        "copy-button-tooltip-success": "Copied!",
        "repo-action-links-edit": "Edit this page",
        "repo-action-links-source": "View source",
        "repo-action-links-issue": "Report an issue",
        "back-to-top": "Back to top",
        "search-no-results-text": "No results",
        "search-matching-documents-text": "matching documents",
        "search-copy-link-title": "Copy link to search",
        "search-hide-matches-text": "Hide additional matches",
        "search-more-match-text": "more match in this document",
        "search-more-matches-text": "more matches in this document",
        "search-clear-button-title": "Clear",
        "search-text-placeholder": "",
C:\Users\svraka\scratch\quarto_yaml_tag_literals\tag_single_quoted.qmd
{
  "quarto": {
    "version": "1.4.556"
  },
  "engines": [
    "knitr"
  ],
  "formats": {
    "html": {
      "identifier": {
        "display-name": "HTML",
        "target-format": "html",
        "base-format": "html"
      },
      "execute": {
        "fig-width": 7,
        "fig-height": 5,
        "fig-format": "retina",
        "fig-dpi": 96,
        "df-print": "default",
        "error": false,
        "eval": true,
        "cache": null,
        "freeze": false,
        "echo": true,
        "output": true,
        "warning": true,
        "include": true,
        "keep-md": false,
        "keep-ipynb": false,
        "ipynb": null,
        "enabled": null,
        "daemon": null,
        "daemon-restart": false,
        "debug": false,
        "ipynb-filters": [],
        "ipynb-shell-interactivity": null,
        "plotly-connected": true,
        "engine": "knitr"
      },
      "render": {
        "keep-tex": false,
        "keep-typ": false,
        "keep-source": false,
        "keep-hidden": false,
        "prefer-html": false,
        "output-divs": true,
        "output-ext": "html",
        "fig-align": "default",
        "fig-pos": null,
        "fig-env": null,
        "code-fold": "none",
        "code-overflow": "scroll",
        "code-link": false,
        "code-line-numbers": false,
        "code-tools": false,
        "tbl-colwidths": "auto",
        "merge-includes": true,
        "inline-includes": false,
        "preserve-yaml": false,
        "latex-auto-mk": true,
        "latex-auto-install": true,
        "latex-clean": true,
        "latex-min-runs": 1,
        "latex-max-runs": 10,
        "latex-makeindex": "makeindex",
        "latex-makeindex-opts": [],
        "latex-tlmgr-opts": [],
        "latex-input-paths": [],
        "latex-output-dir": null,
        "link-external-icon": false,
        "link-external-newwindow": false,
        "self-contained-math": false,
        "format-resources": [],
        "notebook-links": true
      },
      "pandoc": {
        "standalone": true,
        "wrap": "none",
        "default-image-extension": "png",
        "to": "html",
        "output-file": "tag_single_quoted.html"
      },
      "language": {
        "toc-title-document": "Table of contents",
        "toc-title-website": "On this page",
        "related-formats-title": "Other Formats",
        "related-notebooks-title": "Notebooks",
        "source-notebooks-prefix": "Source",
        "other-links-title": "Other Links",
        "code-links-title": "Code Links",
        "launch-dev-container-title": "Launch Dev Container",
        "launch-binder-title": "Launch Binder",
        "article-notebook-label": "Article Notebook",
        "notebook-preview-download": "Download Notebook",
        "notebook-preview-download-src": "Download Source",
        "notebook-preview-back": "Back to Article",
        "manuscript-meca-bundle": "MECA Bundle",
        "section-title-abstract": "Abstract",
        "section-title-appendices": "Appendices",
        "section-title-footnotes": "Footnotes",
        "section-title-references": "References",
        "section-title-reuse": "Reuse",
        "section-title-copyright": "Copyright",
        "section-title-citation": "Citation",
        "appendix-attribution-cite-as": "For attribution, please cite this work as:",
        "appendix-attribution-bibtex": "BibTeX citation:",
        "title-block-author-single": "Author",
        "title-block-author-plural": "Authors",
        "title-block-affiliation-single": "Affiliation",
        "title-block-affiliation-plural": "Affiliations",
        "title-block-published": "Published",
        "title-block-modified": "Modified",
        "title-block-keywords": "Keywords",
        "callout-tip-title": "Tip",
        "callout-note-title": "Note",
        "callout-warning-title": "Warning",
        "callout-important-title": "Important",
        "callout-caution-title": "Caution",
        "code-summary": "Code",
        "code-tools-menu-caption": "Code",
        "code-tools-show-all-code": "Show All Code",
        "code-tools-hide-all-code": "Hide All Code",
        "code-tools-view-source": "View Source",
        "code-tools-source-code": "Source Code",
        "tools-share": "Share",
        "tools-download": "Download",
        "code-line": "Line",
        "code-lines": "Lines",
        "copy-button-tooltip": "Copy to Clipboard",
        "copy-button-tooltip-success": "Copied!",
        "repo-action-links-edit": "Edit this page",
        "repo-action-links-source": "View source",
        "repo-action-links-issue": "Report an issue",
        "back-to-top": "Back to top",
        "search-no-results-text": "No results",
        "search-matching-documents-text": "matching documents",
        "search-copy-link-title": "Copy link to search",
        "search-hide-matches-text": "Hide additional matches",
        "search-more-match-text": "more match in this document",
        "search-more-matches-text": "more matches in this document",
        "search-clear-button-title": "Clear",
        "search-text-placeholder": "",
C:\Users\svraka\scratch\quarto_yaml_tag_literals\tag_double_quoted.qmd
ERROR: YAMLError: unknown tag !<!expr> at line 2, column 31:
    fig-cap: !expr "names(p)[[1]]"
                                  ^

Stack trace:
    fig-cap: !expr "names(p)[[1]]"
                                  ^
    at generateError (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:10476:12)
    at throwError (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:10479:11)
    at composeNode (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11346:20)
    at readBlockMapping (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11113:17)
    at composeNode (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11295:84)
    at readDocument (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11409:5)
    at loadDocuments (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11444:9)
    at load (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11449:23)
    at parse1 (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11459:12)
    at inner (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:40317:53)
C:\Users\svraka\scratch\quarto_yaml_tag_literals\tag_plain.qmd
ERROR: YAMLError: unknown tag !<!expr> at line 2, column 29:
    fig-cap: !expr names(p)[[1]]
                                ^

Stack trace:
    fig-cap: !expr names(p)[[1]]
                                ^
    at generateError (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:10476:12)
    at throwError (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:10479:11)
    at composeNode (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11346:20)
    at readBlockMapping (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11113:17)
    at composeNode (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11295:84)
    at readDocument (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11409:5)
    at loadDocuments (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11444:9)
    at load (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11449:23)
    at parse1 (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11459:12)
    at inner (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:40317:53)
C:\Users\svraka\scratch\quarto_yaml_tag_literals\tag_single_quoted.qmd
ERROR: YAMLError: unknown tag !<!expr> at line 2, column 31:
    fig-cap: !expr 'names(p)[[1]]'
                                  ^

Stack trace:
    fig-cap: !expr 'names(p)[[1]]'
                                  ^
    at generateError (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:10476:12)
    at throwError (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:10479:11)
    at composeNode (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11346:20)
    at readBlockMapping (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11113:17)
    at composeNode (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11295:84)
    at readDocument (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11409:5)
    at loadDocuments (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11444:9)
    at load (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11449:23)
    at parse1 (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:11459:12)
    at inner (file:///C:/Users/svraka/scoop/apps/quarto/1.5.52/bin/quarto.js:40317:53)

@salim-b
Copy link
Contributor

salim-b commented Jul 2, 2024

I'll defer to @cscheid but I'm not sure Quarto can do something about this.

(...)

Quarto won't break knitr features.

Quarto 1.5.x did break the !expr knitr feature. As already noted by @svraka, quarto inspect on a project that contains some !expr in a knitr chunk worked fine in Quarto 1.4.x., but errors in Quarto 1.5.x.

This is a major pain for users relying on quarto inspect programmatically (e.g. via quarto::quarto_inspect()).

@mcanouil mcanouil added the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Jul 2, 2024
@svraka
Copy link

svraka commented Jul 2, 2024

All three are rendered properly under 1.4.556 and 1.5.52, all pass quarto inspect under 1.4.556, and all fail under 1.5.52. See output under the fold.

Did some further tests using the 1.5 Windows pre-releases, and the regression was introduced between 1.5.28 and 1.5.29. After skimming the changelog, might be #9264.

@cscheid
Copy link
Collaborator

cscheid commented Jul 2, 2024

I think I missed this earlier because it had no milestone attached to it, I apologize. We'll fix ASAP.

@cscheid cscheid added this to the Hot-fix milestone Jul 2, 2024
@cscheid cscheid added regression Functionality that used to work but now is broken. and removed triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. labels Jul 2, 2024
@cscheid cscheid changed the title quarto inspect fails when render works quarto inspect fails with !expr metadata Jul 2, 2024
@cscheid
Copy link
Collaborator

cscheid commented Jul 3, 2024

This is fixed on main and v1.5. New v1.6 installer will be out shortly, and we expect a new v1.5 patch release on the 8th.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Functionality that used to work but now is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants