Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ function displayHeaderCell(
);
}

function renderFormattedValue(formattedValue, allowRenderHtml) {
if (allowRenderHtml && typeof formattedValue === 'string') {
return safeHtmlSpan(formattedValue);
}
return formattedValue;
}

export class TableRenderer extends Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -742,7 +749,7 @@ export class TableRenderer extends Component {
onContextMenu={e => this.props.onContextMenu(e, colKey, rowKey)}
style={style}
>
{agg.format(aggValue)}
{renderFormattedValue(agg.format(aggValue), allowRenderHtml)}
</td>
);
});
Expand All @@ -759,7 +766,7 @@ export class TableRenderer extends Component {
onClick={rowTotalCallbacks[flatRowKey]}
onContextMenu={e => this.props.onContextMenu(e, undefined, rowKey)}
>
{agg.format(aggValue)}
{renderFormattedValue(agg.format(aggValue), allowRenderHtml)}
</td>
);
}
Expand All @@ -785,6 +792,7 @@ export class TableRenderer extends Component {
pivotData,
colTotalCallbacks,
grandTotalCallback,
allowRenderHtml,
} = pivotSettings;

const totalLabelCell = (
Expand Down Expand Up @@ -823,7 +831,7 @@ export class TableRenderer extends Component {
onContextMenu={e => this.props.onContextMenu(e, colKey, undefined)}
style={{ padding: '5px' }}
>
{agg.format(aggValue)}
{renderFormattedValue(agg.format(aggValue), allowRenderHtml)}
</td>
);
});
Expand All @@ -840,7 +848,7 @@ export class TableRenderer extends Component {
onClick={grandTotalCallback}
onContextMenu={e => this.props.onContextMenu(e, undefined, undefined)}
>
{agg.format(aggValue)}
{renderFormattedValue(agg.format(aggValue), allowRenderHtml)}
</td>
);
}
Expand Down