diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-03 14:54:59 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-03 14:54:59 +0000 |
commit | 52d8b5549e0f15185703e24e15785e6ed5f5dbae (patch) | |
tree | 32356d986c28f6742615b40755875752ed6fcd62 /lib | |
parent | bfa5bf812a8e69565e19f3c40ca5579625468c06 (diff) | |
download | redmine-52d8b5549e0f15185703e24e15785e6ed5f5dbae.tar.gz redmine-52d8b5549e0f15185703e24e15785e6ed5f5dbae.zip |
add empty line after guard clause to lib/redmine/wiki_formatting/macros.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20230 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/wiki_formatting/macros.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index 429123b4b..fc907db91 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -157,6 +157,7 @@ module Redmine unless block_given? raise "Can not create a macro without a block!" end + name = name.to_s.downcase.to_sym available_macros[name] = {:desc => @@desc || ''}.merge(options) @@desc = nil @@ -207,6 +208,7 @@ module Redmine raise t(:error_childpages_macro_no_argument) end raise t(:error_page_not_found) if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project) + pages = page.self_and_descendants(options[:depth]).group_by(&:parent_id) render_page_hierarchy(pages, options[:parent] ? page.parent_id : page.id) end @@ -217,8 +219,10 @@ module Redmine macro :include do |obj, args| page = Wiki.find_page(args.first.to_s, :project => @project) raise t(:error_page_not_found) if page.nil? || !User.current.allowed_to?(:view_wiki_pages, page.wiki.project) + @included_wiki_pages ||= [] raise t(:error_circular_inclusion) if @included_wiki_pages.include?(page.id) + @included_wiki_pages << page.id out = textilizable(page.content, :text, :attachments => page.attachments, :headings => false, :inline_attachments => @@inline_attachments) @included_wiki_pages.pop @@ -248,8 +252,10 @@ module Redmine args, options = extract_macro_options(args, :size, :title) filename = args.first raise t(:error_filename_required) unless filename.present? + size = options[:size] raise t(:error_invalid_size_parameter) unless size.nil? || /^\d+$/.match?(size) + size = size.to_i size = 200 unless size > 0 if obj && obj.respond_to?(:attachments) && attachment = Attachment.latest_attach(obj.attachments, filename) |