diff --git a/app/Core/Markdown.php b/app/Core/Markdown.php index 07e427d19..2a866cf25 100644 --- a/app/Core/Markdown.php +++ b/app/Core/Markdown.php @@ -92,6 +92,7 @@ class Markdown extends Parsedown if (! empty($user)) { $url = $this->container['helper']->url->to('UserViewController', 'profile', array('user_id' => $user['id'])); + $name = $user['name'] ?: $user['username']; return array( 'extent' => strlen($username) + 1, @@ -101,7 +102,8 @@ class Markdown extends Parsedown 'attributes' => array( 'href' => $url, 'class' => 'user-mention-link', - 'title' => $user['name'] ?: $user['username'], + 'title' => $name, + 'aria-label' => $name, ), ), ); diff --git a/tests/units/Helper/TextHelperTest.php b/tests/units/Helper/TextHelperTest.php index 9d862900f..c010094aa 100644 --- a/tests/units/Helper/TextHelperTest.php +++ b/tests/units/Helper/TextHelperTest.php @@ -67,42 +67,42 @@ class TextHelperTest extends Base $this->assertEquals(2, $userModel->create(array('username' => 'firstname.lastname', 'name' => 'Firstname Lastname'))); $this->assertEquals( - '

Text @admin @notfound

', + '

Text @admin @notfound

', $textHelper->markdown('Text @admin @notfound') ); $this->assertEquals( - '

Text @admin,

', + '

Text @admin,

', $textHelper->markdown('Text @admin,') ); $this->assertEquals( - '

Text @admin!

', + '

Text @admin!

', $textHelper->markdown('Text @admin!') ); $this->assertEquals( - '

Text @admin?

', + '

Text @admin?

', $textHelper->markdown('Text @admin? ') ); $this->assertEquals( - '

Text @admin.

', + '

Text @admin.

', $textHelper->markdown('Text @admin.') ); $this->assertEquals( - '

Text @admin: test

', + '

Text @admin: test

', $textHelper->markdown('Text @admin: test') ); $this->assertEquals( - '

Text @admin: test

', + '

Text @admin: test

', $textHelper->markdown('Text @admin: test') ); $this->assertEquals( - '

Text @firstname.lastname. test

', + '

Text @firstname.lastname. test

', $textHelper->markdown('Text @firstname.lastname. test') );