Closed Bug 202444 Opened 22 years ago Closed 7 months ago

preformatted is painful

Categories

(Core :: DOM: Editor, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 92921
Future

People

(Reporter: akkzilla, Unassigned)

Details

(Whiteboard: EDITORBASE+)

I've been trying to work with preformatted blocks lately -- writing documents containing preformatted code or pseudocode -- and it's very painful with composer, because of the <br> vs. newline munging. I understand the reason for the munging, but it makes the editor incredibly difficult to use -- even not being able to select blank lines, while annoying, would be far less painful. Two main problems: 1. Changing non-pre into pre (creating the block in the first place). Type: one<return> two<return> three Highlight all three lines and make preformatted. You end up with three separate preformatted blocks separated by whitespace. Not right at all. And I've never managed to clean up one of these messes without going into source mode. This also happens on copy/paste or drag/drop from a non-preformatted block into a preformatted block. Is there a workaround? I've ended up exporting the text to plaintext and opening it in some other app, typing some bogus characters into the editor, making them preformatted, copying from the plaintext app and pasting into the middle of the bogus chars, then deleting the bogus chars at the beginning and end of the block I just made. Is there an easier way? 2. Line length. There are no newlines anywhere in the html source in a preformatted block. Not only does that make the source impossible to read and maintain, but more important, it means that a lot of mail and news servers will refuse to send it because the line length is too long. I've tried going into source mode and adding newlines, but editor stomps them later. The only solution I've found is to split the pre into several different pre blocks (in source mode) and put newlines between them. But in this document I was using a visible style on <pre> so it was obvious where the blocks behan and ended, so splitting the pre had a visible effect, not what I wanted. I can't remember -- have we ever talked about having a serializer mode to always map <br> to NS_LINEBREAK at output time? (Hmm, if NS_LINEBREAK is \r\n will that show up as two lines, or just one?) That would be a hackaround for problem 2 though it wouldn't fix problem 1. Compare bug 92921, which says we should stop doing the br substitution: fixing that bug would also fix this one, but I'm filing this separately because if we don't stop using br, then these user-visible bugs should be fixed.
akkana, do you remember the last build ID/time when this wasn't as problematic? just wondering if it's a regression.
Nom editorbase.
Whiteboard: EDITORBASE
Sorry, I don't know whether this is a regression or not.
It's not a regression. Mozilla has been this way from very early on.
plussing per eb+ meeting
Whiteboard: EDITORBASE → EDITORBASE+
Priority: -- → P1
Target Milestone: --- → Future
Main problem #1 is bug 195089. The workaround is to make the paragraph preformatted before you paste. This bug should only address problem #2.
QA Contact: bugzilla → editor
Assignee: mozeditor → nobody
old bug
Priority: P1 → P3
Severity: normal → S3

Let's manage this issue in bug 92921.

Status: NEW → RESOLVED
Closed: 7 months ago
Duplicate of bug: 92921
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.