Added custom remarkup.
Summary: Vendor specific markups are now possible. Test Plan: Tested with the Facebook specific tasks markup. Reviewed By: jungejason Reviewers: epriestley, jungejason CC: aran, jungejason Differential Revision: 349
This commit is contained in:
@@ -48,6 +48,15 @@ class DifferentialMarkupEngineFactory {
|
||||
$rules[] = new PhutilRemarkupRuleBold();
|
||||
$rules[] = new PhutilRemarkupRuleItalic();
|
||||
|
||||
$custom_rule_classes =
|
||||
PhabricatorEnv::getEnvConfig('differential.custom-remarkup-rules');
|
||||
if ($custom_rule_classes) {
|
||||
foreach ($custom_rule_classes as $custom_rule_class) {
|
||||
PhutilSymbolLoader::loadClass($custom_rule_class);
|
||||
$rules[] = newv($custom_rule_class, array());
|
||||
}
|
||||
}
|
||||
|
||||
$blocks = array();
|
||||
$blocks[] = new PhutilRemarkupEngineRemarkupQuotesBlockRule();
|
||||
$blocks[] = new PhutilRemarkupEngineRemarkupHeaderBlockRule();
|
||||
@@ -55,6 +64,15 @@ class DifferentialMarkupEngineFactory {
|
||||
$blocks[] = new PhutilRemarkupEngineRemarkupCodeBlockRule();
|
||||
$blocks[] = new PhutilRemarkupEngineRemarkupDefaultBlockRule();
|
||||
|
||||
$custom_block_rule_classes =
|
||||
PhabricatorEnv::getEnvConfig('differential.custom-remarkup-block-rules');
|
||||
if ($custom_block_rule_classes) {
|
||||
foreach ($custom_block_rule_classes as $custom_block_rule_class) {
|
||||
PhutilSymbolLoader::loadClass($custom_block_rule_class);
|
||||
$blocks[] = newv($custom_block_rule_class, array());
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($blocks as $block) {
|
||||
if (!($block instanceof PhutilRemarkupEngineRemarkupCodeBlockRule)) {
|
||||
$block->setMarkupRules($rules);
|
||||
|
||||
@@ -26,6 +26,8 @@ phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/escaperemarku
|
||||
phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/hyperlink');
|
||||
phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/italics');
|
||||
phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/monospace');
|
||||
phutil_require_module('phutil', 'symbols');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
||||
phutil_require_source('DifferentialMarkupEngineFactory.php');
|
||||
|
||||
Reference in New Issue
Block a user