How to escape square brackets in comments?

The issue is how to use square brackets in comments. Clearly, they must be escaped somehow because they are used by the tags as explained here:

This works in Godot:

## This is [code]enemy.weapon[/code]

This does not work in Godot:

## This is [code]enemy["ugly"].weapon[/code]

So, how do we escape the characters [ and ]?

Backslashes do not seem to work.

Thank you all.

Are you looking for this?

1 Like

Thank you for the quick reply but [lb]b[rb] does not work for me. I cannot say why. The hint shows lb b rb.

Maybe the problem is that I am using VSCode.

The workaround is to use the tag [codeblock] which also performs syntax coloring. But I still want to know the escape code if one exists.

2 Likes

I see, sometimes simple things can be difficult :confused:

1 Like

No worries. I appreciate the effort.

## This is [code]enemy["ugly"].weapon[/code]
For what its worth, I just tested this line in the GODOT editor and it works there.
So, yeah, it must be a VS Code thing.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.