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 3 commits into from Jul 26, 2019


Copy link

@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.

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 this to In progress in In-doc search UI via automation Jul 25, 2019
Copy link

@ericholscher ericholscher left a comment

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
1 check passed
@dojutsu-user dojutsu-user deleted the fix-highlighting-prob branch Jul 26, 2019
@dojutsu-user dojutsu-user moved this from In progress to Done in In-doc search UI Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
No open projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants