From d94aa9badb55e4ac71ada8a84e2119435562b588 Mon Sep 17 00:00:00 2001 From: Michael McDermott Date: Sat, 10 Aug 2024 18:15:11 -0500 Subject: [PATCH] Proof of concept to change type of tiddlers created by editing missing. --- core/modules/widgets/navigator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index efdbba83f..fcca17ba0 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -277,6 +277,7 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) { } // Get the current value of the tiddler we're editing var tiddler = this.wiki.getTiddler(targetTitle); + var defaultFields = { type: "text/markdown" }; // Save the initial value of the draft tiddler draftTitle = this.generateDraftTitle(targetTitle); var draftTiddler = new $tw.Tiddler({ @@ -288,7 +289,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) { "draft.title": targetTitle, "draft.of": targetTitle }, - this.wiki.getModificationFields() + this.wiki.getModificationFields(), + tiddler == null ? defaultFields : {} ); this.wiki.addTiddler(draftTiddler); return draftTiddler;