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 unexpected highlight words for custom meta properties #53

Closed

Conversation

dimaMachina
Copy link
Contributor

use better regex
image
fixes #52

@netlify
Copy link

netlify bot commented Dec 26, 2022

Deploy Preview for rehype-pretty-code canceled.

Name Link
🔨 Latest commit ebb0680
🔍 Latest deploy log https://app.netlify.com/sites/rehype-pretty-code/deploys/63a8e511c7dd6a0009e19d9a

@atomiks
Copy link
Collaborator

atomiks commented Dec 26, 2022

One of the tests is failing
Screenshot 2022-12-26 at 2 09 54 pm

@dimaMachina
Copy link
Contributor Author

Thx, will fix later today

@atomiks
Copy link
Collaborator

atomiks commented Jan 8, 2023

@B2o5T feel free to just check for filename manually for now if need be. I know others might use something other than title/filename, but the library does intentionally use title="..." only so new wrappers should likely only use that.

Also note that part of the reason for the syntax is to also support other words that might do \w="..." for other features, where this will break. So a manual allowlist is probably better anyway. Either that or make it an option to the plugin and create a dynamic regex.

@dimaMachina
Copy link
Contributor Author

Sorry for not finishing a fix, just was struggling with regex, found some workaround with skip/fail but js regex doesn’t support it

https://regex101.com/r/heqsZS/1

@atomiks
Copy link
Collaborator

atomiks commented Jan 8, 2023

#58

@atomiks atomiks closed this Jan 8, 2023
@dimaMachina dimaMachina deleted the fix-highlight-word branch January 8, 2023 16:43
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.

An unexpected highlighted word that matches in filename in v0.6.0
2 participants