I have added line breaks in a generated xml doc.
<aa>"\n"
<bb>some text etc.</bb>"\n"
</aa>"\n"
this should end up as:
<aa>
<bb>some text etc.</bb>
</aa>
Is this possible with google-code-prettify - or should I do it myself in the code that generates the xml?
Thanks in advance
Prettify can style source code, but it does not re-indent or break lines.
It will preserve tags in your code so, so you can indent your code using line-breaks or you can use HTML layout to do that as in
<style>
code.prettyprint { display: block; white-space: pre-wrap }
div.el {margin-left: 2em}
</style>
<code class="prettyprint">
<div class=el><aa><div class=el><bb>...</bb></div></aa></div>
</code>
The <div class=el> uses margin-left to indent by a certain amount, and the pre-wrap causes line to wrap within the indented block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With