Commit graph

3 commits

Author SHA1 Message Date
Timo Tijhof 92602f33da Minor clean up
* Move "empty tag" case to earlier in highlight() by comparing to
  empty string without strlen(). Follows-up cda15b184.

* Turn "shell disabled" case into 'elseif' after length check,
  instead of subsequent 'if'. That way, in case of a too large
  string, we don't need to check if shell is disabled, and it
  also provides the user with the size-related error instead of
  the shell-related one.

* Add a few clarifying code comments.

Change-Id: Ib0ef9e683ac4aadd0461fe061ddbe9bfb0a27a82
2018-02-22 23:40:07 +00:00
Kunal Mehta cda15b184c If there is no input, don't try and shell out to pygments
pygments will just wait for stdin if the stdin that was passed
to it was empty.

Bug: T188019
Change-Id: I46271f31df74822bc71b3ac283fa572f2d149d67
2018-02-22 13:29:58 -08:00
Kunal Mehta 141455aa33 Move classes into includes/
Change-Id: Ie26b5be1bb2551ed339fdb4a587a89823c609b2e
2018-02-15 14:29:07 -08:00
Renamed from SyntaxHighlight.php (Browse further)