]> source.dussan.org Git - redmine.git/commitdiff
Fix: Textile phrase modifiers break wiki macros (#29247).
authorGo MAEDA <maeda@farend.jp>
Sat, 21 Jul 2018 00:16:27 +0000 (00:16 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 21 Jul 2018 00:16:27 +0000 (00:16 +0000)
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
test/unit/lib/redmine/wiki_formatting/macros_test.rb

index 291a0e2d41b3f44028428bbdd5e11063930cf1a6..2349a0b84b2ec9eb8c35be5ce355d4f0cd467043 100644 (file)
@@ -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}?)"
index 70e30ef88daf44c7b31f2a4c26b05687d0ae15cb..7b0dfa6daebeda1e064c22e2f7c82e7075ebc345 100644 (file)
@@ -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<p><strong>Hello world!.*</strong></p>\z|, textilizable(text)
+  end
 end