Skip to content

Bug: line highlighting doesn't work without line numbers #151

@theDanielJLewis

Description

@theDanielJLewis

When line numbers are not enabled, line highlighting doesn't work. It still fades out everything else, but it does not highlight the desired lines.

This fails:

const code = `<html>
  <body>
  </body>
</html>`;

<CodeBlock
  text={code}
  language="html"
  showLineNumbers={false}
  highlight="2-3"
/>

But this works:

const code = `<html>
  <body>
  </body>
</html>`;

<CodeBlock
  text={code}
  language="html"
  showLineNumbers={true} // The only difference
  highlight="2-3"
/>

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