quarto-dev / quarto-dev/quarto-cli

Incorrect "format" YAML value and maybe other fields only shows the first of many possible values

Open
#7,033 5 comments 1 reaction 1 assignee View on GitHub

@cscheid is already working on this.

Since Sep 27, 2023.

bug enhancement yaml-validation
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

This is originally at https://github.com/rstudio/rstudio/issues/11871

Error for the format field (and possibly others) in YAML only shows one possible value and states that it's the only possible value.

Steps to reproduce
  1. Create a Quarto document with the following bad YAML content and save it.
---
title: "Untitled"
editor: sss
format: markdow
---
  1. View in source or visual mode.
  2. Hover over the error icon next to the editor field. (This example uses source mode, but it's the same in visual mode.)
    • The info message identifies both possible values, source and visual.
source_error
  1. Hover over the error icon next to the format field. (This example uses visual mode, but it's the same in source mode.)
    • Only one item is identified as a possible value, asciidoc, even though there are dozens of possibilities.
    • The item shown is always the first one alphabetically, asciidoc, even though there are several possible legitimate values beginning with markdo, such as markdown, markdown_github, and others.
visual_error
Expected behavior

Either

  1. All possible values should be shown.
  2. This would probably look awful for something with a whole bunch of possible values—as is the case with the format field—so the error should probably not mention the possible values. (They're available with autocompletion.)
Actual behavior

Error for the format field (and possibly others) in YAML only shows one possible value and states that it's the only possible value.

Your environment
RStudio Edition : Desktop
RStudio Version : 2022.11.0-daily+153 and 2023.09.0+463
OS Version      : MacOS 13 and MacOS 14
R Version       : 4.2.1 and 4.3.1
Quarto check output
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.433
      Path: /Applications/RStudio-2023.09.0-463.app/Contents/Resources/app/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.11.4
      Path: /usr/local/opt/python@3.11/bin/python3.11
      Jupyter: (None)

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

[✓] Checking R installation...........OK
      Version: 4.3.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/ronblum/Library/R/x86_64/4.3/library
        - /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
      knitr: 1.44
      rmarkdown: 2.25

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.