-
Notifications
You must be signed in to change notification settings - Fork 374
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
issue301 Closes #301 Adds an htmlEntity helper for entities that should ... #417
Conversation
@@ -17,8 +17,8 @@ test('#unescapeHTML', function(){ | |||
equal(unescapeHTML('&'), '&'); | |||
equal(unescapeHTML('&'), '&'); | |||
equal(unescapeHTML(''), ''); | |||
equal(unescapeHTML(' '), ' '); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests for all the htmlEntities?
How about adding support for this additional htmlEntities to |
Maybe a list of supported htmlEntities in the readme would be nice for users. |
@stoeffel I addressed your great feedback, thanks. Let me know if you see any issues with the updated commit. |
If 'helpers/escapeChars' is only used in |
Yes, I was able to remove the map reversing and explicitly build the escapeChars map once. Good suggestion 😄 |
Anything else @stoeffel ? |
No, I think it looks good. I will check again as soon as I have time and then merge it. Thanks |
gt: '>', | ||
quot: '"', | ||
amp: '&', | ||
'#39': "'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for this. Checkout line 12 in unescapeHtml
.
…that should be unescaped but do not need to be scaped. We can use the escapeChars helper to handle the smaller set of html escape chars
@stoeffel I removed the line you called out. Thanks. :) |
issue301 Closes #301 Adds an htmlEntity helper for entities that should ...
Thanks! |
...be unescaped but do not need to be scaped. We can use the escapeChars helper to handle the smaller set of html escape chars
Please note that I did not commit the dist/ files. My assumption is they get built at release time. I also added a set of the html entities, but it's not exhaustive. I could remove the extras and just add nbsp to the escape codes array.