Actually, the function had a template parameter (not shown in the screenshot), and I was using the comments to show an example of code the function was expecting. I ended up this by adding just the expected prototype:
/// @tparam TFunc ExpRet(ExpParam...)
But you're right, since the font in the tooltip is not a good one to display code, it may not be the right place to do so.
However it's a bit weird that all whitespaces are collapsed unless it's a wanted feature?