{if $userProfile === null}
{* user no longer exists, use plain output rather than using a broken link *}
- @{$username}{* no newline after the tag
+ {$username}{* no newline after the tag
*}{else}
<a href="{link controller='User' object=$userProfile->getDecoratedObject()}{/link}" class="userMention userLink" data-object-id="{@$userProfile->userID}">{@$userProfile->getFormattedUsername()}</a>{* no newline after the tag
*}{/if}
{if $userProfile === null}
{* user no longer exists, use plain output rather than using a broken link *}
- @{$username}{* no newline after the tag
+ {$username}{* no newline after the tag
*}{else}
<a href="{link controller='User' object=$userProfile->getDecoratedObject()}{/link}" class="userMention userLink" data-object-id="{@$userProfile->userID}">{@$userProfile->getFormattedUsername()}</a>{* no newline after the tag
*}{/if}
*/
public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string
{
+ if (!\str_starts_with($content, "@")) {
+ $content = "@{$content}";
+ }
+
$userID = (!empty($openingTag['attributes'][0])) ? \intval($openingTag['attributes'][0]) : 0;
if (!$userID) {
return "[user]{$content}[/user]";