Render markdown preview cells inside a shadow dom#120137
Merged
mjbvz merged 2 commits intomicrosoft:mainfrom Mar 30, 2021
Merged
Render markdown preview cells inside a shadow dom#120137mjbvz merged 2 commits intomicrosoft:mainfrom
mjbvz merged 2 commits intomicrosoft:mainfrom
Conversation
mjbvz
commented
Mar 30, 2021
| element.innerHTML = rendered; | ||
|
|
||
| // Insert styles into markdown preview shadow dom so that they are applied | ||
| for (const markdownStyleNode of document.getElementsByClassName('markdown-style')) { |
Collaborator
Author
There was a problem hiding this comment.
In the future, we should look into pulling in contributed styles through some explicit contribution point instead of this implicit convention
Fixes microsoft#119971 This moves all markdown previews into shadow doms. This lets us prevent styles from outside the preview leak into the preview, and also prevents styles from the preview leak out into the rest of the notebook
This lets us handle clicks triggered inside of a shadow dom
90563ac to
f3e3ddb
Compare
Collaborator
Author
|
Merging this to get additional testing in insiders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #119971
This moves all markdown previews into shadow doms. This lets us prevent styles from outside the preview leaking into the preview, and also prevents styles from the preview leaking out into the rest of the notebook