rehype-pretty-code icon indicating copy to clipboard operation
rehype-pretty-code copied to clipboard

curly brackets with numbers inside of slashes, highlights both the characters but also lines

Open chrisweb opened this issue 7 months ago • 0 comments

I'm trying to include examples of how to use rehype pretty code in my tutorial and when I want to highlight the characters you need to use to highlight a line then it does highlight those but it also highliths the lines, which is wrong

example markdown:

````md showLineNumbers{16} /{1}/#special /{3-4}/#special
```js showLineNumbers {1} {3-4}
function helloWorld() {
    // this is a comment
    let greeting = 'Hello World!'
    console.log(greeting)
}
```
````

gives me this result:

image

correct part: it highlighted the {1} and {3-4} in the inner code block using my #special ID

wrong part: it also highlighted line 1 and then also line 3 to 4

expacted result: as {1} and {3-4} are inside of slashs (/) rehype should not consider them as "highlight this line" information

chrisweb avatar Jul 10 '24 18:07 chrisweb