Changeset 1823

Show
Ignore:
Timestamp:
2008-03-27 17:37:14 (4 months ago)
Author:
wwalc
Message:

Fix for #1015 (Badly nested italic/bold markup).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • MediaWiki/trunk/plugins/mediawiki/fckplugin.js

    r1822 r1823  
    191191                                if ( basicElement ) 
    192192                                { 
     193                                        var basic0 = basicElement[0]; 
     194                                        var basic1 = basicElement[1]; 
     195 
    193196                                        if ( ( basicElement[0] == "''" || basicElement[0] == "'''" ) && stringBuilder.length > 2 ) 
    194197                                        { 
    195198                                                var pr1 = stringBuilder[stringBuilder.length-1]; 
    196199                                                var pr2 = stringBuilder[stringBuilder.length-2]; 
    197                                                  
    198                                                 if ( pr1 + pr2 == "'''''") 
    199                                                         stringBuilder.push( ' ' ) ; 
     200 
     201                                                if ( pr1 + pr2 == "'''''") { 
     202                                                        if ( basicElement[0] == "''") 
     203                                                        { 
     204                                                                basic0 = '<i>'; 
     205                                                                basic1 = '</i>'; 
     206                                                        } 
     207                                                        if ( basicElement[0] == "'''") 
     208                                                        { 
     209                                                                basic0 = '<b>'; 
     210                                                                basic1 = '</b>'; 
     211                                                        } 
     212                                                } 
    200213                                        } 
    201                                          
    202                                         if ( basicElement[0] ) 
    203                                                 stringBuilder.push( basicElement[0] ) ; 
     214 
     215                                        if ( basic0 ) 
     216                                                stringBuilder.push( basic0 ) ; 
    204217 
    205218                                        if ( !basicElement[2] ) 
    206219                                                this._AppendChildNodes( htmlNode, stringBuilder ) ; 
    207220 
    208                                         if ( basicElement[1] ) 
    209                                                 stringBuilder.push( basicElement[1] ) ; 
     221                                        if ( basic1 ) 
     222                                                stringBuilder.push( basic1 ) ; 
    210223                                } 
    211224                                else