mirror of
https://github.com/josdejong/mathjs.git
synced 2026-02-01 16:07:46 +00:00
util/latex: New template variable for comma separated list of arguments
You can now use '%*%' to get a comma separated list of all arguments
This commit is contained in:
parent
34046e22d9
commit
14347ed610
@ -69,6 +69,12 @@ function expandTemplate(template, name, args) {
|
||||
args.forEach(function (arg, index) {
|
||||
template = template.replace(RegExp('%' + index + '%', 'g'), '{' + arg + '}');
|
||||
});
|
||||
|
||||
//replace %*% with a comma separated list of all arguments
|
||||
template = template.replace('%*%', args.map(function (arg) {
|
||||
return '{' + arg + '}';
|
||||
}).join(','));
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user