Skip to content
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

Merged
merged 3 commits into from
May 20, 2021

Conversation

shinyichen
Copy link
Member

@shinyichen shinyichen commented May 20, 2021

Address #2084 and #2050

Before
Screen Shot 2021-05-19 at 5 51 57 PM

Screen Shot 2021-05-19 at 6 36 11 PM

After
Screen Shot 2021-05-19 at 5 51 00 PM

Screen Shot 2021-05-19 at 6 33 41 PM

@@ -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/>')
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@thostetler thostetler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thostetler thostetler merged commit e978bdd into adsabs:master May 20, 2021
@shinyichen shinyichen deleted the highlightHTML branch May 24, 2021 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants