Closed Bug 192507 Opened 22 years ago Closed 21 years ago

extra new lines added when breaking up quoted material

Categories

(Core :: DOM: Editor, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: barrowma, Assigned: mozeditor)

Details

(Whiteboard: EDITORBASE+. fixinhand, patch)

Attachments

(2 files)

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
Whiteboard: EDITORBASE
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
EDITORBASE+
QA Contact: sujay → beppe
Whiteboard: EDITORBASE → EDITORBASE+
nsbeta1+
Keywords: nsbeta1nsbeta1+
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
snagging from joe.  will work with him to fix this...
Assignee: jfrancis → nisheeth
Status: ASSIGNED → NEW
Whiteboard: EDITORBASE+ → EDITORBASE+. fixinhand, patch
extends earlier fix that was for inline mailcites (used in plaintext mail) to
also cover block mailcites (used in html mail).
snarfing bug back...
Assignee: nisheeth → jfrancis
Attachment #126445 - Flags: superreview?(kin)
Attachment #126445 - Flags: review?(brade)
Comment on attachment 126445 [details] [diff] [review]
patch to SplitMailCites() in nsHTMLEditRules.cpp

r=brade
Attachment #126445 - Flags: review?(brade) → review+
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+
fix checked into trunk.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: