RE: Wiki External Filter plugin released ยป wiki-external-filter-textile-workaround-2010-06-30.patch
| lib/redmine/wiki_formatting/textile/formatter.rb | ||
|---|---|---|
|
(
|
||
|
\{\{ # opening tag
|
||
|
([\w]+) # macro name
|
||
|
(\(([^\}]*)\))? # optional arguments
|
||
|
(\((.*?)\))? # optional arguments
|
||
|
\}\} # closing tag
|
||
|
)
|
||
|
/x unless const_defined?(:MACROS_RE)
|
||
|
/xm unless const_defined?(:MACROS_RE)
|
||
|
|
||
|
def inline_macros(text)
|
||
|
text.gsub!(MACROS_RE) do
|
||
| lib/redmine/wiki_formatting/textile/formatter.rb | ||
|---|---|---|
|
def inline_macros(text)
|
||
|
text.gsub!(MACROS_RE) do
|
||
|
esc, all, macro = $1, $2, $3.downcase
|
||
|
args = ($5 || '').split(',').each(&:strip)
|
||
|
# workaround for wiki_external_filter plugin
|
||
|
if (WikiExternalFilterHelper.has_macro macro rescue false)
|
||
|
args = $5
|
||
|
args.gsub!('<br />', "\n") if hard_breaks
|
||
|
else
|
||
|
args = ($5 || '').split(',').each(&:strip)
|
||
|
end
|
||
|
if esc.nil?
|
||
|
begin
|
||
|
@macros_runner.call(macro, args)
|
||
| lib/redmine/wiki_formatting/textile/formatter.rb | ||
|---|---|---|
|
if (WikiExternalFilterHelper.has_macro macro rescue false)
|
||
|
args = $5
|
||
|
args.gsub!('<br />', "\n") if hard_breaks
|
||
|
args.gsub!(%r|</?p>|, "\n")
|
||
|
args.gsub!(%r{(<pre><code>|</code></pre>)}, '')
|
||
|
else
|
||
|
args = ($5 || '').split(',').each(&:strip)
|
||
|
end
|
||