summaryrefslogtreecommitdiffstats
path: root/lib/redmine/wiki_formatting.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-18 16:41:54 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-18 16:41:54 +0000
commit1e8a9da131686eb327d3ee3e31f5b3ac6b1b68bf (patch)
treee9f71339d76b0ab9c9badfa8a1e5c38fcf5bc6b6 /lib/redmine/wiki_formatting.rb
parent2770e285358a8ae1e39cc7f594e1ccf8cfa417c3 (diff)
downloadredmine-1e8a9da131686eb327d3ee3e31f5b3ac6b1b68bf.tar.gz
redmine-1e8a9da131686eb327d3ee3e31f5b3ac6b1b68bf.zip
Handle the case of a text formatter that doesn't support section edit (#2222).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7831 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/wiki_formatting.rb')
-rw-r--r--lib/redmine/wiki_formatting.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 2f25fe0e6..63f833dce 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -62,6 +62,11 @@ module Redmine
text
end
+ # Returns true if the text formatter supports single section edit
+ def supports_section_edit?
+ (formatter.instance_methods & ['update_section', :update_section]).any?
+ end
+
# Returns a cache key for the given text +format+, +object+ and +attribute+ or nil if no caching should be done
def cache_key_for(format, object, attribute)
if object && attribute && !object.new_record? && object.respond_to?(:updated_on) && !format.blank?