mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-19 17:57:38 +00:00
Fixes to make nested popups work
Thus making the export button a lot more useful
This commit is contained in:
@@ -462,20 +462,24 @@ Returns an object with the following fields, all optional:
|
||||
exports.parseTextReference = function(textRef) {
|
||||
// Separate out the title, field name and/or JSON indices
|
||||
var reTextRef = /^\s*([^!#]+)?(?:(?:!!([^\s]+))|(?:##(.+)))?\s*/mg,
|
||||
match = reTextRef.exec(textRef);
|
||||
match = reTextRef.exec(textRef),
|
||||
result = {};
|
||||
if(match && reTextRef.lastIndex === textRef.length) {
|
||||
// Return the parts
|
||||
return {
|
||||
title: match[1],
|
||||
field: match[2],
|
||||
index: match[3]
|
||||
};
|
||||
if(match[1]) {
|
||||
result.title = match[1];
|
||||
}
|
||||
if(match[2]) {
|
||||
result.field = match[2];
|
||||
}
|
||||
if(match[3]) {
|
||||
result.index = match[3];
|
||||
}
|
||||
} else {
|
||||
// If we couldn't parse it (eg it started with a)
|
||||
return {
|
||||
title: textRef
|
||||
};
|
||||
// If we couldn't parse it
|
||||
result.title = textRef
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user