Valid vs. Invalid character use

Hi, I’ve bounced back and forth using Tiddlywiki for quite a number of years now and have finally decided to dive in. I am excited and appreciative to see such an active and supportive Community.

As I start to build out my Tiddlywiki, I have not yet been able to find any references or resources detailing what valid characters can be used in the various contexts throughout Tiddlywiki and I was hoping someone might be able to assist me.

I have been able to consolidate years of notes from other sources, successfully importing them into my Tiddlywiki. Some of the tagging I have uses the following prefix formatting:
!tag
#tag
!/tag
@context

These tags appear to be accepted successfully as tag pills, which I understand are just individual tiddlers titled as ‘tag’. I also have these tags sprinkled throughout the body text of my tiddlers.

After importing, I’ve seen the following issues:
#tag #tag being rendered as 1.tag 2.tag
!tag being rendered as a Heading
@ appears to be ignored and rendered as is

This prompted me to have some concern, not so much with cleaning up my existing notes (unless they need be?), but more with moving forward and future proofing my Tiddlywiki.

I do utilize fields, filters and macros, etc and would like to minimize finding myself in a pickle by having unintended results or having to rethink and rework a significant portion of my Tiddlywiki. Although, Tiddler Commander is a great tool.

Would anyone be able to point me to a resource or give me a quick rundown of

  • the safe characters and where I can use them, should I just not use these characters
  • if I continue to use prefixes such as !#@, what problems might I anticipate, are there special considerations/formatting when using macros, if I change platform, etc
  • anything I haven’t thought of

Thank you so much for any guidance or wisdom you might be able to offer!
Jacqui

Hello and welcome.
The behaviour you are seeing is because TW uses those characters for wikitext markup.
For example / is used for italics.

https://tiddlywiki.com/#Formatting%20in%20WikiText

So…! Is for headings and # is for numbered lists.

You can find more info here https://tiddlywiki.com/#WikiText

Hope that helps get you started.

1 Like

Yes, thank you @Ste_W.

It seems odd to me though that #tag is rendering as # tag, and !tag as ! tag. I would have expected that that non-space following the # would be respected.

I’m more concerned with the use of these characters in tags, titles and new fields since they’ll be referenced in queries and filters.

Any thoughts there…? Thanks

As a latex user, I modified the wrapper function of tiddlywiki core so that any character followed by backslash (\) is rendered as is.

For my use case, I wanted to use a single pairs of $ instead of double to render maths. And then whenever I need to write the actual dollar sign, I wrote \$ instead. This applies to \# or \! in your case.

Thank you @minjaep …would you then need to escape the character, enter it as is with the \ or ignore it when using it in lists/filters/queries/etc?

The data will be \#tag and it’s up to you how to use it. If you want to distinguish it from the regular markdown syntax # then you might want to use the escape character. Otherwise might not.

1 Like

I have found a partial answer regarding the characters permitted in field names: TiddlerFields: https://tiddlywiki.com/static/TiddlerFields.html

Field names must be lowercase letters, digits or the characters - (dash), _ (underscore) and . (period).

Would I be correct in understanding I might be able to use the prefixes I was asking about (# ! @ etc) in any field value as long as I treat them as a text string and quote them/escape them?

I apologize if I might be using the incorrect terminology or describing that incorrectly.

I’m on mobile a few days so can only be brief:

Many misunderstandings expressed here so far.

Those chars are indeed part of wikitext so while you can use them in tags (etc) it is an invitation for oroblems.

Tags are not necessarily tiddlers, and definitely not necessarily tiddlers tagged “tag”. That may be how you chose to represent then at one time and forgot it was your choicr.

Fieldnames are no longer restricted.

(Tiddly-)wikitext markup does not require a space char.

I’d recommend using some batch-converting tool to rename your tags. IF your tags are also tiddlers (which you indicate that they are because you said they’re tagged “tag”) then you can use the excellent Relink plugin which you should probably have anyway.

I second what Mat says. If there is any issue down the road, those “strange” tags are going to fall under suspicion. And just because the core is forgiving, doesn’t mean that every plugin or tool will be. Tiddlywiki Commander is a great tool for changing your tags.

Re field names, personally I play it safe and stick to fields without spaces. Not everything has been converted to use fields with spaces in their names (e.g. JSONTiddlerWidget)

Thank you @twMat and @Mark_S…it’s becoming clear I will be best off just playing it safe using only alphanumeric and find other ways of differentiating things like areas of context. I’ve already made quite extensive use of Tiddlywiki Commander - a great tool!

I appreciate all the replies.

@Jacqui it is quite easy to write wikitext and list tiddlers beginning with wikitext, however you want to do it whenever the title may be used, and other plugins and macros may or may not respect it.

I agree however if you add symbols just do not use then in such a way the resemble wikitext eg ! at the beginning of a title is heading “like” at the end of the word or sentence it is not. However as a design approach it is good not to use “compound keys”, tiddlers are unique and act as a key to the information functionality represented by the title. There are a lot of powerful and interesting ways to set and honor context and other methods to organise tiddlers, including now the cycle and tiggle operators and more, there has being a lot of new features added in the last 6-24 months. So perhaps raise these as questions to the community.

By the way depending on the logic involved perhaps use the ! # @ as separate tags, or now even fieldnames and or field values. You could use icons on tiddlers as well, the skyis the limit unless you compromise things yourself, like compound tiddler titles.

1 Like