Project

General

Profile

Patch #40014 » support-comma-with-double-quotes.patch

Yasu Saku, 2024-01-08 05:51

View differences:

lib/redmine/wiki_formatting/macros.rb
38 38

  
39 39
          method_name = "macro_#{name}"
40 40
          unless macro_options[:parse_args] == false
41
            args = args.split(',').map(&:strip)
41
            args = args.split(/\s*,\s*(?=(?:[^"]*"[^"]*")*[^"]*$)/).map{|i| i.gsub(/^"(.*)"$/, '\1').gsub('""', '"')}
42 42
          end
43 43

  
44 44
          begin
......
57 57
        def extract_macro_options(args, *keys)
58 58
          options = {}
59 59
          while args.last.to_s.strip =~ %r{^(.+?)\=(.+)$} && keys.include?($1.downcase.to_sym)
60
            options[$1.downcase.to_sym] = $2
60
            options[$1.downcase.to_sym] = $2.gsub(/^"(.*)"$/, '\1')
61 61
            args.pop
62 62
          end
63 63
          return [args, options]
(1-1/2)