When I copy the code and comments from Intellij to Onenote. Surprisingly it lost its spaces. Is there any way to solve this problem. Please see screenshot below
what I am looking for is with formatting and indentation.
A short term workaround (this has worked for me with other IDEs) is to paste the code in another application like Microsoft Word, and then paste the code in OneNote.