mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
Tags: make fn syntax more lenient
This commit is contained in:
parent
d3f0081e03
commit
b845de99a5
1 changed files with 2 additions and 2 deletions
|
@ -129,9 +129,9 @@ export class TagsPlugin extends Plugin {
|
|||
body = body.replace(/(?<!\\)%[a-zA-Z]+/g, () => variableValues[variableIndex++] || "");
|
||||
|
||||
// Run functions
|
||||
body = body.replace(/(?<!\\)\{([a-zA-Z]+)(\:(.+?))?\}/, (_, fn, args) => {
|
||||
body = body.replace(/(?<!\\)\{([a-zA-Z]+)(?::?(.*?))?\}/, (_, fn, args) => {
|
||||
if (!TAG_FUNCTIONS[fn]) return "";
|
||||
const fnArgs = args ? args.slice(1).split(/(?<!\\):/) : [];
|
||||
const fnArgs = args ? args.split(/(?<!\\):/) : [];
|
||||
|
||||
try {
|
||||
return TAG_FUNCTIONS[fn].apply(null, fnArgs);
|
||||
|
|
Loading…
Add table
Reference in a new issue