1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Fix highlighted code in Diffusion

Summary:
Ref T3141. This is a hacky fix until we can get something a little more sensible in place.

Currently, we sometimes end up with an empty text list, which causes file content to not display. Instead, generate the text list from the corpus if it isn't available.

Test Plan: Looked at a previously-broken source listing, saw code.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3141

Differential Revision: https://secure.phabricator.com/D5871
This commit is contained in:
epriestley 2013-05-08 18:12:59 -07:00
parent 991bbb6242
commit 5877026e81

View file

@ -12,6 +12,9 @@ final class DiffusionFileContent {
return $this;
}
public function getTextList() {
if (!$this->textList) {
return phutil_split_lines($this->getCorpus(), $retain_ends = false);
}
return $this->textList;
}