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 | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
MACROS_RE = /
|
||
|
(!)? # escaping
|
||
|
(
|
||
|
\{\{ # opening tag
|
||
|
([\w]+) # macro name
|
||
|
(\(([^\}]*)\))? # optional arguments
|
||
|
\}\} # closing tag
|
||
|
)
|
||
|
/x unless const_defined?(:MACROS_RE)
|
||
|
MACROS_RE = /
|
||
|
(!)? # escaping
|
||
|
(
|
||
|
\{\{ # opening tag
|
||
|
([\w]+) # macro name
|
||
|
(\((.*?)\))? # optional arguments
|
||
|
\}\} # closing tag
|
||
|
)
|
||
|
/xm unless const_defined?(:MACROS_RE)
|
||
|
# Macros substitution
|
||
|
def parse_macros(text, project, obj, attr, only_path, options)
|
||
|
text.gsub!(MACROS_RE) do
|
||
|
esc, all, macro = $1, $2, $3.downcase
|
||
|
args = ($5 || '').split(',').each(&:strip)
|
||
|
if macro == 'graphviz' || macro == 'plantuml'
|
||
|
args = $5
|
||
|
else
|
||
|
args = ($5 || '').split(',').each(&:strip)
|
||
|
end
|
||
|
if esc.nil?
|
||
|
begin
|
||
|
exec_macro(macro, obj, args)
|
||