#1355: Converting <p> to <pre> may add additional line breaks
----------------------+-----------------------------------------------------
  Reporter:  fredck   |       Owner:  martinkou    
      Type:  Bug      |      Status:  assigned     
  Priority:  Normal   |   Milestone:  FCKeditor 2.6
 Component:  General  |     Version:  SVN          
Resolution:           |    Keywords:  Review-      
----------------------+-----------------------------------------------------
Changes (by fredck):

  * keywords:  Review? => Review-

Comment:

 Ok... the code seemed ok to me now, but then I had some failures on some
 TCs.

 For example. Load the following code in the editor.

 {{{
 <pre>
     Line 1
     Line 2
     Line 3
 </pre>
 }}}

 Note that each line has 4 spaces in the beginning.

 Now, convert the above block to <p>. You will immediately note that Line 1
 is not aligned with the others. Switching to Source we have:

 {{{
 <p>&nbsp;&nbsp;&nbsp;&nbsp;Line 1<br>
 &nbsp;&nbsp;&nbsp;Line 2<br>
 &nbsp;&nbsp;&nbsp;Line 3</p>
 }}}

 So, none of the lines have been converted properly. Also, looking at the
 way browses handle followed spaces, the real space is always left "after"
 the &nbsp; sequence (which makes sense for line wrapping), while we are
 making it come before of it (my fault). So, changing line 781 to the
 following will fix Line 2 and Line 3:

 {{{
 return new Array( match.length ).join( '&nbsp;' ) + ' ' ;
 }}}

 The "Line 1" problem still persists though.

 The expected output is:

 {{{
 <p>&nbsp;&nbsp;&nbsp; Line 1<br>
 &nbsp;&nbsp;&nbsp; Line 2<br>
 &nbsp;&nbsp;&nbsp; Line 3</p>
 }}}

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/1355#comment:11>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to