Actions
Patch #40014
closedAdd support for quoted arguments containing commas in wiki macros
Description
Please consider supporting comma in Wiki macro.
I have considered using double quotes and I'm attaching a patch.
This patch supports the following two additional features.
1. Double quotes can be escaped by placing two consecutive double quotes.
2. Support for enclosing values in double quotes in key/value pair arguments.
For example:
args = 'a, "b, bbb, b", cc c, """d, ""d""", "e" , hh, , "", """", jj=jj, kk="kk, k", "ll=l,ll"'
args = args.split(/\s*,\s*(?=(?:[^"]*"[^"]*")*[^"]*$)/).map{|i| i.gsub(/^"(.*)"$/, '\1').gsub('""', '"')}
# args:
["a", "b, bbb, b", "cc c", "\"d, \"d\"", "e", "hh", "", "", "\"", "jj=jj", "kk=\"kk, k\"", "ll=l,ll"]
Files
Related issues
Actions