Skip to content

Rmd handling in Positron is broken when there is a triple backtick immediately followed by prose on the next line #493

@DavisVaughan

Description

@DavisVaughan

See posit-dev/positron#4155

Create an Rmd with the following in it


Lets say you have two variables `x` and `y` that both point to the same underlying data.

```{r}
x <- c(1, 2, 3)
y <- x
```
If you modify `y`, R will first copy the values of `x` to a new position, then point `y` to the new location and only after the copy modify `y`.

```{r}
x <- 1
```

Note the triple backticks immediately followed by If you on the next line (no newline between them). This seems to cause issues.

Place your cursor on x <- 1 and try to run that line with Cmd + Enter, it will instead send this massive block to the console (in Positron):


`
If you modify `y`, R will first copy the values of `x` to a new position, then point `y` to the new location and only after the copy modify `y`.

```{r}
x <- 1
```


Also notice how the highlighting is off here:

Screenshot 2024-07-25 at 3 46 36 PM

A triple backtick immediately followed by prose on the next line works fine in RStudio (and highlights fine) so I think it should be supported here too.

quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.2: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.185
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /Users/davis/.pyenv/versions/3.12.2/bin/python3
      Jupyter: 5.7.2
      Kernels: ark, python3

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

[✓] Checking R installation...........OK
      Version: 4.4.1
      Path: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources
      LibPaths:
        - /Users/davis/Library/R/arm64/4.4/library
        - /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
      knitr: 1.48
      rmarkdown: 2.27

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions