innoq / statuses

statuses
Apache License 2.0
13 stars 14 forks source link

trailing colons are erroneously included in mentions #101

Closed FND closed 9 years ago

FND commented 9 years ago

a message like ...

hello @foo: world

... leads to the following HTML being rendered:

hello <a href=".../updates?author=foo:">foo:</a> world

that should read

hello <a href=".../updates?author=foo">foo</a>: world

mvitz commented 9 years ago

The same bug occurs for question marks. Before working on this I think we should agree about valid characters within a mention.

mvitz commented 9 years ago

Accidentally I introduced the bug here: 47b49868476141daf0b3ca6a0cab3668198720c3 Thanks to @pschirmacher for pointing this out.

mvitz commented 9 years ago

Maybe we should just change the 2nd capture group back to \w+ again.

pschirmacher commented 9 years ago

Maybe we should just change the 2nd capture group back to \w+ again.

Yup, that sounds good.

aheusingfeld commented 9 years ago

Accidentally I introduced the bug here: 47b4986

IMHO we should not linkify everything that has an @ in front but instead have a list of valid usernames. Just my 2ct

mvitz commented 9 years ago

Was thinking about the same as @aheusingfeld. If this becomes common sense I would start implementing this.

stilkov commented 9 years ago

I agree, but we currently don’t have a list of valid user names as we don’t access any user directory (and I would be extremely reluctant to introduce that dependency).

FND commented 9 years ago

I agree with @stilkov: we should just do the Simplest Thing and assume usernames are [0-9a-zA-Z]+

aheusingfeld commented 9 years ago

assume usernames are [0-9a-zA-Z]+

Why not just [0-9a-z]+? Anyway I didn't ever use the linkified mentioned usernames and as the worst that could probably happen is linking to a list for a user that doesn't exist...........

stilkov commented 9 years ago

Why not just [0-9a-z]+?

I think @FND would disapprove.

aheusingfeld commented 9 years ago

I think @FND would disapprove.

I know ;)

FND commented 9 years ago

the worst that could probably happen is linking to a list for a user that doesn't exist

Exactly - verification might happen in whatever system processes mentions (e.g. sending notification e-mails, there checking against an index of known users/addresses makes sense).