### Bug description

If CSS chunk is included in `qmd` file, rendering (to HTML) fails with Quarto v1.3.142. Both CLI code and RStudio "Render" button behave the same way.

You may use this file to test:
[with-css.zip](https://github.com/quarto-dev/quarto-cli/files/10549594/with-css.zip)



### Details

If CSS chunk is included in `qmd` file like this:


      ---
      knitr:
        opts_chunk:
          fig.height: 3
          fig.width: 5
      ---
      
      
      ```{css}
      h1 {
        color: blue;
      }
      ```
      
      
      # Section 1


and Quarto v1.3.142 is used, rendering (to HTML) fails with the error:

```
Quitting from lines 10-13 (with-css.qmd) 

Error in grepl(pattern, options$code) : 
  invalid regular expression '.*\Q/*\E\s*<[0-9]+>\s**\Q*/\E\s*$', reason 'Invalid use of repetition operators'
Calls: .main ... as.strict_list -> hook -> knitr_options_hook -> grepl
In addition: Warning message:
In grepl(pattern, options$code) :
  TRE pattern compilation error 'Invalid use of repetition operators'
Execution halted
```

![image](https://user-images.githubusercontent.com/12725868/215846910-8573034b-e7e3-4fe8-8077-bbbf5705fdc6.png)

***
With Quarto v1.2.335 no error is present and CSS code is interpreted as CSS code (CSS changes the style of the document):

![image](https://user-images.githubusercontent.com/12725868/215848194-998a428a-9155-4ca4-88d2-7a31c5897a85.png)
  
***

With both versions of Quarto, if YAML is excluded, e.g.:

    ```{css}
    h1 {
      color: blue;
    }
    ```
    
    
    # Section 1

rendering does not fail, but the contents of CSS chunk are displayed as (kind of) plain text and are not hidden. 
CSS is not interpreted as CSS too:

![image](https://user-images.githubusercontent.com/12725868/215846952-bcfdfd62-2906-4046-bdbf-97c62b0dec8a.png)


### The result I expect

I expect the same behaviour as with Quarto v1.2.335.
(No error, CSS code is interpreted as CSS code, code is hidden)


### System details

    RStudio Edition : Desktop [Open Source]
    RStudio Version : 2023.3.0.277
    OS Version      : Windows 10 x64 (build 19045)
    R Version       : R version 4.2.2 (2022-10-31 ucrt)


### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
2023-01-31T17:44:10Z
GegznaV
bug needs-discussion
closed
Rendering `qmd` file with CSS cunk fails in Quarto 1.3.142
https://github.com/quarto-dev/quarto-cli/issues/4166