1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

Move Pygments handling to libphutil

Test Plan: None.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4875
This commit is contained in:
vrana 2013-02-08 17:53:36 -08:00
parent 879c14e13a
commit b72e7969a1

View file

@ -420,14 +420,6 @@ final class DifferentialChangesetParser {
} }
private function getHighlightFuture($corpus) { private function getHighlightFuture($corpus) {
if (preg_match('/\r(?!\n)/', $corpus)) {
// TODO: Pygments converts "\r" newlines into "\n" newlines, so we can't
// use it on files with "\r" newlines. If we have "\r" not followed by
// "\n" in the file, skip highlighting.
$result = phutil_escape_html($corpus);
return new ImmediateFuture($result);
}
return $this->highlightEngine->getHighlightFuture( return $this->highlightEngine->getHighlightFuture(
$this->highlightEngine->getLanguageFromFilename($this->filename), $this->highlightEngine->getLanguageFromFilename($this->filename),
$corpus); $corpus);