File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,6 @@ function highlightRange(normedRange, cssClass) {
21
21
}
22
22
var white = / ^ \s * $ / ;
23
23
24
- var hl = $ ( "<span class='" + cssClass + "'></span>" ) ;
25
-
26
24
// Ignore text nodes that contain only whitespace characters. This prevents
27
25
// spans being injected between elements that can only contain a restricted
28
26
// subset of nodes such as table rows and lists. This does mean that there
@@ -33,9 +31,11 @@ function highlightRange(normedRange, cssClass) {
33
31
for ( var i = 0 , len = nodes . length ; i < len ; i ++ ) {
34
32
var node = nodes [ i ] ;
35
33
if ( ! white . test ( node . nodeValue ) ) {
36
- results . push (
37
- $ ( node ) . wrapAll ( hl ) . parent ( ) . show ( ) [ 0 ]
38
- ) ;
34
+ var hl = document . createElement ( 'span' ) ;
35
+ hl . className = cssClass ;
36
+ node . parentNode . replaceChild ( hl , node ) ;
37
+ hl . appendChild ( node ) ;
38
+ results . push ( hl ) ;
39
39
}
40
40
}
41
41
return results ;
You can’t perform that action at this time.
0 commit comments