Closed Bug 37687 Opened 24 years ago Closed 24 years ago

<pre> is not inserted correctly

Categories

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

x86
All
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: kazhik, Assigned: mozeditor)

Details

<p>Line 1</p>
<p>Line 2</p>

When I select "Line 2" and insert <pre>, I get the following result:

<pre>Line 2<pre>
<p>Line 1</p>
how are you inserting <pre>?  From the format menu or paragraph dropdown list or 
insert source dialog?
I got it to reproduce, this is what I did:
1. selected new composer window
2. entered 2 lines of text:
   here is some text
   here is more text
3. highlighted the 1st line of text, selected Format|Paragraph|Paragraph
4. highlighted the 2nd line of text, selected Format|Paragraph|Paragraph
5. selected "save" -- entered title and file name
6. selected View|Page Source -- both lines were wrapped in < P > tags
7. highlighted the 2nd line of text, selected Format|Paragraph|Preformat

- the 1st line of text became highlighted (which was weird)

8. selected save
9. selected View|Page Source

- the 1st line of text had been changed to < PRE > and the 2nd line of text 
ramained as a < P >
Status: UNCONFIRMED → NEW
Ever confirmed: true
I forgot to mention that I did not try using the toolbar -- the toolbar is a bit 
messed up today. Assigning to akkana for review -- reassign as appropriate
Assignee: beppe → akkana
Format->Paragraph->Paragraph is acting on the wrong part of the document, not on
the selection.

I'm having trouble seeing where this menu actually calls in the JS or editor
code ... I'm guessing Charley at least knows which routine is being called, and
might be able to triage it better.
Assignee: akkana → cmanske
The command path is difficult to follow with Simon's new command architecture!
But we end up in nsHTMLEditor::SetParagraphFormat() like we do with any of the
paragraph formats set via toolbar dropdown or menu. So it flows into Joe's code
from there. Sorry Joe!
Assignee: cmanske → jfrancis
fixed
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified fixed in my Win32 10/27/00 Netscape_20000922_BRANCH.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.