Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/PhabricatorMarkupEngine.php
Show First 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | public static function newPhrictionMarkupEngine() { | ||||
)); | )); | ||||
} | } | ||||
/** | /** | ||||
* @task engine | * @task engine | ||||
*/ | */ | ||||
public static function newPhameMarkupEngine() { | public static function newPhameMarkupEngine() { | ||||
return self::newMarkupEngine(array( | return self::newMarkupEngine( | ||||
array( | |||||
'macros' => false, | 'macros' => false, | ||||
'uri.full' => true, | 'uri.full' => true, | ||||
'uri.same-window' => true, | |||||
'uri.base' => PhabricatorEnv::getURI('/'), | |||||
)); | )); | ||||
} | } | ||||
/** | /** | ||||
* @task engine | * @task engine | ||||
*/ | */ | ||||
public static function newFeedMarkupEngine() { | public static function newFeedMarkupEngine() { | ||||
return self::newMarkupEngine( | return self::newMarkupEngine( | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | $engine->setConfig( | ||||
$options['syntax-highlighter.engine']); | $options['syntax-highlighter.engine']); | ||||
$style_map = id(new PhabricatorDefaultSyntaxStyle()) | $style_map = id(new PhabricatorDefaultSyntaxStyle()) | ||||
->getRemarkupStyleMap(); | ->getRemarkupStyleMap(); | ||||
$engine->setConfig('phutil.codeblock.style-map', $style_map); | $engine->setConfig('phutil.codeblock.style-map', $style_map); | ||||
$engine->setConfig('uri.full', $options['uri.full']); | $engine->setConfig('uri.full', $options['uri.full']); | ||||
if (isset($options['uri.base'])) { | |||||
$engine->setConfig('uri.base', $options['uri.base']); | |||||
} | |||||
if (isset($options['uri.same-window'])) { | |||||
$engine->setConfig('uri.same-window', $options['uri.same-window']); | |||||
} | |||||
$rules = array(); | $rules = array(); | ||||
$rules[] = new PhutilRemarkupEscapeRemarkupRule(); | $rules[] = new PhutilRemarkupEscapeRemarkupRule(); | ||||
$rules[] = new PhutilRemarkupMonospaceRule(); | $rules[] = new PhutilRemarkupMonospaceRule(); | ||||
$rules[] = new PhutilRemarkupDocumentLinkRule(); | $rules[] = new PhutilRemarkupDocumentLinkRule(); | ||||
$rules[] = new PhabricatorNavigationRemarkupRule(); | $rules[] = new PhabricatorNavigationRemarkupRule(); | ||||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |