From c2d0664c5e489dfa4acf4e433c44d536f6fdb55c Mon Sep 17 00:00:00 2001 From: hwang Date: Sun, 26 Jun 2011 23:57:43 -0700 Subject: [PATCH] Add P### link to paste Summary:Make a new directory, src/infrastructure/markup/remarkup/markuprule/paste/ Make a new class called PhabricatorRemarkupRulePaste in that directory. Add the rule to DifferentialMarkupEngineFactory. Test Plan: Created a task in maniphest. Put P1 and P2 in the content. Created P1 and P2 in Paste. Verified P1 and P2 were highlighted and linked correctly. Reviewers:epriestley, codeblock CC:jungejason Differential Revision: 539 --- src/__phutil_library_map__.php | 2 ++ .../DifferentialMarkupEngineFactory.php | 1 + .../differential/parser/markup/__init__.php | 1 + .../paste/PhabricatorRemarkupRulePaste.php | 29 +++++++++++++++++++ .../remarkup/markuprule/paste/__init__.php | 12 ++++++++ 5 files changed, 45 insertions(+) create mode 100644 src/infrastructure/markup/remarkup/markuprule/paste/PhabricatorRemarkupRulePaste.php create mode 100644 src/infrastructure/markup/remarkup/markuprule/paste/__init__.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 5bddbe16c0..925997dd5a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -443,6 +443,7 @@ phutil_register_library_map(array( 'PhabricatorRemarkupRuleManiphest' => 'infrastructure/markup/remarkup/markuprule/maniphest', 'PhabricatorRemarkupRuleMention' => 'infrastructure/markup/remarkup/markuprule/mention', 'PhabricatorRemarkupRuleObjectName' => 'infrastructure/markup/remarkup/markuprule/objectname', + 'PhabricatorRemarkupRulePaste' => 'infrastructure/markup/remarkup/markuprule/paste', 'PhabricatorRemarkupRuleProxyImage' => 'infrastructure/markup/remarkup/markuprule/proxyimage', 'PhabricatorRemarkupRuleYoutube' => 'infrastructure/markup/remarkup/markuprule/youtube', 'PhabricatorRepository' => 'applications/repository/storage/repository', @@ -913,6 +914,7 @@ phutil_register_library_map(array( 'PhabricatorRemarkupRuleManiphest' => 'PhabricatorRemarkupRuleObjectName', 'PhabricatorRemarkupRuleMention' => 'PhutilRemarkupRule', 'PhabricatorRemarkupRuleObjectName' => 'PhutilRemarkupRule', + 'PhabricatorRemarkupRulePaste' => 'PhabricatorRemarkupRuleObjectName', 'PhabricatorRemarkupRuleProxyImage' => 'PhutilRemarkupRule', 'PhabricatorRemarkupRuleYoutube' => 'PhutilRemarkupRule', 'PhabricatorRepository' => 'PhabricatorRepositoryDAO', diff --git a/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php b/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php index 959c18fbb8..1ed9512f35 100644 --- a/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php +++ b/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php @@ -41,6 +41,7 @@ class DifferentialMarkupEngineFactory { $rules[] = new PhabricatorRemarkupRuleDifferential(); $rules[] = new PhabricatorRemarkupRuleDiffusion(); $rules[] = new PhabricatorRemarkupRuleManiphest(); + $rules[] = new PhabricatorRemarkupRulePaste(); $rules[] = new PhabricatorRemarkupRuleImageMacro(); $rules[] = new PhabricatorRemarkupRuleMention(); diff --git a/src/applications/differential/parser/markup/__init__.php b/src/applications/differential/parser/markup/__init__.php index 2a6ad93b73..876e77f38b 100644 --- a/src/applications/differential/parser/markup/__init__.php +++ b/src/applications/differential/parser/markup/__init__.php @@ -12,6 +12,7 @@ phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/ phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/imagemacro'); phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/maniphest'); phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/mention'); +phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/paste'); phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/proxyimage'); phutil_require_module('phabricator', 'infrastructure/markup/remarkup/markuprule/youtube'); diff --git a/src/infrastructure/markup/remarkup/markuprule/paste/PhabricatorRemarkupRulePaste.php b/src/infrastructure/markup/remarkup/markuprule/paste/PhabricatorRemarkupRulePaste.php new file mode 100644 index 0000000000..b734219b86 --- /dev/null +++ b/src/infrastructure/markup/remarkup/markuprule/paste/PhabricatorRemarkupRulePaste.php @@ -0,0 +1,29 @@ +