Tinkoff/utils.js

Sanitize supports only one tag

ch1ller0 opened this issue · 6 comments

Whether it was made intentionally or not, src/sanitize.js supports only one <em> tag. Are you planning to add some more important tags ( i.e <script>) or better yet let a developer himself to pass a Regex as an argument?

I suppose there should be also some support of tags with attributes, i.e. <em data-foo='bar'> will not be properly sanitized as the opening tag doesn't match /<em>|<\/em>/g.

Purpose of this utility is unclear. Maybe we should remove it instead of trying to build yet another sanitizing engine.

I think it would be a nice little feature over ramda/lodash libraries. As best to my knowledge only lodash has some sort of 'sanitizing engine' (https://lodash.com/docs/#escape), but it works a little bit different.

@Tom910 we really need the third opinion =)

We already have string/escape, and building another sanitize tool will be overkill to library purpose, so I'll better remove it at all.