Open wipfl opened 3 years ago
``Hi,
thank you for submitting this issue. Actually this effect can be spotted in other ui-nodes (including my own) following the same scheme for placing the HTML code onto the dashboard.
function HTML(config) {
var configAsJson = JSON.stringify(config);
var html = String.raw`
<input type='hidden' ng-init='init(` + configAsJson + `)'>
`;
return html;
}
@dceejay : I'm not into regex but after googling perhaps this helps ... (but there must be a better solution to correctly escape inverted commas of all kind correctly) - also as this effect only seams to effect values on first level of the config object (in the columns array they work fine) it is perhaps not necessary to replace all ' apostrophes.
function HTML(config) {
var configAsJson = JSON.stringify(config).replace(/[\/\(\)\']/g, "'");
var html = String.raw`
<input type='hidden' ng-init='init(` + configAsJson + `)'>
`;
return html;
}
(BTW Now as I know that the info parameter is passed to the dashboard I will perhaps be less generous with long markdowns in my UI nodes 😂)
Simply deleting or excluding the config.info property may fix this but the problem appear in widgets with labels too (config.label)
Which node are you reporting an issue on?
nod-red-node-ui-table 0.3.10
What are the steps to reproduce?
Note: Double quotes don't disturb. Single quotes in the table content are also not an issue.
What happens?
The table is not rendered if a single quote character is in the description (info)
What do you expect to happen?
The table should render. The description should have no influence on the behaviour of the node.
A simple work-around would be to remove the
info
field from the object for this purpose.Please tell us about your environment: