Wikitext parsing and rendering in macros

According to the documentation

The string returned by a macro call is parsed separately from any surrounding WikiText components. So a safe way to insert a special character sequence (such as [[ or <) without triggering its normal WikiText meaning (emphasis mine) is to wrap it in a macro.

Is this really the case? The attached tiddler describes the issue.

Wikitext parsing and rendering in macros.tid (1.8 KB)

1 Like

Hi @rengel that paragraph is definitely confusingly worded. What it is trying to say is that if you want to type [[ within wikitext without triggering the special parsing of links then you could do this:

\define br() [[

These are double brackets <<br>>

It’s not good advice because it only works if the content of the macro doesn’t contain valid wikitext markup. Alternatives include:

  • Using an HTML entity
  • Using the <$text text="[["/> widget

I’ve removed the offending paragraph from the docs.

2 Likes