Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r"" raw string function prevent Rmarkdown code to be collapsed #14680

Open
1 task
fcideco opened this issue May 8, 2024 · 5 comments
Open
1 task

r"" raw string function prevent Rmarkdown code to be collapsed #14680

fcideco opened this issue May 8, 2024 · 5 comments

Comments

@fcideco
Copy link

fcideco commented May 8, 2024

System details

RStudio Edition : Desktop
RStudio Version : 2024.04.0 Build 735 
OS Version      :  Windows 11 (x86_64-w64-mingw32)
R Version       : 4.3.3 (2024-02-29 ucrt)

Steps to reproduce the problem

Just create a notebook with some section headers
Add a code chunk with a r"" function to convert a path

---
title: "R Notebook"
output: html_notebook
---

This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. 

Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*. 

```{r}
plot(cars)
```

Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Ctrl+Alt+I*.

When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Ctrl+Shift+K* to preview the HTML file).

The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike *Knit*, *Preview* does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.

# First level section

## Second Level Section 
It can fold/collapse

```{r}
a_path <- r"(../path/to/file)"
```

## Second level section

Does not fold/collapse

```{r another_random_chunk}
x <- "a string" 
```

Describe the problem in detail

The sections below the chunk containing the r"" call will not be collapsible anymore.

Describe the behavior you expected

All headers should be collapsible in source view

  • [x ] I have read the guide for submitting good bug reports.
  • [x ] I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • [x ] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@fcideco fcideco added bug new New incoming issues, ready for initial review. labels May 8, 2024
@ronblum
Copy link
Contributor

ronblum commented May 9, 2024

@fcideco Thank you for raising the issue! I'm unable to reproduce it, though. What version of RStudio Desktop are you using? You can get it with Help -> About RStudio or with RStudio.Version()$long in the Console Pane.

@ronblum ronblum added info needed Additional information requested—reprex, steps, open question, etc. r markdown and removed new New incoming issues, ready for initial review. labels May 9, 2024
@fcideco
Copy link
Author

fcideco commented May 10, 2024

Sorry for the late reply.
I have updated the details in the original post.
RStudio version is 2024.04.0 Build 735.

@ronblum ronblum added this to the Cranberry Hibiscus milestone May 13, 2024
@ronblum ronblum self-assigned this May 13, 2024
@ronblum ronblum added regression and removed info needed Additional information requested—reprex, steps, open question, etc. labels May 13, 2024
@ronblum
Copy link
Contributor

ronblum commented May 15, 2024

@fcideco Thank you! I can also reproduce this, in RStudio Desktop 2024.07.0-daily+131 on Windows 11. Even something simple and incomplete like r"( will cause the problem.

@ronblum ronblum removed the qa repro label May 15, 2024
@kevinushey
Copy link
Contributor

I'm not sure if this is related, but I also note that the lower-most fold icon for the closing chunk is now incorrect; it should be pointing up to indicate that it will collapse the chunk.

Screenshot 2024-05-15 at 4 54 30 PM

@kevinushey kevinushey assigned kevinushey and unassigned ronblum May 30, 2024
@kevinushey
Copy link
Contributor

Looks like this is now fixed, most likely via #14760.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants