Project

General

Profile

Actions

Patch #44824

open

Viewing a Markdown or Textile file larger than file_max_size_displayed in the repository browser raises an error

Patch #44824: Viewing a Markdown or Textile file larger than file_max_size_displayed in the repository browser raises an error

Added by Jens Krämer 35 minutes ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-

Description

RepositoriesController#entry leaves @content nil for files larger than "Maximum size of text files displayed inline" (file_max_size_displayed). entry.html.erb still renders Markdown and Textile files as markup and passes nil to the formatter, so viewing such a file fails with a 500:

ActionView::Template::Error: undefined method 'delete' for nil
  lib/redmine/wiki_formatting/common_mark/markdown_filter.rb:36:in 'Redmine::WikiFormatting::CommonMark::MarkdownFilter#initialize'

Other text files fall back to the "No preview available" message.

The attached patch renders markup only if there is content, and adds a test.


Files

No data to display

Actions

Also available in: PDF Atom