<?php
final class CustomInlineJIRA5Rule extends PhabricatorRemarkupCustomInlineRule {
public function apply($text) {
return preg_replace_callback(
'/\b([A-Z]+-\d+)/',
array($this, 'markupInlineJIRALink'),
$text);
}
public function markupInlineJIRALink(array $matches) {
// Change this to your JIRA install.
$uri = 'http://your.jira.install.com/browse/'.$matches[1];
$link = phutil_tag(
'a',
array(
'href' => $uri,
'style' => 'font-weight: bold;',
),
$matches[1]);
$engine = $this->getEngine();
return $engine->storeText($link);
}
}