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

fix: avoid closing the script tag early by escaping a forward slash #1665



Copy link

Closes #1562
Closes #802
Related #804
Related spatialaudio/nbsphinx#183

Having a widget like this:

import ipywidgets as widgets
widgets.Label("Let me bug you with a closing tag </script>")

left an invalid HTML document, since there was a closing script tag that the browser directly parses, escaping the forward slash works around this, see:

Copy link

Elegant, simple, clean,

@SylvainCorlay SylvainCorlay merged commit 11ea593 into jupyter:main Oct 27, 2021
maartenbreddels added a commit to maartenbreddels/nbsphinx that referenced this pull request Oct 27, 2021
@SylvainCorlay SylvainCorlay added this to the 6.3 milestone Nov 7, 2021
Copy link

mgeier commented Nov 24, 2021

It turns out that the tag name is case-insensitive and that browses also have a problem when the tag name is followed by a space (in this case it doesn't matter if a > is following or not.

Here's an example that makes problems:

widgets.Label('using </scRIPt can be problematic')

See also spatialaudio/nbsphinx#611.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
3 participants