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

RtD's embed JS calls Sphinx's Search.init unnecessarily #8862

Closed
pradyunsg opened this issue Jan 29, 2022 · 2 comments · Fixed by readthedocs/readthedocs-sphinx-ext#100
Closed
Labels
Bug A bug

Comments

@pradyunsg
Copy link

pradyunsg commented Jan 29, 2022

Details

Expected Result

Sphinx's search JS should only inject "Searching" once, but it calls it twice, resulting in an extra heading.

See https://sphinx--10028.org.readthedocs.build/en/10028/search.html?q=Hello

Actual Result

Read the Docs' embed JS calls Search.init even when not using the server-side search. This means that Sphinx's search is triggered twice, resulting in multiple "Searching" prompts on the search result. This is reproducible on other documentation sets, using the current stable version of Sphinx.

@pradyunsg pradyunsg changed the title RtD's embed JS meddles with Sphinx's search RtD's embed JS calls Sphinx's Search.init unnecessarily Jan 29, 2022
@TimKam
Copy link

TimKam commented Jan 30, 2022

Also, see the (in particular) this comment and the ones that follow.

@stsewd
Copy link
Member

stsewd commented Jan 31, 2022

Hi, we remove the Sphinx.init call from our custom extension, so we can call it when necessary. Seems like in the refactor, this was changed to be _ready(Sphinx.init);, so we need to update our extension to handle that. Will also look into the other error.

@stsewd stsewd added the Bug A bug label Jan 31, 2022
stsewd added a commit to readthedocs/readthedocs-sphinx-ext that referenced this issue Jan 31, 2022
On sphinx-doc/sphinx#10028
the `Sphinx.init` call was changed to be called with the `_ready`
function.

We need to update our regex to catch that,
otherwise `Sphinx.init` will be called twice.

Closes readthedocs/readthedocs.org#8862.
stsewd added a commit to readthedocs/readthedocs-sphinx-ext that referenced this issue Feb 3, 2022
On sphinx-doc/sphinx#10028
the `Sphinx.init` call was changed to be called with the `_ready`
function.

We need to update our regex to catch that,
otherwise `Sphinx.init` will be called twice.

Closes readthedocs/readthedocs.org#8862.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants