status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.89k stars 985 forks source link

Messages with certain occurance of elipsis(as three periods) gets rendered as link. #4073

Closed yalu closed 6 years ago

yalu commented 6 years ago

Messages (at-least in public chats) with elipsis(as three periods) gets rendered as link. clicking open in browser crashes the app.

User Story

As a chat user I am in the habit of writing lots of elipsis in messages i write.

Description

Type: Bug

When i sent a test message in #status public chat in couple of recent nightlies, due to my habit, I accidentally bumped into this bug, whereby the messages with elipsis gets turned into link for no reason.

Expected behavior

Message with elipsis renders as normal text message.

Actual behavior

Message gets turned into link.

Reproduction

Send a message like so "test...test...".

Solution

Don't know.

Additional Information

Serhy commented 6 years ago

I'm wondering if we can use (if we are not yet) https://www.npmjs.com/package/react-native-autolink (Autolinker.js) to parse message content. If it won't have an impact in performance degradation on chat screen - lets use it, instead of custom regexp.

urls: {
        schemeMatches : true,
        wwwMatches    : true,
        tldMatches    : true

    stripPrefix : false,
    stripTrailingSlash : false,
    newWindow   : false,

does the job pretty well and most of the issues with highlighting non-URI related text could be solved (i checked it here http://greg-jacobs.com/Autolinker.js/examples/live-example/)

status-open-bounty commented 6 years ago

Balance: 0 ETH Tokens: SNT: 700.00 Contract address: 0x6a72825daa1234b7238c7a4b963488ecf581ea89 Network: Mainnet Paid to: trybeee Visit https://openbounty.status.im to learn more.