mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +01:00
Restore linking of Diffusion commits.
This commit is contained in:
parent
63748f6e05
commit
a2a6509dc8
5 changed files with 53 additions and 0 deletions
|
@ -353,6 +353,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorProjectProfileController' => 'applications/project/controller/profile',
|
||||
'PhabricatorRedirectController' => 'applications/base/controller/redirect',
|
||||
'PhabricatorRemarkupRuleDifferential' => 'infrastructure/markup/remarkup/markuprule/differential',
|
||||
'PhabricatorRemarkupRuleDiffusion' => 'infrastructure/markup/remarkup/markuprule/diffusion',
|
||||
'PhabricatorRemarkupRuleManiphest' => 'infrastructure/markup/remarkup/markuprule/maniphest',
|
||||
'PhabricatorRepository' => 'applications/repository/storage/repository',
|
||||
'PhabricatorRepositoryArcanistProject' => 'applications/repository/storage/arcanistproject',
|
||||
|
@ -728,6 +729,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorProjectProfileController' => 'PhabricatorProjectController',
|
||||
'PhabricatorRedirectController' => 'PhabricatorController',
|
||||
'PhabricatorRemarkupRuleDifferential' => 'PhutilRemarkupRule',
|
||||
'PhabricatorRemarkupRuleDiffusion' => 'PhutilRemarkupRule',
|
||||
'PhabricatorRemarkupRuleManiphest' => 'PhutilRemarkupRule',
|
||||
'PhabricatorRepository' => 'PhabricatorRepositoryDAO',
|
||||
'PhabricatorRepositoryArcanistProject' => 'PhabricatorRepositoryDAO',
|
||||
|
|
|
@ -28,6 +28,7 @@ class DifferentialMarkupEngineFactory {
|
|||
$rules[] = new PhutilRemarkupRuleHyperlink();
|
||||
|
||||
$rules[] = new PhabricatorRemarkupRuleDifferential();
|
||||
$rules[] = new PhabricatorRemarkupRuleDiffusion();
|
||||
$rules[] = new PhabricatorRemarkupRuleManiphest();
|
||||
|
||||
$rules[] = new PhutilRemarkupRuleEscapeHTML();
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/differential');
|
||||
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/diffusion');
|
||||
phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/maniphest');
|
||||
|
||||
phutil_require_module('phutil', 'markup/engine/remarkup');
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group markup
|
||||
*/
|
||||
class PhabricatorRemarkupRuleDiffusion
|
||||
extends PhutilRemarkupRule {
|
||||
|
||||
public function apply($text) {
|
||||
return preg_replace_callback(
|
||||
'@\br([A-Z]+[a-z0-9]+)\b@',
|
||||
array($this, 'markupDiffusionLink'),
|
||||
$text);
|
||||
}
|
||||
|
||||
public function markupDiffusionLink($matches) {
|
||||
return $this->getEngine()->storeText(
|
||||
'<a href="/r'.$matches[1].'">r'.$matches[1].'</a>');
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is automatically generated. Lint this module to rebuild it.
|
||||
* @generated
|
||||
*/
|
||||
|
||||
|
||||
|
||||
phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/base');
|
||||
|
||||
|
||||
phutil_require_source('PhabricatorRemarkupRuleDiffusion.php');
|
Loading…
Reference in a new issue