-
Notifications
You must be signed in to change notification settings - Fork 72
feat(plugin-copy-code): add inlineSelector option #416
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
Conversation
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.
Pull Request Overview
This PR adds an inlineSelector option to the copy code plugin so that inline code content can be copied with a double click. It also refactors the ignoreSelector option to allow for a single selector string and updates both the plugin implementation and documentation accordingly.
- Updated options definitions (ignoreSelector and inline)
- Modified plugin configuration to handle inline copying and selector type changes
- Revised composable usage and documentation in both English and Chinese
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
plugins/features/plugin-copy-code/src/node/options.ts | Updated option types and added the inline option for specifying selectors or enabling inline copying |
plugins/features/plugin-copy-code/src/node/copyCodePlugin.ts | Adjusted configuration for selectors including inline code and modified the inline selector logic |
plugins/features/plugin-copy-code/src/client/composables/useCopyCode.ts | Changed the selector type and added inlineSelector handling via a double-click event listener |
docs/zh/plugins/features/copy-code.md | Updated documentation to include details about the inlineSelector option (Chinese) |
docs/plugins/features/copy-code.md | Updated documentation to include details about the inlineSelector option (English) |
Comments suppressed due to low confidence (1)
plugins/features/plugin-copy-code/src/node/copyCodePlugin.ts:34
- [nitpick] Consider refactoring the nested ternary for CC_INLINE_SELECTOR for better readability. For instance, using an explicit check for a boolean value (e.g., options.inline === true) could improve clarity.
: options.inline
? '[vp-content] :not(pre) > code'
: ''
Pull Request Test Coverage Report for Build 14134103214Details
💛 - Coveralls |
No description provided.