Hi Tobias,
That's very interesting. I didn't know that the <<…>> macro call syntax
supported [[…]] as parameter delimiters, as in:
<<list-links filter:[[HelloThere GettingStarted]]>>
However, those square brackets are *not* interpreted as anything to do with
filters. They're just alternatives for quotation marks. The value passed to
the macro is:
HelloThere GettingStarted
This parsing is defined by a big regular expression (reParam) in
macrocallinline.js.
> Perhaps that's misdocumented and not actually allowed?
I was actually talking about a similar big regular expression
(operandRegExp) in filters.js, which is happy to accept "…" and '…' as
delimiters. The documentation accurately describes this regular expression.
But later in filters.js, the code seems to do the wrong thing:
if(match[3] || match[4] || match[5]) { // Double quoted string,
single quoted string or unquoted title
operation.operators.push(
{operator: "title", operand: match[3] || match[4] ||
match[5]}
);
}
i.e. it treats all three of those match options identically. For example,
match[3] is
("(?:[^"])*")
which means it *includes* the quotation marks. So the code ends up pushing
a filter step whose operand is
"HelloWorld"
rather than:
HelloWorld
This looks like a bug to me, albeit a bug that has been faithfully
documented :)
– æ
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.