Avoid double escaping when using nested format_text

Macros such as `macro_list(wiki)` will call format_text within the macro
expansion, which will cause escaped angular braces to be escaped twice.
pull/4863/head
Oliver Günther 8 years ago
parent f7408b4169
commit 92f9f8f6ad
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 2
      lib/open_project/text_formatting.rb

@ -115,7 +115,7 @@ module OpenProject
# This will avoid arbitrary angular expressions to be evaluated in
# formatted text marked html_safe.
def escape_non_macros(text)
text.gsub!('{{', '{{ DOUBLE_LEFT_CURLY_BRACE }}')
text.gsub!(/\{\{(?! DOUBLE_LEFT_CURLY_BRACE)/, '{{ DOUBLE_LEFT_CURLY_BRACE }}')
end
def parse_non_pre_blocks(text)

Loading…
Cancel
Save