Page MenuHomePhabricator

CustomInlineJIRA5Rule.php

Authored By
epriestley
May 22 2014, 2:45 PM
Size
628 B
Referenced Files
None
Subscribers
None

CustomInlineJIRA5Rule.php

<?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);
}
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/ub/dq/26inhr3n6cabawwn
Default Alt Text
CustomInlineJIRA5Rule.php (628 B)

Event Timeline