quarto-dev / quarto-dev/quarto

Incorrect comments for YAML multiline strings

Open
#1,095 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug vscode
Dominant language
TypeScript
Stars
645
Forks
62
Avg merge
17h 42m
Merged PRs (30d)
13

Description

Bug description

Hello, and apologies if this should be reported elsewhere.

When commenting out a .qmd line that's part of a YAML multiline string, I get # in Positron (which leads to an error when rendering). In RStudio, I get <!-- (which renders fine).

Many thanks in advance!

Steps to reproduce

Open the following .qmd in Positron, and then do "Add line comment" on either \setlength... or \usepackage....

---
title: "Hello"
format: 
  pdf:
    include-in-header: 
      text: |
        \setlength\parindent{.2in}
        \usepackage{indentfirst}
---

## Hello

Hello

Hello

The line gets prefixed by #. Finally, render and get and error:

ERROR: compilation failed- error You can't use `macro parameter character #' in vertical mode.
Expected behavior

In RStudio, the lines get commented out in HTML style, e.g.: <!-- \usepackage{indentfirst} -->. This renders without errors.

Your environment

Positron Version: 2026.08.1 build 2
Code - OSS Version: 1.124.0
Commit: 48dc4cee686939f35fe4a714d34375f67fd62082
Date: 2026-08-09T13:35:16-06:00
Electron: 42.2.0
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Linux x64 7.1.8-200.fc44.x86_64

Contributor guide

No contributing guide indexed for this repository

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 in Positron using the supplied .qmd example, applying “Add line comment” to either LaTeX line inside the YAML multiline string. Compare the generated comment with the expected HTML-style comment and verify that rendering completes without the reported LaTeX error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, yaml
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.