links to other issues
This commit is contained in:
parent
34f2376458
commit
93b41b2a58
1 changed files with 7 additions and 0 deletions
|
@ -20,6 +20,7 @@ class Markdown extends \Parsedown
|
|||
*/
|
||||
public function text($markdown) {
|
||||
$markdown = $this->parseMentions($markdown);
|
||||
$markdown = $this->parseIssueMentions($markdown);
|
||||
$this->setBreaksEnabled(true);
|
||||
$html = parent::text($markdown);
|
||||
|
||||
|
@ -32,6 +33,12 @@ class Markdown extends \Parsedown
|
|||
return preg_replace($regex, "<a class='mention' href='https://github.com/$1'>$0</a>", $markdown);
|
||||
}
|
||||
|
||||
private function parseIssueMentions($markdown) {
|
||||
$regex = '/#(\d+)/';
|
||||
return preg_replace($regex, "<a href='/$1'>$0</a>", $markdown);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <a href="http://issues.piwik.org/attachments/1199/swelen_dateslider.swf">swelen_dateslider.swf</a>
|
||||
* to
|
||||
|
|
Reference in a new issue