GithubHelp home page GithubHelp logo

Comments (10)

mgeier avatar mgeier commented on July 26, 2024 1

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.

mgeier avatar mgeier commented on July 26, 2024

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.

pfebrer avatar pfebrer commented on July 26, 2024

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.

pfebrer avatar pfebrer commented on July 26, 2024

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.

mgeier avatar mgeier commented on July 26, 2024

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.

pfebrer avatar pfebrer commented on July 26, 2024

Yes, I'll send it to you as soon as I get home 👍

Thanks for the broken link report!

from nbsphinx.

pfebrer avatar pfebrer commented on July 26, 2024

Here it is: GeometryPlot.zip

from nbsphinx.

pfebrer avatar pfebrer commented on July 26, 2024

Thank you very much! That's an interesting bug 😅

I guess I can close this then 👍

from nbsphinx.

mgeier avatar mgeier commented on July 26, 2024

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.

zerothi avatar zerothi commented on July 26, 2024

Love this! Thanks!

from nbsphinx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.