Skip to content

Commit e6d46c8

Browse files
committed
Add wiki macro for pastes.
1 parent 31959ec commit e6d46c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

init.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
search.register :pastes
4949
end
5050

51+
Redmine::WikiFormatting::Macros.register do
52+
desc "A link to paste by id: {{paste(NNN)}}"
53+
macro :paste do |obj, args|
54+
id = args.first
55+
link_to("paste ##{id}", paste_path(id)) unless id.blank?
56+
end
57+
end
58+
5159
prepare_block = Proc.new do
5260
Project.send(:include, RedminePastebin::ProjectPastesPatch)
5361
User.send(:include, RedminePastebin::UserPastesPatch)

0 commit comments

Comments
 (0)