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

R — The first number is not getting the hljs-number class #3976

Open
psiaux opened this issue Jan 27, 2024 · 1 comment
Open

R — The first number is not getting the hljs-number class #3976

psiaux opened this issue Jan 27, 2024 · 1 comment
Labels
bug help welcome Could use help from community language

Comments

@psiaux
Copy link

psiaux commented Jan 27, 2024

Describe the issue
When the number is next to the <- operator, it doesn't get highlighted. It isn't getting the hljs-number class.
HightlightJSRProblem

Which language seems to have the issue?
R.

Are you using highlight or highlightAuto?
highlight
...

Sample Code to Reproduce

import hljs from 'highlight.js/lib/core'
import r from 'highlight.js/lib/languages/r'
import 'highlight.js/styles/agate.css'

hljs.registerLanguage('r', r)

export default function RCode({ content }: { content: string }) {
  const highlightedCode = hljs
    .highlight(content, { language: 'r' })
    .value
  return
    <pre className={className}>
      <code dangerouslySetInnerHTML={{ __html: highlightedCode }} />
    </pre>
}

The content prop is coming from an MDX file. I'm using Next.js (React) and next-mdx-remote/rsc, using the compileMDX function.

Expected behavior
All numbers should be highlighted and have the hljs-number class.

@psiaux psiaux added bug help welcome Could use help from community language labels Jan 27, 2024
@joshgoebel
Copy link
Member

Please provide actual R source, not just a graphic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

No branches or pull requests

2 participants