#1785: New lines and extra whitespaces removed inside a <pre> tag
--------------------------------------------+-------------------------------
  Reporter:  laurentiusoica                 |       Owner:           
      Type:  Bug                            |      Status:  new      
  Priority:  Normal                         |   Milestone:           
 Component:  Project : MediaWiki+FCKeditor  |     Version:           
Resolution:                                 |    Keywords:  Confirmed
--------------------------------------------+-------------------------------
Comment (by mertam):

 I hacked my code in fckplugin.js to somewhat solve this problem. I think
 it is ugly, but it works for me on IE and Firefox.

 {{{
 case 'pre' :
         var attribs = this._GetAttributesStr( htmlNode ) ;

         if ( htmlNode.className == "_fck_mw_lspace")
         {
                 .
                 .
                 .
         }
         else
         {
                 stringBuilder.push( '<' ) ;
                 stringBuilder.push( sNodeName ) ;

                 if ( attribs.length > 0 )
                         stringBuilder.push( attribs ) ;

                 stringBuilder.push( '>' ) ;
                 this._inPre = true ;

                 if ( FCKBrowserInfo.IsIE ) {
                        stringBuilder.push( htmlNode.innerText );
                 } else {
                        var insertText = htmlNode.innerHTML ;
                        insertText = insertText.replace( /\<br\>/g, '\n'
 );^M
                        stringBuilder.push( insertText ) ;
                 };

                 this._inPre = false ;
                 stringBuilder.push( '<\/' ) ;
                 stringBuilder.push( sNodeName ) ;
                 stringBuilder.push( '>' ) ;
         }

 }}}
 I think the real problem is that the _inPre property is not functioning as
 anticipated in the _AppendChildNodes and _AppendNode functions. Therefore,
 I completely avoid these functions for pre tags.

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/1785#comment:13>
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