1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Fix issue 2850 (#2852)

* 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
This commit is contained in:
Rob Hoelz 2017-06-29 11:07:23 -05:00 committed by Jeremy Ruston
parent b71583e9d7
commit 847727146e
2 changed files with 3 additions and 0 deletions

View File

@ -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);

View File

@ -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