We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ceb395e commit 498cb5cCopy full SHA for 498cb5c
src/applications/diffusion/controller/DiffusionBrowseController.php
@@ -682,17 +682,21 @@ private function buildCorpus(
682
$blame_commits,
683
$show_blame);
684
} else {
685
- if ($can_highlight) {
686
- require_celerity_resource('syntax-highlighting-css');
+ require_celerity_resource('syntax-highlighting-css');
687
+ if (!$can_highlight) {
688
$highlighted = PhabricatorSyntaxHighlighter::highlightWithFilename(
689
$path,
690
$file_corpus);
691
- $lines = phutil_split_lines($highlighted);
692
693
- $lines = phutil_split_lines($file_corpus);
+ // Highlight as plain text to escape the content properly.
+ $highlighted = PhabricatorSyntaxHighlighter::highlightWithLanguage(
694
+ 'txt',
695
+ $file_corpus);
696
}
697
698
+ $lines = phutil_split_lines($highlighted);
699
+
700
$rows = $this->buildDisplayRows(
701
$lines,
702
$blame_list,
0 commit comments