The only thing I want to mention is that you have to adjust the output of your sourcecode to keep the indentation. I started with <pre> and <code> tags, but that had a bad influence on the hights of the record.
Finally this approach
' ||regexp_replace(rtrim(text),'\s',' ') ||'' AS text ...
fulfilled my needs. Next I will create a page with the final version. So you don't have to follow all posts to get something running.