Changeset 1868
- Timestamp:
- 2008-04-02 07:58:55 (5 months ago)
- Files:
-
- 1 modified
-
MediaWiki/trunk/plugins/mediawiki/fckplugin.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
MediaWiki/trunk/plugins/mediawiki/fckplugin.js
r1866 r1868 97 97 var stringBuilder = new Array() ; 98 98 this._AppendNode( rootNode, stringBuilder, '' ) ; 99 return stringBuilder.join( '' ). Trim() ;99 return stringBuilder.join( '' ).RTrim() ; 100 100 }, 101 101 … … 509 509 this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ; 510 510 this._inLSpace = false ; 511 if ( stringBuilder[stringBuilder.length-2] == "\n" && stringBuilder[stringBuilder.length-1] == " " ) 512 stringBuilder.pop() ; 513 else 511 if ( !stringBuilder[stringBuilder.length-1].EndsWith("\n") ) 514 512 stringBuilder.push( "\n" ) ; 515 513 } … … 526 524 this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ; 527 525 this._inPre = false ; 526 528 527 stringBuilder.push( '<\/' ) ; 529 528 stringBuilder.push( sNodeName ) ; 530 stringBuilder.push( '>' ) ; 529 stringBuilder.push( '>' ) ; 531 530 } 532 531 … … 561 560 if ( !parentIsSpecialTag ) 562 561 { 562 if ( FCKBrowserInfo.IsIE && this._inLSpace ) { 563 textValue = textValue.replace(/\r/, "\r ") ; 564 } 565 563 566 textValue = textValue.replace( /[\n\t]/g, ' ' ) ; 564 567 … … 566 569 textValue = textValue.replace( /\u00A0/g, ' ' ) ; 567 570 568 if ( !htmlNode.previousSibling ||569 ( stringBuilder.length > 0 && stringBuilder[ stringBuilder.length - 1 ].EndsWith( '\n' ) ) && !this._inLSpace )571 if ( ( !htmlNode.previousSibling || 572 ( stringBuilder.length > 0 && stringBuilder[ stringBuilder.length - 1 ].EndsWith( '\n' ) ) ) && !this._inLSpace && !this._inPre ) 570 573 { 571 574 textValue = textValue.LTrim() ; 572 575 } 573 576 574 if ( !htmlNode.nextSibling && !this._inLSpace && (!htmlNode.parentNode || !htmlNode.parentNode.nextSibling))577 if ( !htmlNode.nextSibling && !this._inLSpace && !this._inPre && (!htmlNode.parentNode || !htmlNode.parentNode.nextSibling)) 575 578 textValue = textValue.RTrim() ; 576 579 577 textValue = textValue.replace( / {2,}/g, ' ' ) ; 580 if (!this._inLSpace && !this._inPre) 581 textValue = textValue.replace( / {2,}/g, ' ' ) ; 578 582 579 583 if ( this._inLSpace && textValue.length == 1 && textValue.charCodeAt(0) == 13 ) … … 583 587 } 584 588 else 585 { 589 { 586 590 textValue = FCKTools.HTMLDecode(textValue).replace(/fckLR/g,'\r\n'); 587 591 }