Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profvis() messes up syntax highlighting in Quarto and R Markdown code blocks #140

Closed
prosoitos opened this issue Jan 18, 2023 · 3 comments · Fixed by #142
Closed

profvis() messes up syntax highlighting in Quarto and R Markdown code blocks #140

prosoitos opened this issue Jan 18, 2023 · 3 comments · Fixed by #142
Labels

Comments

@prosoitos
Copy link

See issue quarto-dev/quarto-cli#3991 for reproducible example and explanations.

@wch
Copy link
Member

wch commented Jan 18, 2023

It looks like the colors are from textmate.css. Profvis includes a very old version of highlight.js which doesn't do any scoping -- all <span>s are affected by the CSS.

https://github.com/rstudio/profvis/blob/a4ac85ce2fd73f82a3e6deae3989863b2a32db4d/inst/htmlwidgets/lib/highlight/textmate.css

I think this can be fixed by adding .profvis-code to the CSS rules.

@wch
Copy link
Member

wch commented Jan 18, 2023

After taking a closer look, I think highlight.js itself will also need to be upgraded for everything to work properly.

@hadley
Copy link
Member

hadley commented Aug 22, 2024

Actual link to underlying issue: quarto-dev/quarto-cli#3991

Minimal reprex:

---
format: html
---

```{r}
f <- function() {
  pause(0.1)
}
profvis::profvis(f())
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants