Further use of the backtick?

As you know we can use in wikitext the single and triple backticks. It results in displaying the content in code format, and not rendering it.

  • Backticks are very useful when writing content about tiddlywiki code itself, just as we use it here.

If however you use double backticks it is likely to be treated as a single backtick with a surplus backtick, and this surplus backtick, will then go on to affect future back ticks in use.

  • That is, not only do double backticks not do anything useful, they tend to corrupt the rendering process.
  • Also if you use single backticks by default they are highlighted in red, unlike when we use single backticks here in Discourse.
  • If you use triple backticks in tiddlywiki you get a similar result to here;
This is in triple backticks

I would like to propose we make double backticks into valid wikitext that we can use to wrap an inline piece of text into the code format without making the text red.

  • This is something I want to do a lot, when writing about tiddlywiki code but I have to change CSS to stop use of the red text for the whole wiki.
  • I believe introducing a valid double backtick should be backwards compatible because in the past you had to avoid it.
  • If someone mistakenly uses double backticks when they mean single/or triple backticks by adding this new wikitext, it will thus “fail gracefully”.
  • To me this would provide another shortcut to displaying code inline but without the red which tends to “give rise to alarm”. It reduces single character failures in wikitext and makes use of another wise neglected wikitext symbol(s).

Of interest here, is if we used double backticks in Discourse for example here they work in the same way I propose for tiddlywiki. So such content will work here.

  • This in many ways supports the validity of my proposal.

What do you think?

  • Can you see any problems with implementing this?
    • I know backticks have being used in unusual ways in a core I don’t understand, possibly to ensure something is not rendered.
  • I can possibly define the new parser but if you think you can please share.

Matters arising;

  • Can you find other places where single character errors throw TiddlyWiki Script and wikitext into disarray?. Please share, perhaps similar approaches could add more features to wiki text while making it less fragile and more in keeping with other markup/markdown.

I have found double backticks in the core returning the same as single backticks, so I think the failure that occurs is due to a problem in parsing triple backticks.

Simply alias a syntax is a waste, it might become useful in the future. For example used to write AI prompt that executes inline?

They are needed to write code examples like this one:
The following word is `backticked`

``The following word is `backticked` ``

It’s exactly the same behaviour as here in Discourse

That’s a palette setting. Have a look at the palette-manager edition and search for code to see how you can change it.

If you don’t like it. Change it.

This does not make much sense, since it already has a purpose as described above.

  • Single and double backticks are a shortcut for <code>inline code</code>
  • Tripple backticks are a shortcut for <pre><code>block code</code></pre>

If you want to have a different behaviour you are free to change the palette or create a CSS tiddler which overwrites the setting.


By default the inline code was displayed differently here in Discourse. I did have to change the CSS settings to get a border. So now inline-code here works similar to TW wikitext.

See this thread: On this forum: increase contrast for code


The only possibility I could see, would be to extend the tripple-backtick syntax in a similar way as we do with other block start markers. eg:

```my-class
some text
```
  • At the moment it creates: <pre><code>some text</code></pre>
    • my-class is ignored atm.
  • IMO it could create this HTML text: <pre class="my-class"><code>some text</code></pre>

That’s the only thing, that I can see, we can implement in a backwards compatible way.

With your own CSS tiddler you can pretty much do what you want.

Yes, I discovered that here;

Basically we can use double backticks to wrap single backticks, but they can be used on their own.

  • double backticks
  • double backticks `containing single`
  • single backticks ``containing double``

double

followed by triple
  • the above works here, and on tiddlywiki but not without a blank line between.

When I was testing this before posting, something was stopping double back ticks working on their own in my wiki so I thought it was unused.

  • Already have but;

I think a substantially different method needs to be found.

We would need to have a closer look at the highlight-plugin, because it uses this setting to define the different “brushes”.

This is a valuable use case, I sometimes want to do this, but I was trying

`\``

instead