Skip to content

Add lint warning when code block is indented inconsistently inside list #3325

@ajb5d

Description

@ajb5d

Bug description

I'm trying to include a code block in a numbered list and I'm getting unexpected output:

Input:

---
title: "Test"
author: "Andew Barros"
format: html
---

1. Question

    ```{r}
    1 + 1
    ```

1. Question 2

Output:

1. Question

1 + 1

::: {.cell-output .cell-output-stdout} [1] 2 ::: :::

2. Question 2

(The line with ::: is visible in the output both when rendered to html and PDF).

If I render that same file through the rmarkdown pathway -- I get the intended output

I'm using RStudio 2022.07.2 Build 576 on MacOS 13.0.1

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Metadata

Metadata

Assignees

Labels

astissues related to AST processingenhancementNew feature or requestlintlinting-related issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions