Skip to content

Commit

Permalink
[#8446] update inline username mentions (missed in original work on t…
Browse files Browse the repository at this point in the history
…his ticket)
  • Loading branch information
brondsem committed Feb 21, 2024
1 parent 430baa3 commit 094aba9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Allura/allura/lib/markdown_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def handleMatch(self, m):
if user and not user.pending and not user.disabled:
result = etree.Element('a')
result.text = "@%s" % user_name
result.set('href', user.url())
result.set('href', h.username_project_url(user))
result.set('class', 'user-mention')
else:
result = "@%s" % user_name
Expand Down
4 changes: 2 additions & 2 deletions Allura/allura/tests/test_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,13 +919,13 @@ def test_markdown_user_mention_default(self):
ThreadLocalODMSession.flush_all()
output = g.markdown.convert('Hello.. @admin1, how are you?')
assert 'class="user-mention"' in output
assert ('href="%s"' % u1.url()) in output
assert 'href="/u/admin1/profile/"' in output
u2 = M.User.register(dict(username='admin-2'), make_project=True)
ThreadLocalODMSession.flush_all()
output = g.markdown.convert('Do you know @ab? @admin-2 has solved it!')
assert 'Do you know @ab?' in output
assert 'class="user-mention"' in output
assert ('href="%s"' % u2.url()) in output
assert 'href="/u/admin-2/profile/"' in output
output = g.markdown.convert('[email protected] Hey!')
assert '[email protected] Hey!' in output

Expand Down

0 comments on commit 094aba9

Please sign in to comment.