locutusjs / locutus

Bringing stdlibs of other programming languages to JavaScript for educational purposes

Home Page:https://locutus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

strip_tags has some differences with php's version

losnappas opened this issue · comments

echo strip_tags("1<<<    a");
// => "1"
console.log(strip_tags("1<<<    a"))
// => "1<<<    a"

after = (after.substring(after.length - 1) === '<') ? after.substring(0, after.length - 1) : after

that line esp has some problems: strip_tags("1<<") // => "1<"

It looks like php version counts < characters and then deletes everything until it finds a matching closing one.