Update macro to support redmine 4.1.*

This commit is contained in:
Ludovic Poujol 2021-04-08 18:18:30 +02:00
parent de0695420b
commit d572ff638d
2 changed files with 6 additions and 5 deletions

View file

@ -39,12 +39,13 @@ else
end
require 'RedCloth'
Redmine::Plugin.register :redmine_wiki_notes do
name 'Redmine Wiki Notes plugin'
author 'Daniel Seifert, Victor Laborie'
description 'Allows adding different kinds of notes into a wiki page'
url "http://www.github.com/vlaborie/redmine_wiki_notes" if respond_to?(:url)
version '0.0.4'
version '0.0.5'
requires_redmine :version_or_higher => '4.0.0'
RedCloth3::ALLOWED_TAGS << "div"

View file

@ -9,7 +9,7 @@ module WikiNotesMacro
macro :note, :parse_args => false do |obj, args, text|
o = textilizable(args)
if text.present?
o << textilizable(text, :object => obj, :headings => false)
o += textilizable(text, :object => obj, :headings => false)
end
content_tag('div', o.html_safe, :class => "noteclassic")
end
@ -18,7 +18,7 @@ module WikiNotesMacro
macro :tip, :parse_args => false do |obj, args, text|
o = textilizable(args)
if text.present?
o << textilizable(text, :object => obj, :headings => false)
o += textilizable(text, :object => obj, :headings => false)
end
content_tag('div', o.html_safe, :class => "notetip")
end
@ -27,7 +27,7 @@ module WikiNotesMacro
macro :important, :parse_args => false do |obj, args, text|
o = textilizable(args)
if text.present?
o << textilizable(text, :object => obj, :headings => false)
o += textilizable(text, :object => obj, :headings => false)
end
content_tag('div', o.html_safe, :class => "noteimportant")
end
@ -36,7 +36,7 @@ module WikiNotesMacro
macro :warning, :parse_args => false do |obj, args, text|
o = textilizable(args)
if text.present?
o << textilizable(text, :object => obj, :headings => false)
o += textilizable(text, :object => obj, :headings => false)
end
content_tag('div', o.html_safe, :class => "notewarning")
end