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

HTML sanitization removes class attribute in descriptions #3564

Closed
charwick opened this issue Aug 22, 2022 · 1 comment · Fixed by #3565
Closed

HTML sanitization removes class attribute in descriptions #3564

charwick opened this issue Aug 22, 2022 · 1 comment · Fixed by #3565
Milestone

Comments

@charwick
Copy link

As of Ipywidgets 8.0, Ipywidgets removes the class attribute from HTML in the description attribute (#2785). This seems like important functionality.

i = interactive(func, val=False)
circle='<span class="projectname_circle" style="background:#d73229"></span>' if circle is not None else ''
i.children[0].description_allow_html = True
i.children[0].description = circle+'Title'

The resulting markup:

<label class="widget-label-basic">
    <input type="checkbox">
    <span title="<span class=&quot;projectname_circle&quot; style=&quot;background:#d73229&quot;></span>Jam">
        <span style="background:#d73229"></span>Title
    </span>
</label>
@jasongrout jasongrout added this to the 8.0 milestone Aug 23, 2022
jasongrout added a commit to jasongrout/ipywidgets that referenced this issue Aug 23, 2022
@jasongrout
Copy link
Member

I've submitted a PR adding class back in to the allow list: #3565

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

Successfully merging a pull request may close this issue.

2 participants