-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat(kcodeblock): support line highlight syntax #2558
Conversation
✅ Deploy Preview for kongponents-sandbox ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kongponents ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it would be a breaking change, but is there still value in supporting an array of numbers if we also support passing a string that can do the same thing? I think I'm the only one currently using this functionality, I'm not sure continuing to maintain support for arrays makes sense.
I think changing the implementation as in this PR is ideal, and we can just update your usage once merged? Allowing ranges (and using the standard format) is ideal |
If you already have an array derived from some computation, I think there’s no need to convert it back into a string. |
…Lines` ...and extraxt normalizers to utilities, add unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
# [9.16.0](v9.15.0...v9.16.0) (2025-01-08) ### Features * **kcodeblock:** support line highlight syntax ([#2558](#2558)) ([91a6031](91a6031))
🎉 This PR is included in version 9.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
KM-886
KHCP-14552
This PR:
Introduces support for line highlighting syntax (e.g.,
"2,4,6-12"
) for the<KCodeBlock>
component’shighlighted-line-numbers
prop. I recommend using this approach over arrays, as primitive values are less likely to trigger unnecessary re-renders. This is particularly advantageous compared to binding array literals like:highlighted-line-numbers="[2, 4, 6]"
.Improves the line navigation behavior to prevent scrolling each time the “Next match” or “Previous match” button is clicked, which reduce the pain for consecutive clicks.
Enhances line matching performance, particularly when dealing with multiple matches for a lengthy section of code.