Fix rendering text-based attachments without a matching lexer.

Review Request #5252 — Created Jan. 14, 2014 and submitted

Information

Review Board
master

Reviewers

Fix rendering text-based attachments without a matching lexer.

It's possible to not find a valid lexer when attempting to render
a file attachment. To deal with that, we now fall back on an instance of
TextLexer(), which just simply renders the text safely to HTML.

This applies to both thumbnails and the review UI.

Tested with a file attachment thumbnail I had that it couldn't match.
It rendered the text.

Went into the review UI for the file and it rendered fine there too.

david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed