Update Phabricator for split syntax highlighting API
Summary: I'll clean some of this stuff up in a followup too, but update the callers to use the new explicit filename-based API. Test Plan: Looked at paste, Diffusion and Differential. Reviewed By: tuomaspelkonen Reviewers: tuomaspelkonen, codeblock, jungejason, aran CC: aran, tuomaspelkonen Differential Revision: 600
This commit is contained in:
@@ -89,14 +89,22 @@ class PhabricatorPasteViewController extends PhabricatorPasteController {
|
||||
require_celerity_resource('diffusion-source-css');
|
||||
require_celerity_resource('syntax-highlighting-css');
|
||||
|
||||
$highlightEngine = new PhutilDefaultSyntaxHighlighterEngine();
|
||||
$highlightEngine->setConfig(
|
||||
$highlight_engine = new PhutilDefaultSyntaxHighlighterEngine();
|
||||
$highlight_engine->setConfig(
|
||||
'pygments.enabled',
|
||||
PhabricatorEnv::getEnvConfig('pygments.enabled'));
|
||||
|
||||
|
||||
$language = $paste->getLanguage();
|
||||
if (empty($language)) {
|
||||
$language = $highlight_engine->getLanguageFromFilename(
|
||||
$paste->getTitle());
|
||||
}
|
||||
|
||||
$text_list = explode(
|
||||
"\n", $highlightEngine->highlightSource(
|
||||
nonempty($paste->getLanguage(), $paste->getTitle()),
|
||||
"\n",
|
||||
$highlight_engine->highlightSource(
|
||||
$language,
|
||||
$file->loadFileData()));
|
||||
|
||||
$rows = $this->buildDisplayRows($text_list);
|
||||
|
||||
Reference in New Issue
Block a user