-
Notifications
You must be signed in to change notification settings - Fork 21
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
Decode HTML in search result highlights #2166
Conversation
@@ -267,6 +267,13 @@ define([ | |||
if (docs && docs.length) { | |||
// make sure the new docs close highlights if they aren't there | |||
var newDocs = _.map(docs, function(d) { | |||
if (d.highlights) { | |||
d.highlights = d.highlights.map((h) => | |||
$('<textarea/>') |
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.
cool trick!
I would just move the $('<textarea/>)
part outside the loop so you aren't re-creating it every iteration
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.
Done
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.
LGTM
Address #2084 and #2050
Before
![Screen Shot 2021-05-19 at 5 51 57 PM](https://user-images.githubusercontent.com/636361/118902645-eb913a00-b8ca-11eb-904b-9afb8916a81b.png)
After
![Screen Shot 2021-05-19 at 5 51 00 PM](https://user-images.githubusercontent.com/636361/118902581-c8668a80-b8ca-11eb-8168-78149bd5fe93.png)