How to link to tiddlers containing square brackets in their names

375 views
Skip to first unread message

Mubed

unread,
May 22, 2015, 9:06:13 AM5/22/15
to tiddl...@googlegroups.com
I have several tiddlers that contain brackets in their names ( e.g. [myBracketTiddler] ). Listing them using the list widget based on the tags works fine, but when I want to link directly to them using the double bracket syntax, I'm not able to link to such a tiddler.

I have tried:
  • [[[myBracketTiddler]]]
  • [[[[myBracketTiddler]]]]
  • [["[myBracketTiddler]"]]
  • [[\[myBracketTiddler\]]]
  • [[%5BmyBracketTiddler%5D]]
  • [title[[myBracketTiddler]]]
None of them rendered to what I wanted.

I found a workaround using the link widget:

<$link to="[myBracketTiddler]">[myBracketTiddler]</$link>

But I'd like be able to like to a tiddler with special characters without the widget. Is it somehow possible? If not then here is my FEATURE REQUEST for it.

Rregards
Mubed

PMario

unread,
May 22, 2015, 9:39:08 AM5/22/15
to tiddl...@googlegroups.com

Hi Mubed,

You could try this:

create a new template tiddler eg: link

content: <$link to={{!!title}}>{{!!title}}</$link>


So you can call your link with: {{[myBracketTiddler]||link}} or {{[myTiddler]||link}}

The mechanism used is a transclusion with a template: see: http://tiddlywiki.com/#Transclusion%20in%20WikiText

have fun!
mario

PMario

unread,
May 22, 2015, 9:47:27 AM5/22/15
to tiddl...@googlegroups.com
BTW: Using brackets in tiddler names, may have other side effects too. It may be harsh, but I'd recommend, that you change your tiddler names. ...

Is there a reason, why you need:  [myBracketTiddler]?

May be, there is a possibility to use standard names for the tiddlers, but display links in a different way?
This may have no side effects.

-m

Mehrdad Mirreza

unread,
May 22, 2015, 12:23:14 PM5/22/15
to tiddl...@googlegroups.com

Thanks for the quick answer. Using a template is very interesting, but not much easier than typing the link widget. Anyway, I may need it somewhere else, and it's good to know it.

The reason, why I use brackets in tiddler names is that I have a naming convention. Tiddlers with bracket are special tiddlers to me. They contain only a list widget that lists all tiddlers tagged with the same name as the tiddler's title.

E.g. the content of [myBracketTiddler] is:

<$list filter="[tag[myBracketTiddler]]"/>

This way I organize my tiddlers hierarchically.

Am 22.05.2015 15:47 schrieb "PMario" <pmar...@gmail.com>:
BTW: Using brackets in tiddler names, may have other side effects too. It's may be harsh, but I'd recommend, that you change your tiddler names. ...

Is there a reason, why you need:  [myBracketTiddler]?

May be, there is a possibility to use standard names for the tiddlers, but display links in a different way?
This may have no side effects.

-m

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/sbt8dyJPOJg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/99df1e97-55da-4e9f-8034-68bdaeb96ce8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
May 22, 2015, 5:53:43 PM5/22/15
to tiddl...@googlegroups.com
hmmm,

So if it is just a naming convention, it would be easy to change. ... IMO brackets are relatively hard to type (on a German keyboard at least.)

What if you just tag your "tag tiddlers" eg: myTiddler tagged: tag

- They are listed in the right sidebar under More: Tags

- It would be easy to list all your tags with <<list-links filter:"[tag[tag]]">>

- Also a TOC / Hierarchy  would be simple. eg:

<div class="tc-table-of-contents">
<<toc "tag">>
</div>

just my 2cents
-mario

PMario

unread,
May 22, 2015, 6:04:01 PM5/22/15
to tiddl...@googlegroups.com

E.g. the content of [myBracketTiddler] is:

<$list filter="[tag[myBracketTiddler]]"/>

simplified version

<<list-links filter:"[tag{!!title}]">>  see: http://tiddlywiki.com/#TextReference

-m

Mehrdad Mirreza

unread,
May 23, 2015, 2:32:25 AM5/23/15
to tiddl...@googlegroups.com

Thank you for introducing those advanced techniques. I'll try them out and probably it solves my problem on a more elegant way than I intended initially.
It still remains an issue though, that we need to be able to escape special characters in tiddler names or generally anywhere. TW is or has a kind of programming language and any programming language needs an escaping syntax.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/sbt8dyJPOJg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.

PMario

unread,
May 23, 2015, 12:00:26 PM5/23/15
to tiddl...@googlegroups.com
On Saturday, May 23, 2015 at 8:32:25 AM UTC+2, Mubed wrote:

It still remains an issue though, that we need to be able to escape special characters in tiddler names or generally anywhere. TW is or has a kind of programming language and any programming language needs an escaping syntax.

There have been some discussions on github already. I just linked one. You may be able to find more [1]
Escaping is a 2 sided sword with TW. An escaping mechanism need to be multi language and multi OS platform agnostic.

A tiddler can contain.

 - wiki syntax which has the tilde already for suppressing ~CamelCase links
 - html code is valid wiki syntax. So we can't use anything that looks like valid html.
 - there are CSS tiddlers that are wikified, to be able to use TW macros. ... We can't use something that looks like CSS
 - backtick is used and valid from one ` to ```.
   - Same is true for <$../> {}{{}}{{{}}}, <<>>, """, [][[]], $()$, $$$, @@ and combination of those.
 - backslash \ is valid for windows paths.

So imo there is no "good" character left, to be used as an escape indicator.

 - btw: filters can have regexps as there parameters. So we will need to be able to escape the escape sequence.

IMO implementing one more escape mechanism will bring us more pain as gain.

just my 2cents
-m

[1] https://github.com/Jermolene/TiddlyWiki5/issues/1648

David Lee

unread,
Jan 24, 2016, 2:21:42 AM1/24/16
to TiddlyWiki
Just my 2 cents - square brackets in titles might not be uncommon. For example I'm currently trying out TW5 as a C++ knowledge base. One of the title is 'Overloading Operator []'.

If I were to do a GNU Bash KB that would be an issue too: "Comparisons on Bash: test, [] and [[]]".

- David

Tobias Beer

unread,
Jan 24, 2016, 3:46:57 AM1/24/16
to TiddlyWiki
Hi David & Mubed,
 
Just my 2 cents - square brackets in titles might not be uncommon. For example I'm currently trying out TW5 as a C++ knowledge base. One of the title is 'Overloading Operator []'.

If I were to do a GNU Bash KB that would be an issue too: "Comparisons on Bash: test, [] and [[]]". 

These are all characters that may end up breaking something somewhere:
  • leading or trailing blanks in titles
  • square brackets "[]"
  • curly brackets "{}"
  • angle brackets "<>"
  • pipe "|"
  • ...
For me, it absolutely requires mentioning in the docs
what the restrictions are and that they clearly exist
and what their implications are,
if only how to possibly work around those
should one feel the urge to use those anyway.

> But I'd like be able to like to a tiddler with special characters without the widget. Is it somehow possible? If not then here is my FEATURE REQUEST for it.

As for simple links, it's great that widgets can make that work.
But, there are many ways in which those special titles can
and will break something, first of all... in macros and constructed filters.
Especially macros — being the simple text substitution patterns the are — 
would have to always use widgets or else be avoided to not break
whenever working with titles having such special characters.

Best wishes,

Tobias. 
Reply all
Reply to author
Forward
0 new messages