File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2665,7 +2665,12 @@ var CodeMirror = (function() {
26652665 outPos += l ;
26662666 span_ ( text , style ) ;
26672667 // Output empty wrapper when at end of line
2668- if ( outPos == wrapAt && outPos == len ) html . push ( open + ( gecko ? "​" : " " ) + "</span>" ) ;
2668+ // (Gecko and IE8+ do strange wrapping when adding a space
2669+ // to the end of the line. Other browsers don't react well
2670+ // to zero-width spaces. So we do hideous browser sniffing
2671+ // to determine which to use.)
2672+ if ( outPos == wrapAt && outPos == len )
2673+ html . push ( open + ( gecko || ( ie && ! ie_lt8 ) ? "​" : " " ) + "</span>" ) ;
26692674 // Stop outputting HTML when gone sufficiently far beyond measure
26702675 else if ( outPos > wrapAt + 10 && / \s / . test ( text ) ) span = function ( ) { } ;
26712676 }
You can’t perform that action at this time.
0 commit comments