You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected syntax highlighting in Rmd chunks #4821
RStudio Edition : Server (rocker/verse:latest and devel)
RStudio Version : 1.2.1335
OS Version : Manjaro Linux
R Version : 3.5.3 (rocker/verse:latest)
3.7.0 (rocker/verse:devel)
Steps to reproduce the problem
Create new Rmd file
Create asis chunk (or css)
Write some R code
Describe the problem in detail
Although asis and css chunks are intended to be text and CSS scripts, respectively,
they are highlighted as if they are R code.
If I create some original knitr engines, they will also be highlighted as if they are R code.
Describe the behavior you expected
Chunks with asis or original engines should not be highlighted
(asis can be highlighted as if markdown script)
Chunks with css engine should be highlighted by the syntax of CSS.
There may be some more chunks with unexpected syntax highlights.
I haven't checked all.
Activity
stale commentedon Feb 6, 2021
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.
atusy commentedon Feb 7, 2021
I wish this issue be solved.
stale commentedon Feb 21, 2021
This issue has been automatically closed due to inactivity.
joelnitta commentedon Jul 14, 2021
This is especially problematic with CSS where

#is valid code (id selector) and not a comment. +1 for re-opening and resolving this issue. Thanks!ronblum commentedon Jul 22, 2021
Confirmed that CSS chunks appear to be using CSS highlighting, and ASIS chunks don't use any. Verified in:
Note: Used the following code, transcribed from the screenshots above.