Copy-Paste of simple HTML adds extra new lines that are not present in original content
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
| Webcompat Priority | P3 |
People
(Reporter: rafee, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:80
Attachments
(3 files)
Comment 3•9 years ago
|
||
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
Comment 8•9 years ago
|
||
Updated•9 years ago
|
Comment 9•9 years ago
|
||
Comment 10•9 years ago
|
||
Comment 11•9 years ago
|
||
Comment 12•9 years ago
|
||
Comment 13•9 years ago
|
||
Comment 14•9 years ago
|
||
Comment 15•9 years ago
|
||
Comment 16•9 years ago
|
||
Comment 17•7 years ago
|
||
Comment 18•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Comment 19•6 years ago
|
||
I also can confirm the bug! Having it now since a while after some of the last thunderbird more recent updates. I'm also using a HTML-Signature. I'm not shure if the bug has to do with that fact?!
I only can say it worked once without hassle while having same signature/html.
I also noticed the bug occurs while trying to select (focus) an inserted image in mail-body. The focus immediately is removed so that it's nearly impossible to resize image. It's hardly possible to get 'edit properties' by doing very fast double-click on image.
Every time trying to simply select the inserted image-element a new-line is inserted above on text-body, which is very very annoying!
Comment 20•6 years ago
|
||
To my own surprise... re-trying to find a solution on my own I suddenly found one just a minute after posting here :-D
See:
https://support.mozilla.org/de/questions/1183434
The solution posted by user n4mwd there is approved to work!
Try adding this boolean preference in the config editor.
mail.compose.attach_http_images
…and make sure it is set to true.
Comment 21•6 years ago
|
||
... well okay. For my sake this only fixes the problem partly. I can now select images without hassle. But the annoying new-line issue is still there, as I noticed after some more practice testing.
Comment 22•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 23•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•6 years ago
|
Comment 24•5 years ago
|
||
Extra blank lines (random number of them) are added also in the Vk.com Article Editor. Steps to reproduce:
-
Copy some text from any website (I copy from my own WordPress blog);
-
Create new article and paste text.
Comment 25•5 years ago
|
||
I confirm seeing this using Firefox nightly 78.0a1 (2020-05-25) (64-bit) on linux. It started a few weeks ago, unfortunately I don't recall exactly when - at the time I took a wait-it-will-be-fixed approach ... it seems to be a regression.
How to demonstrate. Go to any Wikipedia page -
- copy 2 text paragraphs -
- paste into text editor such as vim on linux and the single line between the 2 paragraphs gets converted into 3 newlines.
- Pasting into a graphical editor such has 'kate' works fine.
- Doing the same using Google Chrome - works fine in vim as well as graphical editors.
Best I can tell It's only Firefox that exhibits this behavior for me.
Hope that's helpful.
Comment 26•5 years ago
|
||
I can also confirm this problem exists on 78.0.2, it is very easy to reproduce for me and extremely annoying. As an example, every time I copy a web page into my note taking application the newlines are all messed up and If I want the text formatted correctly I have to manually fix them. I ended up opening the pages in Chrome when I want to copy some content, which is really not nice.
Please let me know if I can helps somehow.
Comment 27•4 years ago
|
||
I can confirm this bug on Firefox 91. It's very annoying and happens on code blocks with line numbers, like this page for example: https://www.bigbinary.com/learn-rubyonrails-book/linting-and-formatting-code
Comment 28•4 years ago
|
||
This bug still bothers me in Firefox 96.0.1 (Arch Linux).
Comment 29•4 years ago
|
||
I am seeing this bug even on Firefox 97.0.2 (64-bit) Windows 10 64-bit.
Here's a minimal HTML code with CSS (user-select: none;) that causes this issue: https://jsfiddle.net/kaushalmodi/uvk7gL9x/12/
- Open that URL
- Hit Run
Copy the top two lines and paste in any editor (Notepad++, Emacs, doesn't matter). You will see that a blank line is inserted between the 2 copied lines when pasted elsewhere.
You can find a GIF in action showing a GitHub issue here.
This issue does not occur on these browsers:
- Google Chrome
- Microsoft Edge
Comment 30•3 years ago
|
||
I was also able to reproduce on Firefox 98.0 (linux) with Kaushal's jsfiddle.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 31•2 years ago
|
||
Similar issues are present when copying text from Sharepoint Markdown code blocks. I'm using Firefox 102.12.0esr (64-bit) - Windows.
Updated•1 year ago
|
Comment 32•1 year ago
|
||
I also ended up here when trying to use user-select: none; to hide line numbers from the clipboard, though I see the bug has had a meandering history.
At least for this specific case, I see that nsRange::ExcludeNonSelectableNodes splits a range into two separate ranges if there's an unselectable node in the middle. Indeed, if I manually select two chunks of inline text, copy them, and paste them as text elsewhere, I do get a newline between them. So I assume the same thing is happening here, but that the preformatted text already includes a newline of its own, so the result is two breaks between lines.
Not sure what the right behavior is, exactly, but it does seem like a user-select: none; node in the middle of a selection should vanish entirely, which is a little different from the user deliberately making a multiple selection.
Comment 33•8 months ago
|
||
Webkit had a similar bug and fixed it in 2022. You can see the bug tracking here: https://bugs.webkit.org/show_bug.cgi?id=80159
Updated•5 months ago
|
Comment 34•4 months ago
|
||
I run into this regularly when copying code fro the GH diff view, or when copying code from various CI log viewers (see e.g. https://github.com/rust-lang/triagebot/issues/2223). At least I assume that is this bug.
Updated•11 days ago
|
Description
•