Skip to content

Empty lines are invisible when their code block language is unsupported #4825

@MrWillCom

Description

@MrWillCom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions