Project

General

Profile

Actions

Patch #40014

open

Comma support in Wiki macro with double quotes

Added by Yasu Saku 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Wiki
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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

No data to display

Actions

Also available in: Atom PDF