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

Fix: no highlighting of matched keywords in search results #5994

Merged
merged 3 commits into from
Jul 26, 2019
Merged

Fix: no highlighting of matched keywords in search results #5994

merged 3 commits into from
Jul 26, 2019

Conversation

dojutsu-user
Copy link
Member

@dojutsu-user dojutsu-user commented Jul 25, 2019

Many sphinx themes have highlighting styles for a span tag: span.highlighted, but elasticsearch uses <em> tag to mark the highlighted results, by default.
So results were not getting highlighted with the matched keywords.
Example:

Results:
Screenshot from 2019-07-25 22-36-25
Screenshot from 2019-07-25 22-35-29

Related PR: readthedocs/readthedocs-sphinx-search#41

@dojutsu-user dojutsu-user added the PR: work in progress Pull request is not ready for full review label Jul 25, 2019
@dojutsu-user dojutsu-user removed the PR: work in progress Pull request is not ready for full review label Jul 25, 2019
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

I'm not in love with this, because <em> actually has a display meaning, whereas <span> doesn't. This means if we theme doesn't have a special class for span.highlighted, it won't show up different at all, instead of at least being in italics. I'm not sure the best way to go with this, but I'm 👍 matching Sphinx I guess.

@ericholscher ericholscher merged commit b3c5e35 into readthedocs:master Jul 26, 2019
@dojutsu-user dojutsu-user deleted the fix-highlighting-prob branch July 26, 2019 14:16
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.

2 participants