Possible Bug: Render Static Pages

Using node.js

  1. create a new Tiddlywiki: tiddlywiki mywiki --init server
  2. open the new Tiddlywiki: tiddlywiki mywiki --listen
  3. create a tiddler with odd name e.g. Hey Everyone* and save
  4. generate static tiddlers tiddlywiki mywiki --build static

See the error.

    at $:/core/modules/commands/rendertiddlers.js:62:6
    at $tw.utils.each ($:/boot/boot.js:146:12)
    at Command.execute ($:/core/modules/commands/rendertiddlers.js:47:12)
    at Commander.executeNextCommand ($:/core/modules/commander.js:107:14)
    at Command.callback ($:/core/modules/commander.js:119:13)
    at $:/core/modules/commands/rendertiddler.js:50:8
    at FSReqCallback.oncomplete (node:fs:201:23) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: ....\\mywiki\\output\\static\\Hey EveryOne*.html'
}

Node.js v18.4.0

Tested on Windows 10 + Tiddlywiki 5.2.4.

It seems the * in tiddler name cannot be handled!

Further investigation:

Using the below command in tiddlywiki.info

            "--render",
            "[!is[system]]",
            "[encodeuricomponent[]slugify[]addprefix[static/]addsuffix[.html]]",
            "text/plain",

resolves the issue, but then you may have duplicate slugs. (you may like [slugify[]addprefix[static/]addsuffix[.html]])

Another solution is

            "--render",
            "[!is[system]]",
            "[encodeuricomponent[]search-replace[*],[_]addprefix[static/]addsuffix[.html]]",
            "text/plain",

This solution may also result in duplicate files.

An issue has been submitted: [BUG] Render Static Page when a Tiddler has Star in its Title · Issue #7123 · Jermolene/TiddlyWiki5 · GitHub

Not unsuprising as the “*” represents a wildcard for most operating systems ie;

  • Hey EveryOne*.html is "all files beginning with Hey EveryOne and a html extension.
  • The “*” should be encoded, but begs the question if other characters in the title could trigger this.

Exporting the tiddler Hey EveryOne*.html to static html (single file wiki) created a file with a trailing space on Windows 11 and the URL file:///C:/Scratch/Hey%20Everyone%20.html