I am writing documentation that includes code samples. I currently am putting them in the concept type marked with <codeblock> or <lines> (I've not decided yet which is the best solution).

But, if I reformat the text (because other content I'm placing in the <p> blocks comes in as one very long line) so I can more easily edit the xml, the content in the <codeblock> or <lines> section is reformatted, losing all the carefully placed indents in the code.That is, the code that would appear in the PDF or HTML is reformatted so that it is all flush left with an indent of about 1 inch. I want it to remain indented hierarchically.

So for example, a code sample as it appears in the Author view
<script>
   Some script here
      A subroutine here
      More stuff
</script>

etc.

It becomes this
<script> Some script here A subroutine here More stuff </script>

which, technically, would work as code, but it hard to read in the documentation.

The code in the Editor view looks like this:
<codeblock>
&lt;script>
  Some script here
    A subroutine here
    More stuff
&gt;/script>
</codeblock>

and so on. When it's reformated it looks like this
<codeblock>
                     &lt;script> Some script here  A subroutine here More stuff &gt;/script>
</codeblock>


--
Steve Matlock
http://nohomeformyblog.blogspot.com/