1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Text-slicer: Fix title of document tiddler

For compatibility with the previous version, we ensure that the document tiddler ends up with the base tiddler title.
This commit is contained in:
Jermolene 2017-12-21 22:15:00 +00:00
parent 642a6505a1
commit 47d065b239

View File

@ -375,7 +375,8 @@ Slicer.prototype.assignTitlesToChunks = function() {
// Create a title for each tiddler
var titles = {};
this.chunks.forEach(function(chunk) {
var title = self.makeUniqueTitle(titles,chunk["toc-type"] + "-" + chunk.title)
var base = chunk["toc-type"] === "document" ? "" : chunk["toc-type"] + "-" + chunk.title,
title = self.makeUniqueTitle(titles,base);
titles[title] = true;
chunk.title = title;
});