1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-18 11:29:55 +00:00

Revert obsolete changes to boot.js

This commit is contained in:
jeremy@jermolene.com 2022-09-02 20:03:33 +01:00
parent f0fa1af3a8
commit 2f494ba152

View File

@ -375,7 +375,7 @@ $tw.utils.stringifyList = function(value) {
var result = new Array(value.length); var result = new Array(value.length);
for(var t=0, l=value.length; t<l; t++) { for(var t=0, l=value.length; t<l; t++) {
var entry = value[t] || ""; var entry = value[t] || "";
if(entry === "" || /[^\S\xA0]/.test(entry)) { if(entry.indexOf(" ") !== -1) {
result[t] = "[[" + entry + "]]"; result[t] = "[[" + entry + "]]";
} else { } else {
result[t] = entry; result[t] = entry;
@ -390,13 +390,13 @@ $tw.utils.stringifyList = function(value) {
// Parse a string array from a bracketted list. For example "OneTiddler [[Another Tiddler]] LastOne" // Parse a string array from a bracketted list. For example "OneTiddler [[Another Tiddler]] LastOne"
$tw.utils.parseStringArray = function(value, allowDuplicate) { $tw.utils.parseStringArray = function(value, allowDuplicate) {
if(typeof value === "string") { if(typeof value === "string") {
var memberRegExp = /(?:^|[^\S\xA0])(?:\[\[([\s\S]*?)\]\])(?=[^\S\xA0]|$)|([\S\xA0]+)/mg, var memberRegExp = /(?:^|[^\S\xA0])(?:\[\[(.*?)\]\])(?=[^\S\xA0]|$)|([\S\xA0]+)/mg,
results = [], names = {}, results = [], names = {},
match; match;
do { do {
match = memberRegExp.exec(value); match = memberRegExp.exec(value);
if(match) { if(match) {
var item = match[1] !== undefined ? match[1] : match[2]; var item = match[1] || match[2];
if(item !== undefined && (!$tw.utils.hop(names,item) || allowDuplicate)) { if(item !== undefined && (!$tw.utils.hop(names,item) || allowDuplicate)) {
results.push(item); results.push(item);
names[item] = true; names[item] = true;
@ -2675,4 +2675,4 @@ if(typeof(exports) !== "undefined") {
} else { } else {
_boot(window.$tw); _boot(window.$tw);
} }
//# sourceURL=$:/boot/boot.js //# sourceURL=$:/boot/boot.js