-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-red-node-ui-table not rendered if a single quote character is in the description (info) #66
Comments
``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?
I don't know the exact reason, but somehow a string is send to angular with the full object of the ui-table node. (I can't find the starting single quote!) The single quote character in the info-field of the object terminates this string and then the json lexer can't handle this string anymore. Maybe the stringifier is the base cause.
To my opinion this is also the reason for the issue node-red-node-ui-table does not render when Name field has a single quote in it #28
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:
The text was updated successfully, but these errors were encountered: