Closed dullroar closed 10 years ago
Hi @dullroar thanks for the report.
I'm afraid it is as simple as the file extension mechanism currently only recognising a full .html
extension. It's not a one-line fix because the current code incorporates the assumption that there will be a one-to-one mapping between file extensions and content types. Fixing this ticket requires us to support content types that have more than one associated file extension.
That's a bummer. Just spent some time hacking around in the boot tasks and couldn't get these hacks to work:
$tw.utils.registerFileType("text/html;charset=utf-8","utf8",".htm",{deserializerType:"text/html"});
$tw.config.fileExtensionInfo[".htm"] = {type: "text/html"};
Ah, well, looks like I will have to study the code harder, when I am not at work. :)
Ha! It turns out that there is a quick workaround, see c73853288c5b4b0716da94fea2f2edec09345643
Oops sorry @dullroar I just noticed that your second suggestion is the same as what I'd done - it works for me, does it not work for you?
It is not, @Jermolene (and I just compared your code and mine side-by-side, which was identical, and then even copied and pasted your code in to make sure - same results). Would it be because I am hacking a downloaded 5.0.13beta .htm file directly and not doing some sort of build process and hence perhaps missing some other changes that is allowing it to work for you?
Either way, I feel happy that I was on the right track!
Hi @dullroar yes I'd recommend building the source as described in http://tiddlywiki.com/#Working%20with%20the%20TiddlyWiki5%20repository
Anyhow, I've posted a prerelease to http://tw5test.tiddlyspot.com/ for you to check.
I was able to build the source and confirm it now works. Thanks. I am closing this issue.
The following is an issue even with an empty TiddlyWiki template file downloaded from tiddlywiki.com. I have been testing it on Windows 8.1 using TW 5.0.13beta and node v0.10.29.
If the TW file is saved with a suffix of .htm (such as mylife.htm) then running the following command (adapted from this post - https://github.com/Jermolene/TiddlyWiki5/issues/168) produces incorrect output:
The output that is produced is this:
In other words, the entire TW is reproduced in a single mylife.htm.html file.
If I change the file name to mylife.html (simply adding an "l" to the file suffix), and change the --load command to read in mylife.html, then the output produced is structured as I would expect, like this:
Each non-system tiddler is now broken out as its own HTML file under the static directory as I would expect.
I have looked in the rendertiddlers source but not too deeply yet, so at this point I am filing the bug (at least _I_ think it is a bug) to get it documented before delving into determining the cause.