Ticket #1015: fckplugin.js.patch
File fckplugin.js.patch, 3.0 KB (added by , 16 years ago) |
---|
-
fckplugin.js
56 56 { 57 57 _inPre : false, 58 58 _inLSpace : false, 59 _appendSpace : false, 59 60 60 61 /* 61 62 * Returns a string representing the HTML format of "data". The returned … … 189 190 var basicElement = this._BasicElements[ sNodeName ] ; 190 191 if ( basicElement ) 191 192 { 193 192 194 if ( basicElement[0] ) 193 stringBuilder.push( basicElement[0] ) ; 195 { 196 var pNode = htmlNode.previousSibling; 197 198 if ( pNode != null && pNode.nodeType == 3 && ( pNode.nodeValue == " " || pNode.nodeValue == "" ) ) 199 { 200 pNode = pNode.previousSibling; 201 } 202 203 if ( pNode == null || !pNode.tagName || pNode.tagName.toLowerCase() != sNodeName || pNode.nodeValue != "" ) 204 { 205 stringBuilder.push( basicElement[0] ); 206 } 207 208 } 194 209 195 210 if ( !basicElement[2] ) 196 211 this._AppendChildNodes( htmlNode, stringBuilder ) ; 197 212 198 213 if ( basicElement[1] ) 199 stringBuilder.push( basicElement[1] ) ; 214 { 215 var nNode = htmlNode.nextSibling; 216 217 if ( nNode != null && nNode.nodeType == 3 && ( nNode.nodeValue == " " || nNode.nodeValue == "" ) ) 218 { 219 nNode = nNode.previousSibling; 220 } 221 222 if ( nNode == null || !nNode.tagName || nNode.tagName.toLowerCase() != sNodeName || nNode.nodeValue != "" ) 223 { 224 stringBuilder.push( basicElement[1] ); 225 } 226 227 } 228 229 if ( this._appendSpace == true ) 230 { 231 stringBuilder.push( " " ); 232 this._appendSpace = false; 233 } 234 200 235 } 201 236 else 202 237 { 238 this._appendSpace = false; 203 239 switch ( sNodeName ) 204 240 { 205 241 case 'ol' : … … 496 532 textValue = FCKTools.HTMLEncode( textValue ) ; 497 533 textValue = textValue.replace( /\u00A0/g, ' ' ) ; 498 534 499 if ( !htmlNode.previousSibling ||500 ( stringBuilder.length > 0 && stringBuilder[ stringBuilder.length - 1 ].EndsWith( '\n' ) ) && !this._inLSpace ) 535 if ( textValue != "" && ( !htmlNode.previousSibling || 536 ( stringBuilder.length > 0 && stringBuilder[ stringBuilder.length - 1 ].EndsWith( '\n' ) ) && !this._inLSpace ) ) 501 537 { 502 textValue = textValue.LTrim() ; 538 var newTextValue = textValue.LTrim() ; 539 if ( newTextValue != textValue ) 540 { 541 var old = stringBuilder[ stringBuilder.length - 1 ]; 542 stringBuilder[ stringBuilder.length - 1 ] = " "; 543 stringBuilder.push( old ); 544 } 545 546 textValue = newTextValue; 503 547 } 504 548 505 549 if ( !htmlNode.nextSibling && !this._inLSpace ) 506 textValue = textValue.RTrim() ; 550 { 551 var newTextValue = textValue.RTrim() ; 552 if ( newTextValue != textValue ) 553 { 554 this._appendSpace = true; 555 } 556 557 textValue = newTextValue; 558 } 507 559 508 560 textValue = textValue.replace( / {2,}/g, ' ' ) ; 509 561 … … 512 564 513 565 if ( this._IsInsideCell ) 514 566 textValue = textValue.replace( /\|/g, '|' ) ; 515 567 516 568 } 517 569 else 518 570 {