quarto-dev / quarto-dev/quarto-cli

kbd doesn't work as intend when used as a variable

Open
#9,542 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug description

In 1.3, I could include a {{< kbd ... >}} within the _variables.yml file and use {{< var ... >}} with it. Now, in both 1.4 and 1.5, it doesn't work as previously.

Steps to reproduce

Create a new simple Quarto Project with RStudio.

In the index.qmd file, include:

---
title: "test"
---

{{< var test >}}

{{< kbd mac=Cmd-Shift-P win=Ctrl-Shift-P linux=Ctrl-Shift-P >}}

In the _variables.yml file, include:

test: '{{< kbd mac=Cmd-Shift-P win=Ctrl-Shift-P linux=Ctrl-Shift-P >}}'

And render it.

Expected behavior

It should print something like Ctrl-Shift-P twice (in this example).

Actual behavior

Instead it looks like:

mac=Cmd-Shift-P

Ctrl-Shift-P
Your environment
  • RStudio 2023.06
  • Quarto 1.5 (and tried on 1.4 as well)
  • Ubuntu 22.04
Quarto check output
Quarto 1.5.31
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.13: OK
      Dart Sass version 1.70.0: OK
      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.31
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2023.05
      Chromium: (not installed)

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

[✓] 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.4.0
      Path: /usr/lib/R
      LibPaths:
        - /home/luke/R/x86_64-pc-linux-gnu-library/4.4
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.46
      rmarkdown: 2.26

[✓] 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.

Research direction

Reproduce the issue with the provided index.qmd and _variables.yml examples using Quarto 1.4 or 1.5, then compare the rendered variable and direct kbd output. Done means the variable renders the same platform-specific shortcut as the direct kbd usage, such as Ctrl-Shift-P, without exposing the mac= value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
content
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.