RE: Wiki External Filter plugin released ยป redmine_1.3_wiki_external_filter.patch
redmine-patched/app/helpers/application_helper.rb 2012-01-15 11:17:05.000000000 +0100 | ||
---|---|---|
783 | 783 |
end |
784 | 784 |
end |
785 |
MACROS_RE = / |
|
786 |
(!)? # escaping |
|
787 |
( |
|
788 |
\{\{ # opening tag |
|
789 |
([\w]+) # macro name |
|
790 |
(\(([^\}]*)\))? # optional arguments
|
|
791 |
\}\} # closing tag |
|
792 |
) |
|
793 |
/x unless const_defined?(:MACROS_RE)
|
|
785 |
MACROS_RE = /
|
|
786 |
(!)? # escaping
|
|
787 |
(
|
|
788 |
\{\{ # opening tag
|
|
789 |
([\w]+) # macro name
|
|
790 |
(\((.*?)\))? # optional arguments
|
|
791 |
\}\} # closing tag
|
|
792 |
)
|
|
793 |
/xm unless const_defined?(:MACROS_RE)
|
|
794 | 794 |
# Macros substitution |
795 | 795 |
def parse_macros(text, project, obj, attr, only_path, options) |
796 | 796 |
text.gsub!(MACROS_RE) do |
797 | 797 |
esc, all, macro = $1, $2, $3.downcase |
798 |
args = ($5 || '').split(',').each(&:strip) |
|
798 |
if macro == 'graphviz' || macro == 'plantuml' |
|
799 |
args = $5 |
|
800 |
else |
|
801 |
args = ($5 || '').split(',').each(&:strip) |
|
802 |
end |
|
799 | 803 |
if esc.nil? |
800 | 804 |
begin |
801 | 805 |
exec_macro(macro, obj, args) |