redmine_wiki_notes/lib/wiki_notes_macros.rb
Piotr Korzuszek 95a6cd1629 Fix for Redmine 2.2.0
Redmine >= 2.2.0 was escaping html tags generated by macros.
2013-07-06 16:00:15 +04:00

38 lines
825 B
Ruby

module WikiNotesMacro
Redmine::WikiFormatting::Macros.register do
desc "Adds a note to the wiki page:\n\n" +
" @!{{note(text)}}@\n" +
" @!{{tip(text)}}@\n" +
" @!{{important(text)}}@\n"
" @!{{warning(text)}}@\n"
macro :note do |obj, args|
o = '<div class="noteclassic">'
o << args.join(",")
o << '</div>'
o.html_safe
end
macro :tip do |obj, args|
o = '<div class="notetip">'
o << args.join(",")
o << '</div>'
o.html_safe
end
macro :important do |obj, args|
o = '<div class="noteimportant">'
o << args.join(",")
o << '</div>'
o.html_safe
end
macro :warning do |obj, args|
o = '<div class="notewarning">'
o << args.join(",")
o << '</div>'
o.html_safe
end
end
end