rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.
https://rehype-pretty.pages.dev
MIT License
1.01k stars 63 forks source link

Fix start line numbers being highlighted #181

Closed ezzatron closed 5 months ago

ezzatron commented 6 months ago

This PR fixes an issue where combining showLineNumbers{number} with line highlighting would cause the start line number to be highlighted when it shouldn't be.

Included is an expanded test fixture that demonstrates the issue, which can be fixed by using a negative lookbehind in the regex used to find highlighted line numbers in the meta.

Before this PR:

Screenshot 2024-02-17 at 15 07 02

After this PR:

Screenshot 2024-02-17 at 15 07 16
netlify[bot] commented 6 months ago

Deploy Preview for rehype-pretty-code canceled.

Name Link
Latest commit 7c25e97ee28d50efbaf87f8e9e8cb9bbee4fdb5b
Latest deploy log https://app.netlify.com/sites/rehype-pretty-code/deploys/65d07e0b1fc9c00008478c6a