enables the XSS safety mode
webix.ui ({
view: "spreadsheet",
xssSafe: true
});
When the parameter is set to true, Spreadsheet will:
The methods which are allowed to generate HTML by default are the following: "IMAGE", "HYPERLINK", "SPARKLINE", "CHECKBOX", "RADIO".
If you need to allow a custom method to generate HTML, while the xssSafe property is enabled, set the generateHTML parameter of the registerMathMethod() method to true. Check the example below:
const spreadsheet = webix.ui({
view: "spreadsheet",
xssSafe: true
});
spreadsheet.registerMathMethod("bold", v => `<b>${v}</b>`, null, true);
spreadsheet.setCellValue(1, 1, '=bold("text")');
Note that while using the method with allowed HTML generation in math formulas, you should specify only the method in the formula. For example: =IMAGE(...) will generate an image, but =IMAGE(...)&"text" will be escaped.
Back to top