Further to @eastgate’s explanation…
Note ‘ant’ will export as ‘ant.html’. Note ‘big ant’ with export as ‘bigant.html’. Note ‘big ãnt’ will export as ‘bigant.html’. The reason for those changes are as per the explanation above.
So, how to fix. In my last file I worked around the problem of action code having no single operator to generate the HTML code for an HTML link (i.e. <a href="path/to/NoteName.hmtl">Note Name</a>
). I did this using $HTMLExportPath as that tells me the path to that note when exported using the ‘correction’ as described in the previous answer for avoiding erstwhile Web server limitations in URLs.
But taking the last part of that path and splitting out the note title gives me the exported HTML document name, not the source so in your case missing spaces, accents, etc.
Solution? Collect both $HTMLExportPath and $Name. Yet more calculation in the action code, in templates ‘Table tag sort lookup3’ and ‘Table tag sort reverse lookup3’. I’ve added some comments in template code to help explain the process. An updated solution TBX as at the end of this post.
Also a point I omitted to mention before. The original demo’s test notes had no $Text. Note with no $Text don’t export when the whole doc exported (why export and empty file!). this makes sense when actually export, but in preview we are looking at what we might export. The answer is deceptively simple: put some text, any old text, in each sample note. I’ve also added @Gilberto’s test note name so we can see the effects of HTML export on spaces, accents, etc. In addition, I’ve amde all the test notes include a space in the name.
The is a teaching point for us all in the latter exercise. Certainly, it i’s quicker to type a test note like ‘ant’ than one called ‘Anton Dec’ or ‘Producción y consumo’. This efficiency/laziness (we are efficient, other people are lazy!) can bite the experimenter in all sorts of ways. This bites for those of us with are English speaking (British, American , Australian, whatever) as English does not use accented characters and adopts ‘foreign’ words by dumping the ‘unnecessary’ accents: 'précis and ‘precis’ are pronounced the same. I’m exposing my own folly here—Tinderboxers are an international crowd and we need to remember that when doing this sort of string manipulation.
I’d note too that the restrictions @eastgate faces with web servers aren’t within the developers gift to resolve. I’ve been doing this long enough to remember when using a filename of more than 8 characters (and no spaces, accents, etc.) was definitely a thrill-seekers choice and extensions were absolutely needed by some things whilst studiously ignored by others. Things change, as must we, though perhaps not always at the bleeding edge.
Now the point everyone’s skipped to, the updated file: TBX L - Build Table With Categories - solution4.tbx (343.9 KB)