8000 unescape add & · Issue #5952 · lodash/lodash · GitHub
[go: up one dir, main page]

Skip to content

unescape add & #5952

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

Ope 8000 n
wjx0912 opened this issue Dec 26, 2024 · 2 comments
Open

unescape add & #5952

wjx0912 opened this issue Dec 26, 2024 · 2 comments

Comments

@wjx0912
Copy link
wjx0912 commented Dec 26, 2024
this method converts the HTML entities &, <, >, ", and ' in string to their corresponding characters.

but & can not convert, can add this feature, thanks
_.unescape('Couples Therapy Naked & Afraid')
current my source code:
_.unescape('Couples Therapy Naked & Afraid').replaceAll('&', '&')
@rahulnshah
Copy link

@jdalton, I am new to open source and I would like to take a stab at this issue!

@frontman-git
Copy link

@wjx0912

Hi, I noticed that lodash only supports escaping the following characters: &, <, >, “, and ‘. I believe this is an intentional design decision to keep lodash lightweight. According to the official documentation, the lodash team even recommends using a third-party library like he for encoding and decoding HTML entities. This is just my personal observation, but it seems like a reasonable trade-off to avoid the overhead of handling all Unicode characters.

var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants
0