From 26f4b5181f4d2b44ccaf74c6f29af225420e0d8a Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 21 Jul 2018 00:16:27 +0000 Subject: [PATCH] Fix: Textile phrase modifiers break wiki macros (#29247). Patch by Stephan Wenzel. git-svn-id: http://svn.redmine.org/redmine/trunk@17450 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/wiki_formatting/textile/redcloth3.rb | 2 +- test/unit/lib/redmine/wiki_formatting/macros_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb index 291a0e2d4..2349a0b84 100644 --- a/lib/redmine/wiki_formatting/textile/redcloth3.rb +++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb @@ -343,7 +343,7 @@ class RedCloth3 < String A_VLGN = /[\-^~]/ C_CLAS = '(?:\([^")]+\))' C_LNGE = '(?:\[[a-z\-_]+\])' - C_STYL = '(?:\{[^"}]+\})' + C_STYL = '(?:\{[^{][^"}]+\})' S_CSPN = '(?:\\\\\d+)' S_RSPN = '(?:/\d+)' A = "(?:#{A_HLGN}?#{A_VLGN}?|#{A_VLGN}?#{A_HLGN}?)" diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index 70e30ef88..7b0dfa6da 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -401,4 +401,9 @@ EXPECTED assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(text).gsub(%r{[\r\n\t]}, '') end + + def test_macro_should_support_phrase_modifiers + text = "*{{hello_world}}*" + assert_match %r|\A

Hello world!.*

\z|, textilizable(text) + end end -- 2.39.5