-
Notifications
You must be signed in to change notification settings - Fork 129
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
Avoid sphinx searching on output cells #777
Comments
Can you please show the HTML of the affected page? It looks like HTML tags are supposed to get stripped, see sphinx-doc/sphinx@53ea1cb It would be ideal if you could reproduce this with the |
Ok, so what I understand from the code there is that in principle everything inside a Thanks, I'll try to dig deeper! |
This is the page: https://zerothi.github.io/sisl/visualization/viz_module/showcase/GeometryPlot.html#GeometryPlot (I can't upload html files to github) And if I grep on that html file:
I get a match on line 208, which is where the plotly library is included inside a script tag. |
Thanks for the link! BTW, the "download ipynb" link is broken: https://raw.githubusercontent.com/zerothi/sisl/main//home/runner/work/sisl/sisl/docs/visualization/viz_module/showcase/GeometryPlot.ipynb I guess it is meant to be this: https://raw.githubusercontent.com/zerothi/sisl/main/docs/visualization/viz_module/showcase/GeometryPlot.ipynb However, this doesn't contain the outputs. Can you please provide the |
Yes, I'll send it to you as soon as I get home 👍 Thanks for the broken link report! |
Here it is: GeometryPlot.zip |
Thanks for the notebook file! Playing around with that, I could reduce this to a pure Sphinx problem: sphinx-doc/sphinx#12052 It looks like the Note that in your example the Plotly stuff is only shown because the word "geometry" is also used somewhere else on the page. |
Thank you very much! That's an interesting bug 😅 I guess I can close this then 👍 |
Yes indeed! It is a dangerous pattern to look out for: there is one piece of data (in our case the HTML source text) and there are two sub-systems handling that data separately (in our case the search index generation and the search preview generation). Those two systems are supposed to have the same behavior, but if they don't, we have a problem. This reminds me of a vulnerability of the |
Love this! Thanks! |
In our documentation, we have some notebooks rendered by
nbsphinx
which include plotly plots. The output cells of the notebook include the full plotly javascript library. When we use sphinx's search bar in our documentation, we get hits for plotly's javascript (circled in red):Is there any way to avoid this?
The text was updated successfully, but these errors were encountered: