panzerdp / voca

The ultimate JavaScript string library
https://vocajs.pages.dev
MIT License
3.6k stars 136 forks source link

Strip HTML from Text #13

Closed nhaberl closed 7 years ago

nhaberl commented 7 years ago

Awesome library, would have a suggestion. v.stripHtml(htmlTagArray = [''])

If any htmlTag is given within the array the strip function is limited to them otherwise the function removes all html tags.

panzerdp commented 7 years ago

Hello @nhaberl,

Agreed, this is an important function to have. I will probably name it stripTags. It may have the following signature:

v.stripTags(string, [allowedTags = [ ] ])
IvanJov commented 7 years ago

@panzerdp I would like to work on this issue, if you don't mind. Should probably be done in couple days 😄

panzerdp commented 7 years ago

@IvanJov Thanks! However I already started the function implementation.

IvanJov commented 7 years ago

@panzerdp Sure, no problem. If you have ideas for some other function, I would love to help, just let me know!

panzerdp commented 7 years ago

The function v.stripTags() is implemented in the new version 1.1.0. See the docs: https://vocajs.com/#stripTags.

IvanJov commented 7 years ago

Great job @panzerdp !