emoji-java
emoji-java copied to clipboard
Capability to ignore parsing emoji aliases inside url links
Description
Taking the following string as example:
hello :smiley:. The link is https://link_with_emoji_alias_:smiley:_that_we_do_not_want_to_replace
Currently parsing the above string to unicode will become:
hello 😃. The link is https://link_with_emoji_alias_😃_that_we_do_not_want_to_replace
Added a new method parseToUnicode(String input, boolean shouldIgnoreUrls)
that will allow us to ignore the parsing inside urls.
The result will be a not broken link:
hello 😃. The link is https://link_with_emoji_alias_:smiley:_that_we_do_not_want_to_replace
Coverage increased (+0.6%) to 93.842% when pulling 41070c320bfc9cd6f6d31347ae511433d437fbac on fredericojssilva:feature/ignore_alias_inside_urls into 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f on vdurmont:master.
This looks good!
The URL regex probably won't catch all the cases though. There are many discussions on the regexes for URLs: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url
Maybe we should use a more complete one? What do you think?
@vdurmont agreed. Pushed a more complete one.
Hey @vdurmont. Have you had a chance to look at it?