Page MenuHomePhabricator

Don't invoke pygmentize to highlight "txt" or "text" files
ClosedPublic

Authored by epriestley on Mar 24 2015, 8:05 PM.

Details

Summary

Ref T5644. Caught one more of these: we run pygmentize even when we know the file won't be highlighted.

Test Plan

Checked that we don't try to shell out to highlight text files.

Diff Detail

Repository
rPHU libphutil
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley updated this revision to Diff 29200.Mar 24 2015, 8:05 PM
epriestley retitled this revision from to Don't invoke pygmentize to highlight "txt" or "text" files.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan accepted this revision.Mar 24 2015, 8:09 PM
btrahan edited edge metadata.
This revision is now accepted and ready to land.Mar 24 2015, 8:09 PM

Maybe this should be a config duration option so that installs can customize it?

This revision was automatically updated to reflect the committed changes.

Maybe this should be a config duration option so that installs can customize it?

Not sure what you mean, can you clarify?

Actually maybe this is okay. So I was thinking that an install might want to define additional languages that they don't wish to highlight. But I guess in that case they can just map those file extensions to text.