Skip to content

Conversation

@jetNull
Copy link

@jetNull jetNull commented Dec 7, 2012

Minor modification that adds nbsp -> ' ' to the list of escaped characters, and added space to the escape characters regex.

Output examples:

escapeHTML('This is a test')
"This is a test"

unescapeHTML("This is a test")
"This is a test"

@rwz
Copy link
Collaborator

rwz commented Dec 8, 2012

Wait, this change is incorrect.

nbsp is a non-breaking-space. And this is a completely different character from regular space. It has it's own code and different purpose. Also, there is no point escaping it, since as far as I know it doesn't affect anything.

It makes sense to unescape it properly though. Which can be done quite easily.

@Broham
Copy link

Broham commented Aug 8, 2014

When I try to unescape   it does not work. For example if I run this code:

console.log _s.unescapeHTML(" ")

it outputs  

You mentioned that it can be done quite easily. Does this mean it can be done quite easily using the unescape function?

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

Successfully merging this pull request may close these issues.

3 participants