My simple implementation of PHP strip_tags()

Márcio Martins via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 30 02:52:44 PDT 2017


On Wednesday, 28 June 2017 at 18:08:12 UTC, aberba wrote:
> I wanted strip_tags() for sanitization in vibe.d and I set out 
> for algorithms on how to do it and came across this JavaScript 
> library at 
> https://github.com/ericnorris/striptags/blob/master/src/striptags.js which is quite popular judging by the number of likes and forks. As a looked through, I didn't like the cumbersome approach it used so I tried to implement it in my own way. This is what I lazily did. It turns out to be so simple that I thought I could use some opinion. Notice I didn't add `tag_replacement` param but that's just like one line of code.
>
> [...]

I wrote this a while ago, not sure if it's useful for your 
purposes, but it has been working quite well so far: 
http://code.dlang.org/packages/plain


More information about the Digitalmars-d mailing list