Improve handling of double square brackets within tags

Now a [[ has to be preceded by the beginning of the string or a
whitespace and a ]] has to be followed by whitespace or the end of the
string to act as quotes.

Thanks to @Skeeve for the regex
This commit is contained in:
Jermolene 2013-12-17 14:53:02 +00:00
parent 1b2a5fe130
commit 810167bc7b
1 changed files with 1 additions and 1 deletions

View File

@ -269,7 +269,7 @@ $tw.utils.stringifyList = function(value) {
// Parse a string array from a bracketted list. For example "OneTiddler [[Another Tiddler]] LastOne"
$tw.utils.parseStringArray = function(value) {
if(typeof value === "string") {
var memberRegExp = /(?:\[\[([^\]]+)\]\])|([^\s]+)/mg,
var memberRegExp = /(?:^|\s)(?:\[\[(.*?)\]\])(?=\s|$)|(\S+)/mg,
results = [],
match;
do {