Only purify HTML for cross-origin nutshells#40
Open
staadecker wants to merge 1 commit intoncase:mainfrom
Open
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I wanted to use nutshell on my website with latex (well katex actually) but all the
class="katex-mathml"attributes were being stripped so the latex wouldn't display properly.This PR changes the code such that the HTML is only cleaned when coming from a different origin. The argument is that users know their own website well enough and will often want styling to carry across pages.
Despite being only 2 lines of code this is a big change. I don't know enough about the library (or javascript honestly) to know if this change is desirable. This will likely break things for some users where an
idorclasswithin a nutshell now conflicts with the parent page and results in weird formatting. However, I thought I'd submit a PR in case this is useful for others as it was for me.