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

Substitution error #51

Closed
thiagorova opened this issue Sep 21, 2018 · 1 comment
Closed

Substitution error #51

thiagorova opened this issue Sep 21, 2018 · 1 comment

Comments

@thiagorova
Copy link

Hi,
first of all, thanks a lot, this package is pretty cool.
I found something that is, apparently, an error.

on the docs, it is saying that:

ex = '<a href="https://example.com">' +
        'lorem ipsum <strong>dolor</strong> <em>sit</em> amet' +
    '</a>'
"<a href="https://example.com">lorem ipsum <strong>dolor</strong> <em>sit</em> amet</a>"
stripTags(ex, [], '\n');

would yield:

lorem ipsum
dolor
 sit amet

The result, though, is this:

lorem ipsum 
dolor
 
sit
 amet

basically, if I'm not seeing anything weirdly, the problem is that striptags is substituting both the opening and the closing tag...

@ericnorris
Copy link
Owner

You are correct! That is expected, although the documentation being wrong is not :)

I'll update the README. Thanks!

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