(.*?))s', array($this, 'markupInlineCodeBlock'), $text); } public function markupInlineCodeBlock($matches) { $engine = $this->getEngine(); $text = $matches[1]; $highlighter = new PhutilDefaultSyntaxHighlighterEngine(); $highlighter->setConfig( 'pygments.enabled', $engine->getConfig('pygments.enabled')); $lang = PhutilLanguageGuesser::guessLanguage($text); if (!$lang) { $lang = nonempty( $engine->getConfig('phutil.codeblock.language-default'), 'php'); } $source_body = phutil_tag( 'span', array( 'class' => 'remarkup-code PhabricatorMonospaced', 'style' => 'white-space: pre-wrap; background: #fdfae7;', ), PhutilSafeHTML::applyFunction( 'rtrim', $highlighter->highlightSource($lang, $text))); return $engine->storeText($source_body); } }