Open
Bug 205946
Opened 22 years ago
Updated 19 days ago
Get rid of annoying useless trailing <br> generated by editor in text and paragraphs
Categories
(Core :: DOM: Editor, defect, P3)
Core
DOM: Editor
Tracking
()
NEW
People
(Reporter: glazou, Unassigned)
References
(Blocks 4 open bugs)
Details
(Whiteboard: composer++)
Attachments
(2 obsolete files)
Test case #1 : 1. launch composer 2. type aaaaaa 3. CR 4. type bbbbbb 5. switch to source view Expected result: aaaaaa<br> bbbbbb Actual result: aaaaaa<br> bbbbbb<br> Test case #2 1. launch composer 2. select Format > Paragraph 3. type aaaaaa 4. CR 5. type bbbbbb 6. switch to source view Expected result: <p>aaaaaa<br> bbbbbb</p> Actual result: <p>aaaaaa<br> bbbbbb<br> </p>
Reporter | ||
Comment 1•22 years ago
|
||
Reporter | ||
Comment 2•22 years ago
|
||
Comment on attachment 123509 [details] [diff] [review] fix #1 jfrancis, can you r= please ? peter, can you sr= please ?
Attachment #123509 -
Flags: superreview?(peterv)
Attachment #123509 -
Flags: review?(jfrancis)
Reporter | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: composer++
Target Milestone: --- → mozilla1.5alpha
Reporter | ||
Comment 3•22 years ago
|
||
previous patch was buggy, getting rid of the <br> even in the case described in the comment in http://lxr.mozilla.org/seamonkey/source/editor/libeditor/html/nsWSRunObject.cpp#2064
Attachment #123509 -
Attachment is obsolete: true
Reporter | ||
Comment 4•22 years ago
|
||
Comment on attachment 124263 [details] [diff] [review] fix #2 Joe, please, can you r= this patch ?
Attachment #124263 -
Flags: review?(jfrancis)
Comment 5•22 years ago
|
||
Please describe to me exactly what these two changes do. They can't fix this bug, since this bug is not a but at all, as per the comment in http://lxr.mozilla.org/seamonkey/source/editor/libeditor/html/nsWSRunObject.cpp#2064
Comment 6•22 years ago
|
||
This may not strictly be a bug according to the comments, but it's definitely a bit of a kludge designed to support an antiquated typographical technique, and looks buggy when you view the code generated by Composer. Isn't there a cleaner way to achieve this? Rather than sprinkling a lot of unnecessary <br> tags throughout every piece of generated code just because some users like two spaces at the end of sentences. Currently it's a case of swapping one bug for another, where both really need to be resolved.
Reporter | ||
Comment 7•22 years ago
|
||
Joe, the patch (a) removes a trailing non visible <br> if the last char of the preceeding text node is not a white space (b) removed the trailing <br> in a paragraph when enter is pressed twice.
I downloaded 2003-may-27 build. Thanks for fix But:- 1) Still I get a <br> inside <body> of a new document. -------- new html document in composer begins ----- <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title></title> </head> <body style="background-image: url(about:blank);"> <br> </body> </html> -------- new html document in composer ends ----- 2) A <br> will be created in a empty tag <table><tr><td></td></tr></table> will be changed as <table> <tbody> <tr> <td><br> </td> </tr> </tbody> </table>
read comment http://lxr.mozilla.org/seamonkey/source/editor/libeditor/html/nsWSRunObject.cpp#2064 It seems extra <br> is not a bug, but a feature What if user dont want 2 spaces at the end of a sentence. Cant we have a preference setting to enable disable 2 spaces and extra <br> Also why <br> cant we have <br/> instead
Updated•21 years ago
|
Attachment #123509 -
Flags: superreview?(peterv)
Updated•21 years ago
|
Attachment #123509 -
Flags: review?(mozeditor)
Reporter | ||
Comment 10•21 years ago
|
||
Comment on attachment 124263 [details] [diff] [review] fix #2 this is buggy and obsolete
Attachment #124263 -
Attachment is obsolete: true
Comment 11•21 years ago
|
||
<br /> is preferable per recommendations for compatibility with existing user agents in W3C XHTML spec.
Comment 12•20 years ago
|
||
Let me clarify my earlier post. It may have been misunderstood: <br /> is better than <br/> per recommendations cited above. However, it is best to avoid the extra <br/> elements in the first place. In fact, <p>...</p> is often more appropriate than <br />.
Comment 13•19 years ago
|
||
*** Bug 255839 has been marked as a duplicate of this bug. ***
Updated•18 years ago
|
QA Contact: bugzilla → editor
Updated•16 years ago
|
Assignee: daniel → nobody
Flags: wanted1.9.2?
Target Milestone: mozilla1.5alpha → ---
Updated•16 years ago
|
Attachment #124263 -
Flags: review?(mozeditor)
Flags: wanted1.9.2?
Flags: wanted1.9.2-
Flags: blocking1.9.2-
Updated•15 years ago
|
Status: ASSIGNED → NEW
Comment 14•8 years ago
|
||
Is there a workaround, please? I need to obtain the exact content of contentEditable (white-space: pre-wrap) on input and have no idea how to identify the trailing <br> as desired or not (to remove it potentially). Inspiration: Take innerHTML, remove trailing <br> and put it to an element of the exact size and formatting. If the copy is NOT lower, the original <br> should be removed. In my use case this might be reliable, but the performance could be a problem.
Comment 15•6 years ago
|
||
Moving to p3 because no activity for at least 1 year(s). See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
Comment 16•6 years ago
|
||
Maybe the requirement can be even closed -- in FF 60, bug 1430551 was implemented and <br> should be replaced by <div> now.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•