mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-25 04:37:40 +00:00
changed 2 loops resolving name conflicts for new tiddlers as suggested in issue 294
This commit is contained in:
@@ -173,11 +173,11 @@ exports.tiddlerExists = function(title) {
|
||||
Generate an unused title from the specified base
|
||||
*/
|
||||
exports.generateNewTitle = function(baseTitle) {
|
||||
var c = 0;
|
||||
do {
|
||||
var title = baseTitle + (c ? " " + (c + 1) : "");
|
||||
c++;
|
||||
} while(this.tiddlerExists(title));
|
||||
var c = 0
|
||||
title = baseTitle;
|
||||
while(this.tiddlerExists(title) {
|
||||
var title = baseTitle + " " + (++c);
|
||||
};
|
||||
return title;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user