Better handling of bookmarks #580
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We ran into #542 at work today, so I sat down to figure out why the issue exists and how to solve it.
Here's a mostly client-side solution for the issue. (Instead of handling quotes and escaping them correctly on the python side I just pass them as
"
entities down from the web ui)The problem stems from the HTML concatenation in
refresh_bookmarks
, where any bookmarks containing quotes will end up breaking the generated HTML, before bubbling upwards to affect saving and browsing to the saved bookmarks as well.The same issue also happens in modal_managebookmarks.tpl where HTML is generated containing quotes instead of
"
entities.I'll see about maybe adding in some validation on the server side as well tomorrow, replacing HTML entities when loading and saving to the database.
An additional fix that's included here changes the generated links in the bookmarks modal to actually link to the search page instead of just being a link of the bookmark search text.