{"action":"closed","issue":{"url":"https://api.github.com/repos/erusev/parsedown/issues/281","labels_url":"https://api.github.com/repos/erusev/parsedown/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/erusev/parsedown/issues/281/comments","events_url":"https://api.github.com/repos/erusev/parsedown/issues/281/events","html_url":"https://github.com/erusev/parsedown/issues/281","id":56343430,"number":281,"title":"Implementing an Extension","user":{"login":"gamejerksnet","id":10773385,"avatar_url":"https://avatars.githubusercontent.com/u/10773385?v=3","gravatar_id":"","url":"https://api.github.com/users/gamejerksnet","html_url":"https://github.com/gamejerksnet","followers_url":"https://api.github.com/users/gamejerksnet/followers","following_url":"https://api.github.com/users/gamejerksnet/following{/other_user}","gists_url":"https://api.github.com/users/gamejerksnet/gists{/gist_id}","starred_url":"https://api.github.com/users/gamejerksnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamejerksnet/subscriptions","organizations_url":"https://api.github.com/users/gamejerksnet/orgs","repos_url":"https://api.github.com/users/gamejerksnet/repos","events_url":"https://api.github.com/users/gamejerksnet/events{/privacy}","received_events_url":"https://api.github.com/users/gamejerksnet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-03T07:27:14Z","updated_at":"2015-02-03T10:32:13Z","closed_at":"2015-02-03T10:32:13Z","body":"So I followed the Wiki page and created an Extension class. What I don't know how to do is tie it into my Parsedown package telling it to use my new class while parsing text. Below is my new class:\r\n```php\r\n<?php namespace App\\Extensions;\r\n\r\nuse App\\Repositories\\User\\UsersRepository;\r\nuse Parsedown;\r\n\r\nclass Extenstion extends Parsedown {\r\n\r\n    /**\r\n     * @var UsersRepository\r\n     */\r\n    private $usersRepository;\r\n\r\n    function __construct(UsersRepository $usersRepository)\r\n    {\r\n        $this->InlineTypes['@'] []= 'UserTag';\r\n\r\n        $this->inlineMarkerList .= '@';\r\n\r\n        $this->usersRepository = $usersRepository;\r\n    }\r\n\r\n    protected function inlineUserTag($Excerpt)\r\n    {\r\n        if (preg_match('/^@([^\\s]+)/', $Excerpt['text'], $matches))\r\n        {\r\n            $urlToUser  =   $this->usersRepository->findByDisplayName($matches[1])->url();\r\n\r\n            return array(\r\n                'extent' => strlen($matches[0]),\r\n                'element' => array(\r\n                    'name' => 'a',\r\n                    'text' => '@' . $matches[1],\r\n                    'attributes' => array(\r\n                        'href' => $urlToUser,\r\n                    ),\r\n                ),\r\n            );\r\n        }\r\n    }\r\n\r\n}\r\n```\r\n\r\nThe purpose of this extension is to turn @Trinyx into a link to that user but keeping the same text."}}