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

Feature request: allow sanitization configuration #150

Open
StephenFluin opened this issue Apr 16, 2021 · 1 comment
Open

Feature request: allow sanitization configuration #150

StephenFluin opened this issue Apr 16, 2021 · 1 comment

Comments

@StephenFluin
Copy link

I'd like to be able to pass a configuration option into rdmd.html(text,options) that lets me turn off some of the sanitization. For example, I'd like to allow iframes and script tags.

@kellyjosephprice
Copy link
Collaborator

Sorry for taking 2 years, but this should be possible with something like:

import { sanitizeSchema } from '@readme/markdown/sanitize.schema'
import * as rdmd from '@readme/markdown'

const schema = sanitizeSchema()
schema.strip = schema.strip.filter(tag => tag !== 'script')
schema.tagNames.push('iframe')

rdmd.html(text, { sanitize: schema })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants