Skip to content

Capability to ignore parsing emoji aliases inside url links#110

Open
fredericojssilva wants to merge 4 commits into
vdurmont:masterfrom
fredericojssilva:feature/ignore_alias_inside_urls
Open

Capability to ignore parsing emoji aliases inside url links#110
fredericojssilva wants to merge 4 commits into
vdurmont:masterfrom
fredericojssilva:feature/ignore_alias_inside_urls

Conversation

@fredericojssilva

Copy link
Copy Markdown

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

@coveralls

coveralls commented Jul 12, 2018

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.6%) to 93.842% when pulling 41070c3 on fredericojssilva:feature/ignore_alias_inside_urls into 8cf5fbe on vdurmont:master.

@fredericojssilva fredericojssilva changed the title Capability to ignore emoji aliases inside url links Capability to ignore parsing emoji aliases inside url links Jul 12, 2018
@vdurmont

Copy link
Copy Markdown
Owner

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?

@fredericojssilva

Copy link
Copy Markdown
Author

@vdurmont agreed. Pushed a more complete one.

@fredericojssilva

Copy link
Copy Markdown
Author

Hey @vdurmont. Have you had a chance to look at it?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants