Sanitize of Tooltip breaks the ability to style a tootlip or return multiple values
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.4k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 1
Description
Adding the sanitize (issue #1536) has taken away the ability to style or do more complex things in the tooltip.
I was using the format value to have both the value and the ratio returned for a pie chart and styled it by returning a html string
``` javascript
tooltip: {
format: {
value: function(value, ratio) {
var percentFormat = d3.format('.1%');
var twoDecimal = d3.format('.2f');
return '
- ' +
- ' + percentFormat(ratio) + ' ' +
' - ' + twoDecimal(value) + ' ' +
'
'
- ';
}
}
}
```
now with the sanitize this breaks I am unable return multiple values returned or stylized tooltip values.
maybe something like node plugin [sanitize-html](https://github.com/punkave/sanitize-html) and whitelist some tags instead of just putting it as a string.
Contributor guide
Assessment
This issue has not been assessed yet.