href and camel-case in TW: Is this a bug?

86 views
Skip to first unread message

Mohammad

unread,
Oct 4, 2018, 5:37:11 AM10/4/18
to tiddl...@googlegroups.com
Look at the below example:

Assume you have a tiddler names myTest with the below fields:

Then the below line show JeremyRuston as a link to a missing tiddler

<a href={{!!url}}>{{!!author}}</a><br>

A workaround is 

<a href={{!!url}}><$view field="author"/></a><br>

But it is expected the above href point to url not author!


- Mohammad

TonyM

unread,
Oct 4, 2018, 11:33:40 PM10/4/18
to TiddlyWiki
What are the stray }} towards the end.

Tony

Mark S.

unread,
Oct 4, 2018, 11:49:26 PM10/4/18
to TiddlyWiki
Yes, if you remove the curly brackets per Tony's comments that will fix it.

Just so you can have one more way of doing it, you can also:


<a href={{!!url}}><$text text={{!!author}}/></a><br>

-- Mark

Mohammad

unread,
Oct 5, 2018, 10:03:22 AM10/5/18
to TiddlyWiki
Tony, that was my mistake (copy paste)! I have edited the post!

- Mohammad

Mohammad

unread,
Oct 5, 2018, 10:10:04 AM10/5/18
to tiddl...@googlegroups.com
Yes Mark, your solution either works! but for the first case in my question TW considers first the wikified link not the one is given by href e.g

<a href={{!!url}}>{{!!author}}</a><br>


TW on click navigate to !!author not !!url.

Mohammad

PMario

unread,
Oct 5, 2018, 11:18:40 AM10/5/18
to TiddlyWiki
On Friday, October 5, 2018 at 4:10:04 PM UTC+2, Mohammad wrote:
Yes Mark, your solution either works! but for the first case in my question TW considers first the wikified link not the one is given by href e.g

JeremyRuston is a CamelCase wikilink. ... Which is inside of your a-element. That may be the problem.

-m

Mark S.

unread,
Oct 5, 2018, 11:20:26 AM10/5/18
to TiddlyWiki
Oh, if you just want to talk about "is it a bug" I would say "No". The value from the field is transcluded and rendered as a wiki-link, which is just what you would expect.

Use "inspect element" in your browser and you'll see that the code is rendered as:

<a href="https://tiddlywiki.com/prerelease/"><a class="tc-tiddlylink tc-tiddlylink-resolves" href="#JeremyRuston">JeremyRuston</a></a>

So there's a link inside a link. The inside link wins, just as it would if you made the HTML by hand.

In general, when transcluding text, you want the text to be rendered as wikitext. In most cases you would be disappointed if it did not render as wiki-text. In the case of JeremyRuston, if you didn't want it to render as wikitext, you could precede it with a ~, e.g. ~JeremyRuston , just like you would do if his name appeared in a tiddler.

-- Mark

Mohammad

unread,
Oct 5, 2018, 11:45:52 AM10/5/18
to TiddlyWiki
Many thanks Mark! I got the point!

Mohammad
Reply all
Reply to author
Forward
0 new messages