How do I type square bracket proper in KDoc?


#1

The desired KDoc comment looks like:

... elements that have depth `d > depth[k]`.

IDEA highlights k in red, apparently because this use clashes with the square bracket-based reference syntax, and IDEA can’t resolve k.

What should I do? Is there a way to escape square brackets? The obvious depth\[k] isn’t recognized by IDEA’s builtin docs renderer — it renders the backslash.


#2

Same problem here… any solutions?


#3

I’ve filled KT-24840

The current workaround is to use

```
d > depth[k]
```