Changeset 2087
- Timestamp:
- 2008-06-18 12:08:57 (2 months ago)
- Files:
-
- 1 modified
-
MediaWiki/trunk/plugins/mediawiki/fckplugin.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
MediaWiki/trunk/plugins/mediawiki/fckplugin.js
r2076 r2087 570 570 this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ; 571 571 this._inLSpace = false ; 572 if ( !stringBuilder[stringBuilder.length-1].EndsWith("\n") ) 572 var len = stringBuilder.length ; 573 if ( !stringBuilder[len-1].EndsWith("\n") && !stringBuilder[len-1].EndsWith(" ") && !stringBuilder[len-2].EndsWith("\n")) { 573 574 stringBuilder.push( "\n" ) ; 575 len++; 576 } 577 if (stringBuilder[len-1].EndsWith(" ") && stringBuilder[len-2].EndsWith("\n")) { 578 stringBuilder[len-1] = ""; 579 } 574 580 } 575 581 else … … 646 652 if ( this._inLSpace && textValue.length == 1 && textValue.charCodeAt(0) == 13 ) 647 653 textValue = textValue + " " ; 654 655 //1785 - remove extra line 656 if ( !this._inLSpace && !this._inPre && textValue == " " ) { 657 var len = stringBuilder.length; 658 if (len > 1) { 659 var tail = stringBuilder[len-2] + stringBuilder[len-1]; 660 if ( tail.toString().EndsWith( "\n" ) ) 661 textValue = ""; 662 } 663 } 664 648 665 if ( this._IsInsideCell ) 649 666 textValue = textValue.replace( /\|/g, '|' ) ;