@@ sign from a title is not displayed when transcluding the title field

79 views
Skip to first unread message

talha131

unread,
Sep 9, 2020, 8:22:29 AM9/9/20
to TiddlyWiki

Say I created tiddler with the title,

Test @@%+&*[] example

In the tiddler, body when I use {{!!title}}, every character appears except the @@.

If I use @ once, or odd number of times then it works. But if I use @ twice or four time, then it is not displayed.

It is probably because @@ has special meaning in tiddler and is used for styling.

Question is how to write {{!!title}} so that it displays @@ or any other character combination that may have special meaning in TW.

Eric Shulman

unread,
Sep 9, 2020, 8:52:35 AM9/9/20
to tiddl...@googlegroups.com
On Wednesday, September 9, 2020 at 5:22:29 AM UTC-7, talha131 wrote:

Say I created tiddler with the title,

Test @@%+&*[] example

This is a bad idea!  In fact, TiddlyWiki shows a warning when you enter a title containing special characters:
 Warning: avoid using any of the characters | [ ] { } in tiddler titles

In the tiddler, body when I use {{!!title}}, every character appears except the @@.  If I use @ once, or odd number of times then it works. But if I use @ twice or four time, then it is not displayed. It is probably because @@ has special meaning in tiddler and is used for styling.

That is exactly the reason for the warning.  When you use transclusion to show a field value, the results are automatically "wikified" (parsed)... and "@@" is, as you've noted, used for inline CSS styling.

Question is how to write {{!!title}} so that it displays @@ or any other character combination that may have special meaning in TW.

To show the title, including the bad characters, without wikifying, you can use the <$view> widget, like this:
<$view field="title" />

or the <$text> widget, like this:
<$text text={{!!title}} />

Having said this, you really should avoid *ever* using those special characters in titles.  Eventually, you will find it gives you headaches, especially if you need to use those titles in Links, where "|" is used to separate the display text from the linked title, and in Filters, where "[" and "]" are used extensively as delimiters around literal values within the filter syntax.

-e


 

talha131

unread,
Sep 9, 2020, 9:03:03 AM9/9/20
to TiddlyWiki

Thank you Eric. I never got the warning. Not sure what the reason is.

I am going to remove @@ from the title and use single @ in the title. By the way, title of my tiddler was Use @@ to style the tiddlers, which is the tiddler in which I documented my observations on @@.

<$view field="title" />

The above snippet worked flawlessly.

or the <text> widget, like this:
<view text={{!!title}} />

I think you meant,

<$text text={{!!title}} />

Thank you for your prompt response.

Eric Shulman

unread,
Sep 9, 2020, 9:15:04 AM9/9/20
to TiddlyWiki
On Wednesday, September 9, 2020 at 6:03:03 AM UTC-7, talha131 wrote:

I think you meant,

<$text text={{!!title}} />
OOPS!  That's exactly what I meant.  I've edited my previous post to show the intended syntax.

-e 

TW Tones

unread,
Sep 9, 2020, 9:09:10 PM9/9/20
to TiddlyWiki
talha,

The rule to avoid special characters in titles should be followed anyway. While I understand you may want to document wikitext in titles there are plenty of other ways.
  1. Rule one do not use special characters in titles
  2. Including wikitext markup in titles breaks rule 1
  3. Invent other ways to document wikitext without using it in titles.

I would be happy to share. 

eg;
  • Use the caption field
  • Use the text widget `<$text text="@@"/>`
  • Use the code format `@@`
  • Using an icon (see below)
An icon or svg to display @@
<svg height="26px" width="32px">
 
<text x="0" y="24">@&#8203;@</text>
</svg>
Note the use of the special entity Zero Width Space, this will not display but it stops the text including a double@ 
But this does not work in titles.

Just ask if you want more.

Regards
Tony

talha131

unread,
Sep 10, 2020, 10:33:03 AM9/10/20
to TiddlyWiki

Thank you Tones. I settled on using a single @. Because all other options require tweaking the templates.

Your bit about using @@ in a SVG tiddler is awesome.

talha131

unread,
Sep 10, 2020, 12:26:32 PM9/10/20
to TiddlyWiki
PS: I found another post from you on the same topic

Reply all
Reply to author
Forward
0 new messages