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
Updated by Go MAEDA 3 months ago
- Related to Defect #41153: {{collapse(custom text)}} macro cuts off at first comma added
Updated by Go MAEDA 3 months ago
- File 40014-test.patch 40014-test.patch added
- Target version set to Candidate for next major release
Thank you for posting the patch.
I wrote a test for this change.
Updated by Go MAEDA 3 months ago
- Subject changed from Comma support in Wiki macro with double quotes to Add support for quoted arguments containing commas in wiki macros
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed the patch with a test in r22959. Thank you for your contribution.
Updated by Marius BÄ‚LTEANU 3 months ago
What do you think if we merge this fix small improvement to stable branches?
Actions