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

question: Is there a way to whitelist tags? #139

Open
DarkGuy10 opened this issue Mar 7, 2022 · 1 comment
Open

question: Is there a way to whitelist tags? #139

DarkGuy10 opened this issue Mar 7, 2022 · 1 comment

Comments

@DarkGuy10
Copy link

Im going to use this for rendering user-generated html

does the parser also parse unsafe tags like <script> ?

and is there a way I can whitelist only certain tags to be parsed?

Eg:

<p><img ...></p>

should be parsed to

<p>
&lt;img ...&gt;
<p>

instead of

<p>
<img ... />
<p>
@ElegantSoft
Copy link

You can add a an array inside should process node function and check if the tag exists in that array or not
And if not return an escaped string version of it

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

No branches or pull requests

2 participants