forked from viewvc/viewvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue viewvc#216: Make the hide_binary_garbage flag a first-class option
* conf/viewvc.conf.dist (hide_binary_content): New option. (binary_mime_types): Rework this just a bit to allow the web-friendly image types to *not* be excluded except by explicit mention of their MIME types. Glob patterns like "image/*" will no longer apply to those specific image types. * lib/config.py Add default value for new 'hide_binary_content' option. * lib/viewvc.py (is_binary_file_mime_type): Test web-friendly image types for explicit exclusion, not such covered by a glob pattern. (markup_file_contents): Expect a list of Unicode strings as input now, and remove deference to Pygments for transcoding. (markup_or_annotate): Perform bytestring->string conversion here, allowing the 'hide_binary_content' option to decide whether a decoding failure will result in file content not being display at all or the content to contain mojibake and an 'is_binary' flag to be passed to the template. * templates/classic/file.ezt, * templates/default/file.ezt Remove the old hide_binary_garbage template-defined flag, and instead consult the is_binary data dictionary item.
- Loading branch information
Showing
5 changed files
with
111 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters