rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.
https://rehype-pretty.pages.dev
MIT License
1.05k stars 64 forks source link

Syntax highlighting didn't recognize R language when it's uppercase in backticks #114

Closed aster-hu closed 11 months ago

aster-hu commented 1 year ago

Describe the bug When the markdown code block starts with ```R instead of ```r, it didn't recognize the R language and therefore not show the syntax highlighting.

To Reproduce Steps to reproduce the behavior:

  1. Create a markdown file to include R code like this:

```R library(dplyr) mouse.data <- data.frame( weight=c(0.9, 1.8, 2.4, 3.5, 3.9, 4.4, 5.1, 5.6, 6.3), size=c(1.4, 2.6, 1.0, 3.7, 5.5, 3.2, 3.0, 4.9, 6.3)) ```

  1. The code block didn't show syntax highlighting for R lang. As a comparison, the same code starts with ```r shows the syntax highlighting normally.

Expected behavior The code block starting with ```R should show the syntax highlighting for R code

Desktop (please complete the following information):

atomiks commented 11 months ago

This is a Shiki issue. One thing we could do is lowercase the language passed in, but I'm not sure if that should be done for all languages