-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Make dialog-filename strings breakable #3446
Conversation
It seems like it would be really useful to have a util function that first escapes the url and then breaks it, since there are lots of stacked calls using those functions. An alternative, if possible, would be that |
@TomMalbran I thought about that, but didn't do anything, so thanks for inspiring me :) I took another look at the code and noticed that |
I checked that too, and it does make sense to always escape the url before breaking it, since when you call |
@TomMalbran Since you've already looked at this one, do you want to officially review it? |
var errMsg = StringUtils.format(Strings.ERROR_CREATING_FILE, | ||
StringUtils.htmlEscape(data.rslt.name), | ||
errString); | ||
var errMsg = StringUtils.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might look better to just replace the errMsg
in the Dialog, with these lines and not use the variable, since that is how it does everywhere else. If removing the errString
variable too, is good, then we can combine it all without additional variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I got rid of errMsg
, but left errString
.
Sure. I added a few comments there. I found that the Find In Files Label for scoped searches (FindInFiles.js:104) and the Close all documents (DocumentCommandHandlers.js:666) needs a break too. It does look nice in the dialogs and search results. |
Changes pushed. Good catch on DocumentCommandsHandlers.js:666 -- I only searched the strings.js file for 'dialog-filename'. I also fixed FindInFiles.js104. |
Thanks. I did a search for htmlEscape and checked the ones that where urls to find if there were more missing. This looks great. Merging |
Make dialog-filename strings breakable
This is for #3382. I found several other cases that need the same fix.