File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function convertResult(data) {
22
22
var newRow = [ ] ;
23
23
for ( var col = 0 ; col < count ; col ++ ) {
24
24
var value = convertCell ( currentRow [ columns [ col ] ] ) ;
25
- newRow [ col ] = value ;
25
+ newRow [ col ] = render ( value ) ;
26
26
result . columns [ col ] . sWidth = Math . max ( value . length * CHAR_WIDTH , result . columns [ col ] . sWidth ) ;
27
27
}
28
28
result . data [ row ] = newRow ;
@@ -37,6 +37,15 @@ function convertResult(data) {
37
37
}
38
38
return result ;
39
39
}
40
+ function render ( cell ) {
41
+ if ( typeof cell === 'string' ) {
42
+ if ( cell . match ( / ^ h t t p s ? : / ) ) {
43
+ if ( cell . match ( / ( j p g | p n g | g i f ) $ / i) ) return '<img style="display:inline;max-height:100%" src="' + cell + '">' ;
44
+ return '<a href="' + cell + '" target="_blank">' + cell + '</a>' ;
45
+ } ;
46
+ }
47
+ return cell ;
48
+ }
40
49
41
50
function convertCell ( cell ) {
42
51
if ( cell == null ) {
@@ -63,12 +72,6 @@ function convertCell(cell) {
63
72
}
64
73
return props ( cell ) ;
65
74
}
66
- if ( typeof cell === 'string' ) {
67
- if ( cell . match ( / ^ h t t p s ? : / ) ) {
68
- if ( cell . match ( / ( j p g | p n g | g i f ) $ / i) ) return '<img style="display:inline;max-height:100%" src="' + cell + '">' ;
69
- return '<a href="' + cell + '" target="_blank">' + cell + '</a>' ;
70
- } ;
71
- }
72
75
return cell ;
73
76
}
74
77
You can’t perform that action at this time.
0 commit comments