Rstudio visual editor breaking markdown language

Hi all,
I've got a super annoying bug I don't know how to fix. For some reason when I open the RStudio Visual Editor, regular markdown language does not work any more when I knit the document. Even if I close R completely and open a new project in a new session, my text is still messed up when I knit. It only looks the way it is supposed to if I re-open the document in the Visual Editor and make the changes with that.

Here's a screen shot of how a recent document I tried to knit came out:

And here's how I typed in the markdown syntax:

Day 2

  1. Slides
  2. Problem 1, by hand, for 0.5 points on the quiz
  3. Problems 2 and 3 in the software, submitted to Canvas.
  4. Quiz review, if we have time.

Does anyone know how to fix this?

Can you share information so that we can reproduce ? Currently it working as expected when I try.

please update your RStudio possibly to last daily version.

If you can share code or document we can copy paste it would help

So this never came up until I opened the RStudio Visual Editor, and ever since, the projects that I have used it in have trouble displaying any text that I wrote in plain markdown. Currently on Windows 11, but I also had this same issue on Windows 10.

An example markdown having this problem--which is a markdown file in an R Project--is here:

title: "Lecture plans"
output: html_document

# Chapter 1
***Day 1***

# Chapter 10: Independent samples t-test
***Day 1***
1. Chapter 9 JASP/SPSS example
2. Chapter 10 content lecture (situation/methods design and formula)
3. By hand problem (Hunger games, problem 1)
4. (if we get to it) Software problem (Hunger games, problem 2)

***Day 2***
1. Slides
2. Problem 1, by hand, for 0.5 points on the quiz
3. Problems 2 and 3 in the software, submitted to Canvas.
4. Quiz review, if we have time.

# Chapter 11: Repeated samples t-test
***Day 1***
*Chapter 11 "mega lecture"*
1. Start out with review of concepts
2. They do the first practice problem
3. I walk through the practice problem for chapter 11
4. They do the practice problem on slide 48 (sleep and studying) *in Excel to speed things up*

Review questions on all three types of t-tests???

***Day 2***
1. HW 3 review (post video)
2. Finish Chapter 11
3. Quiz

# Chapter 12: ANOVA
***Day 1***
1. Review quiz?
2. Chapter 11 Hunger Games final example
3. Chapter 12 lecture
   1. They do practice problem # 1 at slide 8
   2. I walk them through the example starting on slide 20
   3. They end with a by-hand Excel problem (last slide; corresponds to the blank sheet in the Excel workbook)

***Day 2***
1. Announcement: No class next Friday (TG)
2. Cover super important details and main takeaways from HW3

# Chapter 13: TWo-way ANOVA
***One day only***
1. Content lecture
2. Walk through example in slides

## Chapter 14: Correlation and Regression

***Day 1***

1. Cover answers to ANOVA practice guide
2. Multi-factorial (Two-way) ANOVA example???
3. Some kind of recap of all tests so far??? Prep for regression?
4. Slides for correlation
5. Correlation practice- just a simple example for them to run, like Z had. I cover stuff; they run a correlation; we discuss it

## Chapter 15: Chi-square

***Day 1***

1. Cover HW #4 
2. Content lecture
3. Practice problem (Navarro walk through)
4. Practice problem (self-guided; Practice word doc)

***Day 2***

1. Content lecture
2. Quiz

I should also note that ever since I opened the Visual Editor, there's this annoying vertical line down all my scripts that won't go away, regardless of session/project and if the Editor was used or not. Looks like this:

When knit, it comes out looking like the screen capture posted in the original post. If I open the Visual Editor though and I make all changes with the VE, the text will stay properly formatted and will knit when it's supposed to. It's only messed up if I try to write regular markdown language without using the VE.

R session info is here:

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7          pillar_1.6.4        compiler_4.1.2      tools_4.1.2         digest_0.6.29       see_0.6.8          
 [7] gtable_0.3.0        lubridate_1.8.0     evaluate_0.14       lifecycle_1.0.1     tibble_3.1.6        pkgconfig_2.0.3    
[13] rlang_0.4.12        DBI_1.1.1           ggrepel_0.9.1       yaml_2.2.1          xfun_0.28           fastmap_1.1.0      
[19] gridExtra_2.3       dplyr_1.0.7         stringr_1.4.0       janitor_2.1.0       knitr_1.36          generics_0.1.1     
[25] vctrs_0.3.8         rprojroot_2.0.2     grid_4.1.2          tidyselect_1.1.1    glue_1.5.1          snakecase_0.11.0   
[31] here_1.0.1          R6_2.5.1            fansi_0.5.0         foreign_0.8-81      rmarkdown_2.11      pacman_0.5.1       
[37] carData_3.0-4       purrr_0.3.4         ggplot2_3.3.5       car_3.0-12          magrittr_2.0.1      MASS_7.3-54        
[43] gameofthrones_1.0.2 scales_1.1.1        ellipsis_0.3.2      htmltools_0.5.2     rsconnect_0.8.25    abind_1.4-5        
[49] assertthat_0.2.1    colorspace_2.0-2    utf8_1.2.2          stringi_1.7.6       munsell_0.5.0       crayon_1.4.2 

RStudio version is here:
RStudio 2021.09.0+351 "Ghost Orchid" Release (077589bcad3467ae79f318afe8641a1899a51606, 2021-09-20) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

If there's anything else you need let me know!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.