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

feat: support json content (without disabling sanitizers) #415

Merged
merged 4 commits into from
Jul 24, 2019

Conversation

pimlie
Copy link
Collaborator

@pimlie pimlie commented Jul 24, 2019

Resolves: #247

Quick workaround to circumvent the need for having to disable sanitization for JSON based content in script tags. Just use a json prop instead of innerHTML and the passed value is added by calling JSON.stringify on it. There is no error handling when the supplied json is faulty

@pimlie pimlie requested review from atinux and manniL July 24, 2019 08:37
test: fix json escaping
src/shared/escaping.js Outdated Show resolved Hide resolved
@pimlie pimlie changed the title feat: add json prop to bypass sanitizers feat: support json content (without disabling sanitizers) Jul 24, 2019
@pimlie pimlie merged commit 51fe6ea into master Jul 24, 2019
@pimlie pimlie deleted the feat-json-prop branch July 24, 2019 12:11
@manniL manniL mentioned this pull request Oct 8, 2019
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.

Create a more integrated solution for including JSON-LD
2 participants