feature request: replace emoji with slug
TristanSpeakEasy opened this issue · 5 comments
would be great to have a method to replace emojis with their slug
Thank you for the feature request.
Just to make sure that we are on the same page. Are you looking for something like this?
res := gomoji.ReplaceWithSlug("🧖 hello 🦋 world") // "person-in-steamy-room hello butterfly world"
Yeah that is exactly it, I would like to convert the original intent of the string into full text. Just removing the emoji's for me could end up in conflicts between strings that need to be unique. So if I can replace the emoji with the slug like in your example that would solve my use case.
I made a change with a new functionality. Please, update the library and check the docs https://github.com/forPelevin/gomoji#replace-all-emojis-with-the-result-of-custom-replacer-function
Also, you can use the ReplaceEmojisWithSlug
function in your case.
I hope, the change covers your needs.
This is perfect thank you, will
Open new issues if I have any problem with it
Great. Again, thank you for the feature request. Have a nice day