extra new lines added when breaking up quoted material

RESOLVED FIXED in M1

Status

()

Core
Editor
RESOLVED FIXED
16 years ago
15 years ago

People

(Reporter: Dave Barrowman, Assigned: Joe Francis)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: EDITORBASE+. fixinhand, patch)

Attachments

(2 attachments)

(Reporter)

Description

16 years ago
Not sure if this belongs in editor core, but I have seen in in multiple editor
embedding mail apps.

When the caret is inside quoted (blue bar) material, and the user hits Enter, an
extra new line (an empty line with blue bar) is added.

Steps to reproduce:

1. open attachment to this bug in the browser (I will attach in next comment)
2. select all (ctrl-a) and paste into a new mail compose window
3. paste attachment's contents into the mail compose window
4. place the caret immediately to the right of the '1' character on the first line
5. hit Enter
6. you will see a new line without a blue bar (this is as expected) AND below
that you will also see a new line with a blue bar directly above the 2nd line of
text (this is a newly introduced blank line and is NOT as expected).

What I expect:
  |line1

  |line2
  |line3

What I see:
  |line1

  |
  |line2
  |line3


After following the steps above, a second bit or weirdness can be seen by
placing the caret directly to the left of the 'l' in the original second line
(which now has the undesired empty line with a blue bar above it) and hitting
Enter.  The blue bar of the line above disappears and the caret jumps up to it.
 My expectation is that a new empty line (with no blue bar) should be introduced
between the empty line and the original 2nd line.

What I expect:
  |line1

  |

  |line2
  |line3

What I see:
  |line1


  |line2
  |line3
(Reporter)

Comment 1

16 years ago
Created attachment 113976 [details]
test case for showing quoted material weirdness
(Reporter)

Updated

16 years ago
Whiteboard: EDITORBASE
(Assignee)

Comment 2

16 years ago
The first scenario is definitely a bug, and one which I have already spent some
time fighting.  Apparently there is more to be done.  The second scenario is a
bit harder to categorize.  I've had requests to never create empty mailquotes
under any circumstance.  I have a patch for that which has not yet landed. 
Ironically that fix will make the behavior you see in your second example be the
norm.

I think if we fix the first problem, though, users will seldom experience the
second.

nominating nsbeta1.
Status: NEW → ASSIGNED
Keywords: nsbeta1
Target Milestone: --- → M1

Comment 3

16 years ago
EDITORBASE+
QA Contact: sujay → beppe
Whiteboard: EDITORBASE → EDITORBASE+
nsbeta1+
Keywords: nsbeta1 → nsbeta1+

Comment 5

16 years ago
Yes, this is easily reproduced. Please note that the lines must have a retrun
for the extra line to occur. So, if you have the following

| blah blah blah blah <wrap>
| blah blah blah

and you select the end of the first line and hit return, you do not get the
extra line, however, if you have this:
| blah blah blah blah <return>
| blah blah blah

you will get the extra line. The code looks like this:

Before:
<span type="cite">Beth Epperson wrote:</span>
<p> </p>
<blockquote type="cite"
 style="border-left: thin solid blue; padding-left: 10px; margin-left: 0pt;">
  <title>&lt;title&gt;</title>
  <div> test test test<br>
  <br>
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah
<br>
  <span>-- <br>

After a return is hit between the test test test and the blah blah ...
<span type="cite">Beth Epperson wrote:</span>
<p> </p>
<blockquote type="cite"
 style="border-left: thin solid blue; padding-left: 10px; margin-left: 0pt;">
  <title>&lt;title&gt;</title>
  <div> test test test</div>
</blockquote>
<br>
<blockquote type="cite"
 style="border-left: thin solid blue; padding-left: 10px; margin-left: 0pt;">
  <div><br>
  <br>
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blahblah blah blah blah
<br>

Now, if I select to break within the blah blah blah string, this is what I get:
<span type="cite">Beth Epperson wrote:</span>
<p> </p>
<blockquote type="cite"
 style="border-left: thin solid blue; padding-left: 10px; margin-left: 0pt;">
  <title>&lt;title&gt;</title>
  <div> test test test<br>
  <br>
blah blah blah blah blah blah blah blah blah blah blah blah blah blah </div>
</blockquote>
type type type<br>
<blockquote type="cite"
 style="border-left: thin solid blue; padding-left: 10px; margin-left: 0pt;">
  <div> blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah
<br>

Hope that helps

Comment 6

15 years ago
snagging from joe.  will work with him to fix this...
Assignee: jfrancis → nisheeth
Status: ASSIGNED → NEW
(Assignee)

Updated

15 years ago
Whiteboard: EDITORBASE+ → EDITORBASE+. fixinhand, patch
(Assignee)

Comment 7

15 years ago
Created attachment 126445 [details] [diff] [review]
patch to SplitMailCites() in nsHTMLEditRules.cpp

extends earlier fix that was for inline mailcites (used in plaintext mail) to
also cover block mailcites (used in html mail).
(Assignee)

Comment 8

15 years ago
snarfing bug back...
Assignee: nisheeth → jfrancis
(Assignee)

Updated

15 years ago
Attachment #126445 - Flags: superreview?(kin)
Attachment #126445 - Flags: review?(brade)

Comment 9

15 years ago
Comment on attachment 126445 [details] [diff] [review]
patch to SplitMailCites() in nsHTMLEditRules.cpp

r=brade
Attachment #126445 - Flags: review?(brade) → review+

Comment 10

15 years ago
Comment on attachment 126445 [details] [diff] [review]
patch to SplitMailCites() in nsHTMLEditRules.cpp

sr=kin@netscape.com

Was the ":" intentional?

+    // (in the inline case), and :
+    // it means the break wont end up making an empty line that happens to be
inside a
Attachment #126445 - Flags: superreview?(kin) → superreview+
(Assignee)

Comment 11

15 years ago
fix checked into trunk.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.