### Bug description

The header:

````md
---
author:
  - name: 'peacecop kalmer:'
title: "MMS inimese organismis ja ümbritsevas keskkonnas"
output-file: ../../_book/keemia-mms.html
format:
  revealjs:
    incremental: true
    self-contained: true

---

````

The content:

````md
## $`r if (knitr::is_html_output()) { "\\require{mhchem}" }`\ce{NaClO_2}$ vesilahuse tegemine tekstiliselt

````

Look into TOC and see the following:

````
\(\require{mhchem}\ce{NaClO_2}\) vesilahuse tegemine tekstiliselt

````

### 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.
2022-11-29T16:58:55Z
piiskop
closed
TOC shows unrendered R and LaTeX code
https://github.com/quarto-dev/quarto-cli/issues/3503