Skip to content

Syntax highlighting with code chunk options containing . don't work properly #14545

Closed

Description

@mine-cetinkaya-rundel

System details

RStudio Edition : Desktop
RStudio Version : RStudio 2024.04.0-daily+689 "Chocolate Cosmos" Daily (9ee2b6131e42e36e31cec48a4eb88d2e700e272c, 2024-04-10) for macOS Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2024.04.0-daily+689 Chrome/120.0.6099.291 Electron/28.2.6 Safari/537.36, Quarto 1.4.553 (/Applications/quarto/bin/quarto)
OS Version      : Mac OS Ventura 13.5 (22G74)
R Version       : R version 4.3.3 (2024-02-29) -- "Angel Food Cake"

Steps to reproduce the problem

In an R Markdown file, add some code chunks with options that contain ., e.g., ref.label, out.width, etc.

Describe the problem in detail

These words are not highlighted like other code chunk options.

Screenshot 2024-04-14 at 9 02 13 AM

This is true in the visual editor as well.

Screenshot 2024-04-14 at 9 04 28 AM

Note, the broken syntax highlighting issue raised in #14544 is also visible in these images.

Describe the behavior you expected

I expected the code chunk options to be the same color, regardless of whether they're knitr options or also Quarto options.

  • I have read the guide for submitting good bug reports.
  • 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.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Apr 14, 2024
  2. ronblum commented on Apr 16, 2024

    @ronblum
    Contributor

    Reproducible:

    • Problem occurs in RStudio Desktop 2024.04.0-daily+693 on Windows 11.
    • This is a regression from 2023.12.1+402. There are different display issues in it, but those go away and are replaced with this bug.
    ---
    output: html_document
    ---
    
    # Chapter 1
    
    ## Section 1.1
    
    Hello
    
    ```{r}
    #| label: simple-arithmetic
    1 + 1
    ```
    
    ## Section 1.2
    
    Mello
    
    ```{r}
    #| ref.label: simple-arithmetic
    ```
    
    # Chapter 2
    
    Jello
    
    ```{r}
    3 + 3
    ```
    
    ```{r}
    #| out.width: 30%
    plot(cars)
    ```
    
  3. added
    visual markdown
    and removed
    new
    on Apr 16, 2024
  4. added this to the Chocolate Cosmos milestone on Apr 17, 2024
  5. self-assigned this
    on Apr 17, 2024
  6. ronblum commented on Apr 22, 2024

    @ronblum
    Contributor

    Verified in RStudio Desktop 2024.04.0+725 on Windows 11 using the above code and messing around with it. Checked that both source and visual modes work correctly.

  7. self-assigned this
    on Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugregressionsource editorvisual markdown

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions