diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-06-20 16:58:01 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-06-20 16:58:01 +0000 |
commit | 93935f7c3980cfd0480ec300372ddd160d35d44f (patch) | |
tree | 07cd1efe35cfd8fe608192c7aa2290885fab5f06 /lib/redmine | |
parent | 1cc269967ab96746f506e05abf95d63407b63bc4 (diff) | |
download | redmine-93935f7c3980cfd0480ec300372ddd160d35d44f.tar.gz redmine-93935f7c3980cfd0480ec300372ddd160d35d44f.zip |
Wiki page collapse block image is not displayed in exported PDF (#30162).
Patch by Jun NAITOH.
git-svn-id: http://svn.redmine.org/redmine/trunk@18307 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/wiki_formatting/macros.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index bf12cb1b0..d6463d2b4 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -26,10 +26,16 @@ module Redmine Redmine::WikiFormatting::Macros.available_macros.key?(name.to_sym) end - def exec_macro(name, obj, args, text) + def exec_macro(name, obj, args, text, options={}) macro_options = Redmine::WikiFormatting::Macros.available_macros[name.to_sym] return unless macro_options + if options[:inline_attachments] == false + Redmine::WikiFormatting::Macros.inline_attachments = false + else + Redmine::WikiFormatting::Macros.inline_attachments = true + end + method_name = "macro_#{name}" unless macro_options[:parse_args] == false args = args.split(',').map(&:strip) @@ -59,7 +65,9 @@ module Redmine end @@available_macros = {} + @@inline_attachments = true mattr_accessor :available_macros + mattr_accessor :inline_attachments class << self # Plugins can use this method to define new macros: @@ -211,7 +219,7 @@ module Redmine @included_wiki_pages ||= [] raise 'Circular inclusion detected' if @included_wiki_pages.include?(page.id) @included_wiki_pages << page.id - out = textilizable(page.content, :text, :attachments => page.attachments, :headings => false) + out = textilizable(page.content, :text, :attachments => page.attachments, :headings => false, :inline_attachments => @@inline_attachments) @included_wiki_pages.pop out end @@ -227,7 +235,7 @@ module Redmine out = ''.html_safe out << link_to_function(show_label, js, :id => "#{html_id}-show", :class => 'collapsible collapsed') out << link_to_function(hide_label, js, :id => "#{html_id}-hide", :class => 'collapsible', :style => 'display:none;') - out << content_tag('div', textilizable(text, :object => obj, :headings => false), :id => html_id, :class => 'collapsed-text', :style => 'display:none;') + out << content_tag('div', textilizable(text, :object => obj, :headings => false, :inline_attachments => @@inline_attachments), :id => html_id, :class => 'collapsed-text', :style => 'display:none;') out end |