* Trim tiddler titles imported via JSON

Otherwise, it's possible to create a tiddler with a trailing space (or a
leading one, I suppose) in its title.  TiddlyWiki, in general, trims
titles before operating on a tiddler, so having a tiddler with a
trailing space ends up making that tiddler, for all intents and
purposes, uneditable.

Fixes GH #2850

* Signing the CLA
print-window-tiddler
Rob Hoelz 2017-06-29 11:07:23 -05:00 zatwierdzone przez Jeremy Ruston
rodzic b71583e9d7
commit 847727146e
2 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -532,6 +532,7 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
// Process each tiddler
importData.tiddlers = importData.tiddlers || {};
$tw.utils.each(tiddlers,function(tiddlerFields) {
tiddlerFields.title = $tw.utils.trim(tiddlerFields.title);
var title = tiddlerFields.title;
if(title) {
incomingTiddlers.push(title);

Wyświetl plik

@ -317,4 +317,6 @@ Richard Decal, @crypdick, 2017/04/04
Adrian Morosanu, @morosanuae, 2017/06/02
Rob Hoelz, @hoelzro, 2017/05/08
Saq Imtiaz, @saqimtiaz, 2017/06/14