Is \hfill valid in obsidian?

I met this problem when I’m trying to write a proof. I’m a Chinese, so I wrote the proof by Chinese, and I want to add the tombstone to the end of my proof. I can achieve that by using
$$\tag*{(\blacksquare)}$$ in multi-line math, and it looks like this


But I want it at the same row my proof ends, so I tried $\hfill\blacksquare$ , but it failed to render.
However it’s highlighted like this

And this usually appares when there is invalid grammer, so I wonder if I can do that by using \hfill, if so how; and if not, what should I do to add the tombstone to the end of the line without using multi-line math?

see here for \hfill. it only works in certain environments because otherwise MathJax doesn’t know how much space to fill.

for getting \tag*{\(\blacksquare\)} to show up in the correct position, try using a gather environment, like so:

You are right, \hfill can’t be used in inline math enviroment here, thanks