-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Searchtools: don't assume that all themes define some elements #10153
Searchtools: don't assume that all themes define some elements #10153
Conversation
When retrieving a non-existent element, jQuery would still return an object (kind of empty one, so method calls won't raise a null exception), but now `getElementById` will return null and raise an exception when trying to call a method on that value. This mainly affects the rtd theme, which completely overrides the search page https://github.com/readthedocs/sphinx_rtd_theme/blob/d64dadf1ceec4f9ff6c1ca2d3ea4c3d0fdb0e8d2/sphinx_rtd_theme/search.html
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Ref #8871. To make this work we require: - sphinx-doc/sphinx#10153 - sphinx-doc/sphinx#10233 - A new release of https://github.com/readthedocs/readthedocs-sphinx-ext
Ref #8871. To make this work we require: - sphinx-doc/sphinx#10153 - sphinx-doc/sphinx#10233 - A new release of https://github.com/readthedocs/readthedocs-sphinx-ext
Ref #8871. To make this work we require: - sphinx-doc/sphinx#10153 - sphinx-doc/sphinx#10233 - A new release of https://github.com/readthedocs/readthedocs-sphinx-ext
A small note that Search is still broken for me with RTD theme with this pull request:
|
Which is related to intersphinx:
@jakobandersen Should I create a separate issue for it? |
That traceback doesn't make sense to me -- sphinx/sphinx/themes/basic/static/searchtools.js Lines 169 to 173 in ee298ac
A |
@marxin do you have a full minimal reproducer you could share? A |
I have a fix, moment. |
It got fixed with 0a36a47 which is not included |
May I merge this? |
From my side yes, and looks like this was approved too #10153 (review) |
Okay, merging this now. Thank you for your contribution! |
Feature or Bugfix
Purpose
When retrieving a non-existent element, jQuery would still return an
object (kind of empty one, so method calls won't raise a null
exception), but now
getElementById
will return null and raise anexception when trying to call a method on that value.
This mainly affects the rtd theme,
which completely overrides the search page
https://github.com/readthedocs/sphinx_rtd_theme/blob/d64dadf1ceec4f9ff6c1ca2d3ea4c3d0fdb0e8d2/sphinx_rtd_theme/search.html
Relates