Skip to content

Commit 074740d

Browse files
committed
added url and image support for tables
1 parent 4d30aa2 commit 074740d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/cypher.datatable.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ function convertCell(cell) {
6464
return props(cell);
6565
}
6666
if (typeof cell === 'string') {
67-
if (cell.match(/https?:/)) return '<a href="'+cell+'" target="_blank">'+cell+'</a>';
67+
if (cell.match(/^https?:/)) {
68+
if (cell.match(/(jpg|png|gif)$/i)) return '<img style="display:inline;max-height:100%" src="'+cell+'">';
69+
return '<a href="'+cell+'" target="_blank">'+cell+'</a>';
70+
};
6871
}
6972
return cell;
7073
}

0 commit comments

Comments
 (0)