How to make TOC items inline such as in confluence?

So indeed the TOC macro does not even support being inserted in an inline context right now and always produce a list block (so a <ul>).