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

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

Open
theDanielJLewis opened this issue Feb 13, 2024 · 0 comments
Open

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

theDanielJLewis opened this issue Feb 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@theDanielJLewis
Copy link

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"
/>
@thomasmost thomasmost added the bug Something isn't working label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants