Fixed linking to users in Markdown

This commit is contained in:
Marcin Kurczewski 2014-05-19 00:09:36 +02:00
parent dcce352ffd
commit 1be0ec3dcd

View file

@ -145,7 +145,7 @@ class CustomMarkdown extends \Michelf\MarkdownExtra
protected function doUsers($text) protected function doUsers($text)
{ {
$link = \Chibi\Router::linkTo(['UserController', 'genericView'], ['name' => '_name_']); $link = \Chibi\Router::linkTo(['UserController', 'genericView'], ['identifier' => '_name_']);
return preg_replace_callback('/(?:(?<![^\s\(\)\[\]]))\+([a-zA-Z0-9_-]+)/', function($x) use ($link) return preg_replace_callback('/(?:(?<![^\s\(\)\[\]]))\+([a-zA-Z0-9_-]+)/', function($x) use ($link)
{ {
return $this->hashPart('<a href="' . str_replace('_name_', $x[1], $link) . '">' . $x[0] . '</a>'); return $this->hashPart('<a href="' . str_replace('_name_', $x[1], $link) . '">' . $x[0] . '</a>');