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

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

Open
chrisweb opened this issue Jul 10, 2024 · 0 comments

Comments

@chrisweb
Copy link

chrisweb commented Jul 10, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant