It’s trivial to reformat the source code into a donut shape.
For something larger or in other languages, or having text strings, certainly not trivial.
You can see an example recording here of how it's done:
https://www.ioccc.org/2019/yang/obfuscation.html
First half of it is writing and golfing, second half is the formatting bits.
For languages like Perl and Ruby, the formatting process is easily automated and mostly trivial.