Changeset 2088
- Timestamp:
- 2008-06-18 14:31:02 (3 months ago)
- Files:
-
- 1 modified
-
MediaWiki/trunk/plugins/mediawiki/fckplugin.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
MediaWiki/trunk/plugins/mediawiki/fckplugin.js
r2087 r2088 571 571 this._inLSpace = false ; 572 572 var len = stringBuilder.length ; 573 if ( !stringBuilder[len-1].EndsWith("\n") && !stringBuilder[len-1].EndsWith(" ") && !stringBuilder[len-2].EndsWith("\n")) { 574 stringBuilder.push( "\n" ) ; 575 len++; 576 } 577 if (stringBuilder[len-1].EndsWith(" ") && stringBuilder[len-2].EndsWith("\n")) { 578 stringBuilder[len-1] = ""; 573 if ( len>1 ) { 574 var tail = stringBuilder[len-2] + stringBuilder[len-1]; 575 if ( len>2 ) { 576 tail = stringBuilder[len-3] + tail ; 577 } 578 if (tail.EndsWith("\n ")) { 579 stringBuilder[len-1] = stringBuilder[len-1].replace(/ $/, ""); 580 } 581 else if ( !tail.EndsWith("\n") ) { 582 stringBuilder.push( "\n" ) ; 583 } 579 584 } 580 585 } … … 628 633 { 629 634 if ( FCKBrowserInfo.IsIE && this._inLSpace ) { 630 textValue = textValue.replace(/\r/, "\r ") ; 635 textValue = textValue.replace( /\r/g, "\r " ) ; 636 if (textValue.EndsWith( "\r " )) { 637 textValue = textValue.replace( /\r $/, "\r" ); 638 } 639 } 640 if ( !FCKBrowserInfo.IsIE && this._inLSpace ) { 641 textValue = textValue.replace( /\n(?! )/g, "\n " ) ; 631 642 } 632 643 … … 653 664 textValue = textValue + " " ; 654 665 655 //1785 - remove extra line656 666 if ( !this._inLSpace && !this._inPre && textValue == " " ) { 657 667 var len = stringBuilder.length;