rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

Home Page:https://rehype-pretty.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

aster-hu opened this issue · comments

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):

  • Device: Mac Mini M2
  • OS: Ventura 13.5.2
  • Browser Safari

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