mirror of
https://github.com/BoostIO/BoostNote-App.git
synced 2026-04-26 21:05:55 +03:00
[GH-ISSUE #1296] Copy button copied random code block #490
Labels
No labels
android 🤖
assigned to core 🦹
bug 🐛
documentation 📚
documentation 📚
duplicate 🚫
external issue 🔼
external issue 🔼
feature request 🌟
funded on issuehunt 💵
help wanted 🆘
improvement request 🔨
improvement request 🔨
ios 🍎
mobile 📱
needs investigation 🔬
needs more info ℹ️
needs specs 📐
plugin idea 🔌
plugin idea 🔌
poll 🗳️
pull-request
question ❓
rewarded on issuehunt 🎁
security issue 🔑
won’t fix ❌
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/BoostNote-App#490
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zanderhorstman on GitHub (Nov 4, 2021).
Original GitHub issue: https://github.com/BoostIO/BoostNote-App/issues/1296
Current behavior
I used the copy button inside a code block to copy a command we use on our servers for deactivating and deleting SSL certificates. The box that was actually copied, however, contained the root directory for all of our websites as well as a return character. So when I pasted what i copied, all the files in our root dir were immediately deleted (part of the process includes an rm -rf, which is unfortunately where i was at before i pasted). Screenshots would not help here as its not a visual issue, nor was there a console error.
Expected behavior
Copy button should copy the code block it's nested within.
Steps to reproduce
Create 5-10 code blocks. put a one-line command in each code block, then pick a code block near the bottom, hit enter and put another command in it. Then go copy a different code block using the copy to clipboard button and paste it into a text file. About 1 in 10 times you use the copy to clickboard button, it will copy the block with multiple lines.
A temporary fix to prevent this that i'm using, is to avoid using returns inside code blocks. I also removed the root / from commands which contained it. However, random stuff still gets copied sometimes, so as an extra precaution i also paste what i copied into a text document before actually pasting it into the terminal. It's not optimal, but at least it's safer.
Environment
Desktop/Web
@Komediruzecki commented on GitHub (Nov 21, 2021):
Hi,
sorry for the delay,
I tried this but cannot get it to copy the wrong one.
It would help if you have an exact example to reproduce this, with commands and code blocks.
This should always happen, each code block has its own copy button and should copy its content. The only thing I can think of if the first copy succeeded and the second didn't, so you are left with previously clicked copy button content in the clipboard.
And no nested code blocks are allowed so only one block is copied each time.