arkhitech / redmine_mentions

Allows users to mention team members in their notes/comments.
MIT License
95 stars 88 forks source link

Fix regex for autocompletion #76

Closed saippuakauppias closed 3 years ago

saippuakauppias commented 3 years ago

Logins in redmine may contain not only \w, but also a dot and a dash: https://github.com/redmine/redmine/blob/1dcebf8/app/models/user.rb#L111

In addition, mentions is collected from #{u.firstname} and #{u.lastname}:

mentions: <%=  users.collect{|u| "#{u.firstname} #{u.lastname} - <small>#{u.login}</small>"}.to_json.html_safe %>,

And there may be names in Russian and the autocomplete will not work when they are introduced (we encountered this particular bug in our company).

A small online test for these changes: https://regex101.com/r/kpwzOx/1

PS: Thank you very much for this wonderful plugin 👍

saippuakauppias commented 3 years ago

@hishammalik any info?