]> source.dussan.org Git - redmine.git/commitdiff
Eases the regexp used to determine the start of a code block (#32359).
authorGo MAEDA <maeda@farend.jp>
Tue, 29 Oct 2019 21:54:04 +0000 (21:54 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 29 Oct 2019 21:54:04 +0000 (21:54 +0000)
Patch by Jens Krämer.

git-svn-id: http://svn.redmine.org/redmine/trunk@18880 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/markdown/formatter.rb
test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb

index 9082c365835e7688059cf60124a48e414472f277..f4dd56452bdb54c6fd2712e41fd39cc95b851b82 100644 (file)
@@ -90,7 +90,7 @@ module Redmine
           inside_pre = false
           @text.split(/(^(?:.+\r?\n\r?(?:\=+|\-+)|#+.+|(?:~~~|```).*)\s*$)/).each do |part|
             level = nil
-            if part =~ /\A(~{3,}|`{3,})(\S+)?\s*$/
+            if part =~ /\A(~{3,}|`{3,})(\s*\S+)?\s*$/
               if !inside_pre
                 inside_pre = true
               elsif !$2
index 23d785901846a892593f611e7e0009b48ba677e6..be667c89084754ed6ca1079ea2eb94412a357e9e 100644 (file)
@@ -142,6 +142,11 @@ EXPECTED
 
       Morbi facilisis accumsan orci non pharetra.
 
+      ~~~ ruby
+      def foo
+      end
+      ~~~
+
       ```
       Pre Content: