nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Empty lines are invisible when their code block language is unsupported

Open MrWillCom opened this issue 6 months ago • 0 comments

Describe the bug Empty lines in code blocks are invisible if syntax highlighting doesn't support them.

To Reproduce Steps to reproduce the behavior:

\`\`\`js
import { useState } from 'react'

function Counter() {
  const [count, setCount] = useState(0)
  return <button onClick={() => setCount(count + 1)}>{count}</button>
}
\`\`\`

\`\`\`unsupportedLanguage
import { useState } from 'react'

function Counter() {
  const [count, setCount] = useState(0)
  return <button onClick={() => setCount(count + 1)}>{count}</button>
}
\`\`\`

(I'm sorry, "\`" above is actually "`")

Screenshots:

Image

Expected behavior Empty lines should be preserved.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context I don't think this problem has anything to do with the platforms. Because I found that those supported languages's empty lines are built into a space, which helps preserve the line, but unsupported ones aren't.

MrWillCom avatar Oct 21 '25 05:10 MrWillCom