GithubHelp home page GithubHelp logo

Nested tags sanitation about dompurify HOT 5 CLOSED

cure53 avatar cure53 commented on July 24, 2024 1
Nested tags sanitation

from dompurify.

Comments (5)

cure53 avatar cure53 commented on July 24, 2024

Hi, thanks for the feedback. Why would the nesting in this situation be illegal?

from dompurify.

arbixy avatar arbixy commented on July 24, 2024

Hi, actually I was using it for content filter so it is not really illegal.
I liked it very much that it works on a string.
Probably level sanitation isn't that simple because in practise the user doesn't know what markup is coming. Unless all <p> with content or by some other criteria are put to the desired node level probably that makes more sense.
Finally the lib is really nice but please add attribute sanitation for each kind of tag what the example shows is that attribute sanitation is global for all the markup.

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

Yeah, the problem with that is, that we first need to know what level of sanitation the user wants. And that might potentially differ from tag to tag. So it's pretty much impossible to do that without very complex config options.

"please add attribute sanitation for each kind of tag"

Nah, not gonna happen :) But what we are planning to do is implementing a plugin API where you can implement these things on your own without much effort. We believe that's better than bloating the library with individual requests (that are often very much valid - but rarely generalizable enough for a core change). That should then also allow you to implement the mentioned flattening / nesting filter.

Sounds good?

from dompurify.

arbixy avatar arbixy commented on July 24, 2024

Yeah, 10x :)

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

I'll close this for now

from dompurify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.