diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-10-17 11:21:54 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-10-17 11:21:54 +0000 |
commit | 2c83540108e727deee5652eb21c99c83eb6d2b5f (patch) | |
tree | 1c0ed8b30081d577221936300b1ec95d9db7c973 /lib | |
parent | 35de9458c4e1436c380246ef00ed979ce5a28090 (diff) | |
download | redmine-2c83540108e727deee5652eb21c99c83eb6d2b5f.tar.gz redmine-2c83540108e727deee5652eb21c99c83eb6d2b5f.zip |
code cleanup: rubocop: fix Layout/ElseAlignment in lib/redmine/wiki_formatting.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18702 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/wiki_formatting.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb index f5a660b29..cae94d790 100644 --- a/lib/redmine/wiki_formatting.rb +++ b/lib/redmine/wiki_formatting.rb @@ -81,15 +81,17 @@ module Redmine end def to_html(format, text, options = {}) - text = if Setting.cache_formatted_text? && text.size > 2.kilobyte && cache_store && cache_key = cache_key_for(format, text, options[:object], options[:attribute]) - # Text retrieved from the cache store may be frozen - # We need to dup it so we can do in-place substitutions with gsub! - cache_store.fetch cache_key do + text = + if Setting.cache_formatted_text? && text.size > 2.kilobyte && cache_store && + cache_key = cache_key_for(format, text, options[:object], options[:attribute]) + # Text retrieved from the cache store may be frozen + # We need to dup it so we can do in-place substitutions with gsub! + cache_store.fetch cache_key do + formatter_for(format).new(text).to_html + end.dup + else formatter_for(format).new(text).to_html - end.dup - else - formatter_for(format).new(text).to_html - end + end text end |