Comments (10)
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 <script>
tag is indeed ignored when building the search index, but it is not ignored in the search preview.
Note that in your example the Plotly stuff is only shown because the word "geometry" is also used somewhere else on the page.
If you search for "GeoJSON", you'll find nothing, even though the word is right next to "geometry".
from nbsphinx.
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 raw
directive (without using nbsphinx
), then you could raise this as a Sphinx issue.
from nbsphinx.
Ok, so what I understand from the code there is that in principle everything inside a script
tag is ignored, right?
Thanks, I'll try to dig deeper!
from nbsphinx.
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:
grep -n "not have a valid GeoJSON geometry" geometry_plot.html | cut -d : -f 1
I get a match on line 208, which is where the plotly library is included inside a script tag.
from nbsphinx.
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 .iypnb
file with outputs?
from nbsphinx.
Yes, I'll send it to you as soon as I get home 👍
Thanks for the broken link report!
from nbsphinx.
Here it is: GeometryPlot.zip
from nbsphinx.
Thank you very much! That's an interesting bug 😅
I guess I can close this then 👍
from nbsphinx.
That's an interesting bug
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 librsvg
library I've read recently: https://nvd.nist.gov/vuln/detail/CVE-2023-38633
In that case, the common piece of data was a URL, which was rejected by one sub-system, but not by another, which resulted in a potential exploit.
from nbsphinx.
Love this! Thanks!
from nbsphinx.
Related Issues (20)
- Failure on multi-line maths with leading indentation
- Scroll long output HOT 1
- 0.9.2: documentation build fails HOT 1
- `DataFrame` with long column labels is not rendered correctly with the `pydata` theme HOT 1
- What's the best way to add support for sphinx directives in markdown cells? HOT 3
- xelatex support HOT 3
- How to link to a notebook from another file ? HOT 2
- WARNING: toctree glob pattern '*.ipynb' didn't match any documents HOT 1
- Math rending issue after converting the doc HOT 1
- nbsphinx PDF don't render Ploty Plot HOT 2
- Backslashes in markdown cells are sometimes incorrectly interpreted as inline TeX HOT 4
- Error on cells using tqdm
- Error on cells using progress bar (tqdm) HOT 7
- Custom nbsphinx-gallery.css does not take into account - sphinx 7.2.6 HOT 7
- drop dependency to pandoc ? HOT 1
- AssertionError in `depart_codearea_latex()` HOT 4
- Conflict between sphinx.ext.autosectionlabel and nbsphinx HOT 2
- Matplotlib figures are not shown on the compiled documentation. HOT 6
- Default thumbnail asset not found HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbsphinx.