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
1 changed files with 2 additions and 1 deletions

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