fix: resolve the issue of having an additional image label when copying images directly from the editor to the clipboard#462
fix: resolve the issue of having an additional image label when copying images directly from the editor to the clipboard#462wuyiping0628 wants to merge 1 commit intodevfrom
Conversation
…ing images directly from the editor to the clipboard
WalkthroughModified clipboard handling in the fluent-editor custom clipboard module by adding debug logging to three functions and refactoring the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/fluent-editor/src/modules/custom-clipboard.ts`:
- Line 26: Remove the temporary debug console.log calls (e.g. console.log(1111,
'prepareMatching'), and the other debug lines with 2222 and 333) from
custom-clipboard code; replace them with appropriate logging (console.warn/error
or the project logger) only if needed to preserve runtime warnings, or simply
delete them to satisfy the no-console ESLint rule and clean up the code; look
for the 'prepareMatching' debug message and other console.log(...) occurrences
and remove or convert them accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1a6ee70b-f8a4-47c5-8771-40ff31765df7
📒 Files selected for processing (1)
packages/fluent-editor/src/modules/custom-clipboard.ts
| declare quill: FluentEditor | ||
|
|
||
| prepareMatching(container: HTMLElement, nodeMatches) { | ||
| console.log(1111, 'prepareMatching'); |
There was a problem hiding this comment.
Remove debug console.log statements before merging.
These debug statements with numeric identifiers (1111, 2222, 333) appear to be temporary debugging artifacts that should not be committed. ESLint also flags these as violations of the no-console rule which only permits warn and error methods.
🐛 Proposed fix to remove debug statements
At line 26:
prepareMatching(container: HTMLElement, nodeMatches) {
- console.log(1111, 'prepareMatching');
const elementMatchers = []At line 60:
onCaptureCopy(e, isCut = false) {
- console.log(2222, 'onCaptureCopy');
if (e.defaultPrevented) {At lines 96-97:
onCapturePaste(e: ClipboardEvent) {
- console.log(333, 'onCapturePaste');
-
if (e.defaultPrevented || !this.quill.isEnabled()) {Also applies to: 60-60, 96-97
🧰 Tools
🪛 ESLint
[error] 26-26: Unexpected console statement. Only these console methods are allowed: warn, error.
(no-console)
[error] 26-26: Extra semicolon.
(style/semi)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/fluent-editor/src/modules/custom-clipboard.ts` at line 26, Remove
the temporary debug console.log calls (e.g. console.log(1111,
'prepareMatching'), and the other debug lines with 2222 and 333) from
custom-clipboard code; replace them with appropriate logging (console.warn/error
or the project logger) only if needed to preserve runtime warnings, or simply
delete them to satisfy the no-console ESLint rule and clean up the code; look
for the 'prepareMatching' debug message and other console.log(...) occurrences
and remove or convert them accordingly.
…ing images directly from the editor to the clipboard
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #402
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Chores
Bug Fixes