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

fix: rangeless multi chars highlighting #168

Merged
merged 3 commits into from
Jan 22, 2024
Merged

Conversation

atomiks
Copy link
Collaborator

@atomiks atomiks commented Jan 22, 2024

Fixes #166

Copy link

netlify bot commented Jan 22, 2024

Deploy Preview for rehype-pretty-code ready!

Name Link
🔨 Latest commit adb952c
🔍 Latest deploy log https://app.netlify.com/sites/rehype-pretty-code/deploys/65ae93667e10360008e2f19c
😎 Deploy Preview https://deploy-preview-168--rehype-pretty-code.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 22, 2024

Deploy Preview for rehype-pretty-code canceled.

Name Link
🔨 Latest commit 34827a2
🔍 Latest deploy log https://app.netlify.com/sites/rehype-pretty-code/deploys/65ae9583b3458b000875a2c4

@atomiks
Copy link
Collaborator Author

atomiks commented Jan 22, 2024

This one still fails: /get/ doesn't highlight all instances

/Length/1 /str/ /const/2-3 /get/

```js /Length/1 /str/ /const/2-3 /get/
const getStringLength = (str) => str.length;

const strLen = getStringLength('str');

const anotherStrLen = getStringLength('anotherStr');
```

@atomiks
Copy link
Collaborator Author

atomiks commented Jan 22, 2024

^Seems to be a separate issue regarding overlapping chars. It inherits the range from whichever node contains the textContent to be highlighted, even if the other chars aren't included. I will file a separate issue for that one.

@atomiks atomiks merged commit a70e07f into master Jan 22, 2024
5 checks passed
@atomiks atomiks deleted the fix/rangeless-multi-chars branch January 22, 2024 16:28
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

Successfully merging this pull request may close these issues.

word highlighting break only works on first item
1 participant