The code below correctly indents the position of brackets in HTML, however the printed version (with no CSS) left-indents the brackets {
I don't know why this would cause problems, but I can see that if I
have text following the line break and before a span then the
indentation is obeyed:
However if there is no text then the spaces (for example before try) are ignored
Thoughts/workarounds?
<html><head><title>Temp</title></head><body><h1 class="titleheading">Temp</h1><p>Test code. Note that below block is properly indented
</p>
<pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> AppendEntryL<span style="color: #008000;">(</span> node_array<span style="color: #000040;">&</span> myArray, node<span style="color: #000040;">&</span> element <span style="color: #008000;">)</span><br /><span style="color: #008000;">{</span><br /> <span style="color: #0000ff;">try</span> <span style="color: #008000;">{</span><br /> myArray.<span style="color: #007788;">append</span><span style="color: #008000;">(</span> element <span style="color: #008000;">)</span> <span style="color: #008080;">;</span><br /> <span style="color: #008000;">}</span><br /> <span style="color: #0000ff;">catch</span> <span style="color: #008000;">(</span> std<span style="color: #008080;">::</span><span style="color: #007788;">bad_alloc</span> <span style="color: #008000;">)</span> <span style="color: #008000;">{</span><br /> User<span style="color: #008080;">::</span><span style="color: #007788;">Leave</span><span style="color: #008000;">(</span> KErrNoMemory <span style="color: #008000;">)</span> <span style="color: #008080;">;</span><br /> <span style="color: #008000;">}</span><br /><span style="color: #008000;">}</span></pre>
<p><br />
</p> </body></html>
I don't know why this would cause problems, but I can see that if I
have text following the line break and before a span then the
indentation is obeyed:
<br /> User<span style="color:
However if there is no text then the spaces (for example before try) are ignored
<br /> <span style="color: #0000ff;">try</span>
Thoughts/workarounds?