How do I type square bracket proper in KDoc?

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.


Same problem here… any solutions?

1 Like

I’ve filled KT-24840

The current workaround is to use

d > depth[k]