saghm / unescape-rs

"Unescapes" strings with escape sequences written with literal characters and converts it into a properly escaped one.
MIT License
11 stars 4 forks source link

Suggestion: Add functionality to do the opposite #1

Open eedahl opened 6 years ago

eedahl commented 6 years ago

I found this package while looking for a package that takes a Rust string and spits out an escaped JS string. Being able to go back/forth (or in my case the opposite direction) would be very helpful

saghm commented 6 years ago

Interesting idea! I can definitely see this being useful (although the name will be a bit misleading, but I'm willing to live with that). I'm not sure when I'll have to time to work on this, but in the mean time, I'd happily accept a pull request!

eedahl commented 6 years ago

I don't know the open source etiquette/ethics when it comes to literally copy-pasting functionality from other projects so I won't make a PR right this second, but web-view added this functionality in response to one of my issues https://github.com/Boscop/web-view/blob/master/src/escape.rs

Even still it would certainly be nice to complete the duo here as well.