Currently, the PublishMacro does not maintain Tiddlylink labels when
publishing to html.
For example:
[[my_cool_label|my_tiddlylink]]
will publish:
<a class="externalLink" href="my_tiddlylink.html">my_tiddlylink</a>
It does work for external hrefs though e.g. [[my_cool_label|http://
www.google.com]]
I made a simple modification to the PublishMacro:
var tiddlerName = result[i].match(/ tiddlylink="(.*?)"/i)[1];
var url = tiddlerName.htmlDecode().filenameEncode() + ".html";
//ian mod fix link labeling problem
var tiddlerLabel = result[i].match(/">(.*?)<\/a>/i)[1];
if (!className.match(/tiddlyLinkNonExisting/i))
wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className
+ "\" href=\"" + url + "\">" + tiddlerLabel + "</a>");
Just search for the first line of this code block to see the bits that
were changed.
Now, the same Tiddlylink example shown above should print as:
<a class="externalLink" href="my_tiddlylink.html">my_cool_label</a>
I tested this with the few html pages I am publishing, and all worked
- so hopefully the regex pattern works for others.
Thanks to Jack for a useful plugin.
ian