Desktop: Fixes #14852: Duplicate codeblocks when copying from note vi…#14860
Desktop: Fixes #14852: Duplicate codeblocks when copying from note vi…#14860Ashutoshx7 wants to merge 2 commits intolaurent22:devfrom
Conversation
…m note viewer to external editors
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe PR modifies clipboard HTML generation in the note viewer to remove additional hidden markup—specifically Changes
Possibly related PRs
Suggested labels
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
But your video doesn't show this? |
|
@laurent22 updated the decription |
|
Could you please read the issue again? Ask ChatGPT to explain it for you maybe. You're not understanding what needs to be done |
|
What you need to do to replicate is this:
Currently it shows duplicate codeblocks and other hidden elements. Instead the pasted text should be clean |
Screencast.from.2026-03-25.04-35-40.mp4 |
Fixes #14852
This PR builds directly on top of the PR #14474.
Problem
When you copy from the viewer and paste into MS Word etc, the code blocks appear twice because browser copying includes Joplin's hidden "source" version. Also, an internal accessibility link ("Note viewer top") leaks into the clipboard.
Screencast.from.2026-03-21.18-03-13.mp4
Solution:
I updated the logic that handles copying to strip these internal elements before they're sent to the clipboard.
Since there was already a cleanup step in the code to handle theme backgrounds, I just added a few more lines to also remove
Screencast.from.2026-03-21.07-59-30.mp4