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

Use default JupyterLab CSS sanitizer options for Markdown #6160

Merged
merged 1 commit into from
Sep 3, 2021

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Aug 27, 2021

Fixes jupyter-server/jupyter_server#577

6.4.1 removed all CSS styles from HTML inside of Markdown cells after moving to a maintained version of the sanitizer. This PR restores CSS styles in Markdown cells. For a test case of:

<span style="color: red; font-size: 30px">test</span>

Before:
Screenshot from 2021-08-28 17-00-57

After:
Screenshot from 2021-08-28 16-59-08

@krassowski krassowski marked this pull request as ready for review August 28, 2021 16:00
@krassowski
Copy link
Member Author

The question is whether CSS styles should also be allowed in the output:

if (type===MIME_HTML || type==='text/svg') {
var parsed = $(security.sanitize_html_and_parse(value));
toinsert = append.apply(this, [parsed, md, element, handle_inserted]);
} else {

I think that they should, just like they used to be and are in JupyterLab. Any thoughts?

@Zsailer
Copy link
Member

Zsailer commented Sep 3, 2021

I opened #6173 to follow-up on this question. In the meantime, I think we should merge this fix and cut a patch release to help unblock #6172.

@Zsailer Zsailer merged commit c06c340 into jupyter:master Sep 3, 2021
@krassowski krassowski deleted the patch-1 branch September 3, 2021 17:59
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there a recent change in CSS sanitization behaviour or is there a bug?
2 participants