Closed
Bug 56135
Opened 24 years ago
Closed 24 years ago
Text copied from <pre> formatted text or from widget gets pasted with an extra newline
Categories
(Core :: DOM: Serializers, defect, P3)
Core
DOM: Serializers
Tracking
()
VERIFIED
FIXED
mozilla0.9
People
(Reporter: marina, Assigned: mozeditor)
References
Details
(Whiteboard: [rtm-] fix in hand relnote-user)
Attachments
(2 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
**** observed with branch build 2000-10-11 *****
Text copied from the Subject field is pasted into the body as a quatation
, it doesn happen if you copy/paste text into the body from the body
Steps to reproduce:
- compose a message:
-highlight text in the Subject field;
-copy the text (it doesn't matter whether you use Ctrl+C or copy commend from
the menu);
- paste the copied string into the body several times (again it doesn matter
shortcut or menu is used);
//note: the text is paste as a quatation, starting a new line every time you paste
(it is tru for HTML and plain text)
I'm not seeing this with 2000-10-11-08 mn6 commercial branch build on NT 4.0.
I've tried both menu and shortcuts.
I've tried both html and plain text.
I've tried both new message and replies.
I've tried with auto-quoting pref on/off (thought this pref might be interfering).
Will keep trying...any special characters in the subject?
laurel, are you selecting text in the subject and pasting it into the body? It
doesn't happen when you copy/paste from body to body
Peter Mock in our group just tried it on Win98, today's branch commercial build
and had no problem in plain text or html.
I just tried on linux, too and didn't have a problem.
I can reproduce it using today's linux branch build as well.
I'm using RH6.2-J.
Comment 8•24 years ago
|
||
maybe a side effect of the noxif landing. Reassign to jfrancis
Assignee: ducarroz → jfrancis
Updated•24 years ago
|
Summary: Text copied from the Subject field is pasted into the body as a quatation → Text copied from the Subject field is pasted into the body as a quotation
Comment 9•24 years ago
|
||
My first thought was that it was a side-effect of our wrapping plaintext in a
pre ... but then it would show up every time, not only occasionally.
My new speculation is that this is a side effect of another problem we've had
for a long time: if you have a quotation in the message, if you set the caret
somewhere near there, it's easy to get into a state where if you type (and this
would go for pasting as well), the text warps inside the quotation instead of
outside.
Marina, jj and others who are seeing this: do you have quoted text already in
the body somewhere when you do this paste? E.g. are you doing a reply instead
of a new message? Do you have a signature in the window?
Reporter | ||
Comment 10•24 years ago
|
||
my findings:
- i am not talking about Reply (even though it shows up there as well), it is a
specific pasting operation: from header into the body (from body to body
everything is OK);
- it's happening in Plain and HTML;
- there is no dependency on a signature (happens with and w/o)
and it is 100% reproducable
Assignee | ||
Comment 11•24 years ago
|
||
It isn't a quotation. It's wrapped in a pre. It is a (known) side effect of the
noxif landing. There is a workaroun: you can backspace at the front of the
preformmatted text to join it with the prior text. Or you can click in the text
and choose "Body Text: from the paragraph format popup in the toolbar.
I know how to fix this if it's an rtm issue: I just have to add a hint into the
copy data that tells me the copy came from a text widget. Then in html paste,
any paste data that came from a text widget will be retreived as plaintext
instead of html. This will cause the data to not be wrapped in a pre once it is
pasted in, but whiotespace will still be preserved becasue the plaintext
serialize will have seen the pre when generating the plaintext version, and thus
will preserve whitespace.
Marking rtm in the hopes folks will tell me if I should implement this change
now.
Status: NEW → ASSIGNED
Keywords: rtm
Assignee | ||
Comment 12•24 years ago
|
||
i have fix for this. We (jst, akkana, and i) forced text widget copy data to be
wrapped in a <pre> so that whitespace would not be compressed by the serializer,
etc.. That's the good effect. The bad effect is that it the editor preserves
the <pre> on paste (as it is designed to do) and that causes the paste to go
into a seperate block.
The solution is to use our newly acquired copy hints data to pass along the
knowledge that this copy came from a widget. Editor then uses that fact to
force a plaintext serialization of the copy data. Whitespace is preserved,
newlines are converted to breaks, and everybody's happy.
One hackish feature is that the </pre> at the end of the copy data forces the
serializer to emit a newline. We shouldn't change the serializer here because
ordinarily this is the right thing to do. So when the editor sees the copy hint
informing it of a text widget copy, it strips off the trailing newline from the
serialized string.
I played around with various text widget, mail, and composer copies and pastes
and had good results. Do we want this for rtm? It's not trivial, but it's not
extensive either. One of those middle of the road patches.
Assignee | ||
Comment 13•24 years ago
|
||
cc'ing more editor folks.
Assignee | ||
Comment 14•24 years ago
|
||
Assignee | ||
Comment 15•24 years ago
|
||
simon, kin: ready to wlka ou through reviews.
Whiteboard: fix in hand
Assignee | ||
Comment 16•24 years ago
|
||
Comment 17•24 years ago
|
||
Add rtm need info to status whiteboard since Joe is waiting for reviews.
Whiteboard: fix in hand → [rtm need info] fix in hand
Assignee | ||
Comment 18•24 years ago
|
||
*** Bug 56344 has been marked as a duplicate of this bug. ***
Comment 19•24 years ago
|
||
PDT marking [rtm-]. Easy workaround of selecting the pasted text and making it
Body Text.
Whiteboard: [rtm need info] fix in hand → [rtm-] fix in hand
Comment 20•24 years ago
|
||
*** Bug 56872 has been marked as a duplicate of this bug. ***
Comment 21•24 years ago
|
||
moving to future since pdt deems it not rtm critical
Target Milestone: --- → Future
Assignee | ||
Comment 22•24 years ago
|
||
*** Bug 57041 has been marked as a duplicate of this bug. ***
Comment 23•24 years ago
|
||
Can we get this into the trunk, please?!
Comment 25•24 years ago
|
||
Suggest: OS=ALL since it also appears under Linux (see bug 57041)
Comment 26•24 years ago
|
||
The <pre> thing is also causing bug 55661. (jfrancis@netscape.com mentioned
this in the first 10-13-00 comment.)
Updated•24 years ago
|
OS: Windows NT → All
Hardware: PC → All
Comment 27•24 years ago
|
||
Ok, can someone explain to me why this bug with fix-in-hand has been pushed out
to 0.9?
Comment 28•24 years ago
|
||
Do we all agree that the data is pasted as <pre>, not quotation (<blockquote
type=cite>)? marina, is it that what you saw? Assuming "yes", and changing SUMMARY.
Summary: Text copied from the Subject field is pasted into the body as a quotation → Text copied from the Subject field is pasted into the body as a <pre>
Comment 29•24 years ago
|
||
jfrancis,
what happens if I paste into a multipline text field? The newlines are annoying
there, too.
What happens if I paste into an HTML-capable third-party app (on an OS that
understands extended formats)?
Comment 30•24 years ago
|
||
One more comment (sorry for spamming):
Why don't you get rid of the <pre> comletely and you covert the data into real
HTML, like we do in the Mail Viewer for format=flowed msgs? There, we convert
all but the last space in a row into | |s and newlines into |<br>|s. The
only reason why you still see a fixed width font is that we explicitly force a
monospace font (if the prefs says so, which it does by default).
That way, you wouldn't have to special-case in the pasting code, but the copy
code would "do the right thing".
Comment 31•24 years ago
|
||
Can we get a review, super review and module approval on this fix?
Assignee | ||
Comment 32•24 years ago
|
||
Ben, I think an even simpler solution might be to simply refuse to do html copy
for plaintext editors, ie, just put the plaintext flavor on the clipboard.
Assignee | ||
Comment 33•24 years ago
|
||
the same reason as any other fix in hand bug that gets pushed out: Netscape
Product Delivery Team made the call. I'm glad I don't have their job, it's
custom made for pissing folks off.
Comment 34•24 years ago
|
||
> Ben, I think an even simpler solution might be to simply refuse to do html copy
> for plaintext editors, ie, just put the plaintext flavor on the clipboard.
Yes, that would be the best approach IMO. (I don't know, why I didn't have that
idea myself - it is the obvious solution.)
Comment 35•24 years ago
|
||
Lots of people keep asking about this. We should release note it.
Keywords: relnoteRTM
Whiteboard: [rtm-] fix in hand → [rtm-] fix in hand relnote-user
Comment 36•24 years ago
|
||
Adding to Composer section of RTM release notes.
Comment 37•24 years ago
|
||
*** Bug 59573 has been marked as a duplicate of this bug. ***
Comment 38•24 years ago
|
||
Nominate for nsbeta1 since it's very high on the list of annoying mozilla bugs
that make me want to go back to 4.x.
Keywords: nsbeta1
Assignee | ||
Comment 39•24 years ago
|
||
i need to redo my fix for this, per my earlier comment, to the much simpler
approach of simply forcing a plaintext serilization when copying text fields/
areas/other plaintext widgets.
Assignee | ||
Comment 40•24 years ago
|
||
*** Bug 55661 has been marked as a duplicate of this bug. ***
Comment 41•24 years ago
|
||
From bug 56661:
This extra newline happens with *any* <pre> formatted text, or with text from
any widgets (textareas, input boxes, or even the Location bar). It also happens
if you are viewing a text/plain file in Mozilla.
It might be worth changing the subject, and re-evaluating the priority of this
bug, since it affects much more than just copying from Subject and pasting into
Body.
Comment 42•24 years ago
|
||
*** Bug 66121 has been marked as a duplicate of this bug. ***
Comment 43•24 years ago
|
||
Replacing kristif with robinf on the cc: as Robin Foster-Clark is now the doc
contact for Composer.
Comment 44•24 years ago
|
||
Changing summary according to Scott's comment to make things clearer (hopefully).
BTW, the product here is MailNews, but this happens (also) in the browser. Is
this bug still assigned to the right product/component?
Summary: Text copied from the Subject field is pasted into the body as a <pre> → Text copied from <pre> formatted text or from widget gets pasted with an extra newline
Comment 45•24 years ago
|
||
MailNews/Composition is probably not really the best component for this, but
changing component would change the Assigned To, and since jfrancis wrote the
patch, we probably shouldn't do that. Unless jfrancis wants to make the change,
and then re-assign the bug to himself.
What's the holdup on this patch getting into the nightlies? It's a really
irritating bug, and there's a fix for it . . .
Assignee | ||
Comment 46•24 years ago
|
||
my fix is not the right fix. i have to rework it. odds are late this week it
will land.
Updated•24 years ago
|
Component: Composition → DOM to Text Conversion
Product: MailNews → Browser
Comment 47•24 years ago
|
||
Bug 55661 (dup of this bug) has a bunch of dups, and this bug also has a bunch
of direct dups, so marking as mostfreq.
Keywords: mostfreq
Comment 48•24 years ago
|
||
*** Bug 66968 has been marked as a duplicate of this bug. ***
Comment 49•24 years ago
|
||
*** Bug 67051 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 50•24 years ago
|
||
i've reworked my fix into a simpler one that simply forces copying from text
widgets to do a plaintext copy. I need to add some code to also catch the case
of copy from a fullblown plaintext editor.
Copying from inside a <pre> in an html document (whether in an html editor or
simply in the browser) is a tougher issue and will require investigation.
Comment 51•24 years ago
|
||
*** Bug 67686 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 52•24 years ago
|
||
fixed. text copied from text fields, text areas, and plaintext editors should
now copy only as plaintext, instead of as html ina <pre>. Text that really is
in an html <pre> will still copy as a pre block. We can open a seperate bug on
this if people care about it... it will require a different fix.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 53•24 years ago
|
||
While vfying, please make sure that the DUP busg are fixed, too, especially bug
55661.
Comment 54•24 years ago
|
||
bug 55561 is _not_ fixed (linux build from 2001-01-20-07 morning). Since
copying from <pre> still adds newlines and plaintext files are displayed as
<pre>.....
jfrancis, it would be good to fix this for text in <pre> as well, since
currently copying from plaintext files (eg RFCs) and bugzilla comments puts a
newline at the end of copied text. Also, I still see the newline issue when
copying from "view source".
verifying fixed on linux for textareas, plaintext editors, and textfields.
Should we just reopen bug 55561? Or file a new bug on the remaining work?
Comment 55•24 years ago
|
||
er, I meant bug 55661 is not fixed.
Assignee | ||
Comment 56•24 years ago
|
||
i've reopened (and renamed) 55661 to address remaining issue.
Comment 57•24 years ago
|
||
Hip hip hooray! Thanks!
Comment 58•24 years ago
|
||
linefeeds have now completely vanished when copying from a form.
Related? (see bug 68166)
Comment 59•24 years ago
|
||
Also, cannot copy HTML tags from a form. Appeared around the time of this
checkin (bug 68870)
Comment 60•24 years ago
|
||
Looks ok to me using apr17 ccommercial trunk build.
Status: RESOLVED → VERIFIED
Comment 61•23 years ago
|
||
Hmm... This still happens, see bug 90932
Comment 62•23 years ago
|
||
Please reopen, this is a regression (read bug 90932). While you're at it, add
keyword to list.
Comment 63•23 years ago
|
||
Works for me (in text fields and text controls, which is what this bug covers).
You need to log in
before you can comment on or make changes to this bug.
Description
•