mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
Close #1451: render safe HTML in table output
This commit is contained in:
@@ -10,8 +10,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="row in $ctrl.rows">
|
||||
<td ng-repeat="column in $ctrl.columns">
|
||||
{{column.formatFunction(row[column.name])}}
|
||||
<td ng-repeat="column in $ctrl.columns" ng-bind-html="$ctrl.sanitize(column.formatFunction(row[column.name]))">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -2,7 +2,9 @@ import { sortBy } from 'underscore';
|
||||
import template from './dynamic-table.html';
|
||||
import './dynamic-table.css';
|
||||
|
||||
function DynamicTable() {
|
||||
function DynamicTable($sanitize) {
|
||||
'ngInject';
|
||||
|
||||
this.itemsPerPage = this.count = 15;
|
||||
this.page = 1;
|
||||
this.rowsCount = 0;
|
||||
@@ -41,6 +43,10 @@ function DynamicTable() {
|
||||
}
|
||||
};
|
||||
|
||||
this.sanitize = (value) => {
|
||||
return $sanitize(value);
|
||||
}
|
||||
|
||||
this.sortIcon = (column) => {
|
||||
if (column !== this.orderByField) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user