inline issue and merge request mention status indicator shows up in wrong system notes

See the system notes of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9462 which also introduced this feature.

image

I think it shouldn't state [merged] there.

Design

Append the state only when link text is equal to the issuable reference. So:

We also change from square brackets [] to parentheses () (as we will no longer be showing status on comment mentions)

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9462 => !9462 (merged)
!9462 => !9462 (merged)
[something](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9462) => something

When linking to a comment

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9462#note_24341783

We will change from !9462 (comment 24341783) [merged] to !9462 (comment 24341783).

related issues

https://gitlab.com/gitlab-org/gitlab-ce/issues/30913

cc: @kushalpandya @jschatz1 @victorwu