Fix: some plugin subtiddlers do not have title in savewikifolder command (#8151)

* fix: some plugin subtiddlers do not have title in savewikifolder command

* fix: following coding style
This commit is contained in:
FSpark 2024-04-26 00:29:09 +08:00 committed by GitHub
parent a081e58273
commit 67845f8ebe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -176,7 +176,10 @@ WikiFolderMaker.prototype.saveCustomPlugin = function(pluginTiddler) {
this.saveJSONFile(directory + path.sep + "plugin.info",pluginInfo);
self.log("Writing " + directory + path.sep + "plugin.info: " + JSON.stringify(pluginInfo,null,$tw.config.preferences.jsonSpaces));
var pluginTiddlers = $tw.utils.parseJSONSafe(pluginTiddler.fields.text).tiddlers; // A hashmap of tiddlers in the plugin
$tw.utils.each(pluginTiddlers,function(tiddler) {
$tw.utils.each(pluginTiddlers,function(tiddler,title) {
if(!tiddler.title) {
tiddler.title = title;
}
self.saveTiddler(directory,new $tw.Tiddler(tiddler));
});
};