Skip to content

Only purify HTML for cross-origin nutshells#40

Open
staadecker wants to merge 1 commit intoncase:mainfrom
staadecker:patch-1
Open

Only purify HTML for cross-origin nutshells#40
staadecker wants to merge 1 commit intoncase:mainfrom
staadecker:patch-1

Conversation

@staadecker
Copy link
Copy Markdown
Contributor

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 id or class within 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.

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 this pull request may close these issues.

1 participant