I have a section of HTML that has several levels of nested tags. Nothing unusual, nothing I haven’t done a million times before, nothing that doesn’t validate on the W3C validator. I also know that Firefox manipulates your (X)HTML, I’ve seen the difference between Firefox’s page source view and the inspect element view. Usually not much more than rearranging the attributes in your tags unless you’re using javascript. However, this is a new one. I have a blog where I include code samples and Firefox is rewriting this HTML in the page view…
<code class="codeNewIndent">
if (firstEcDateTime.GetSeconds() != secondEcDateTime.GetSeconds())<br />
{<br />
<code class="codeNewIndent">
outputAreTheseTimesNotEqual = true;<br />
</code>
}<br />
</code>
}<br />
</code>
}<br />
</code>
}<br />
</code>
}<br />
</code>
}<br />
</code>
}<br />
catch (NullReferenceException)<br />
{<br />
<code class="codeNewIndent">
outputAreTheseTimesNotEqual = false;<br />
</code>
}<br />
into this…
<code class="codeNewIndent">
if (firstEcDateTime.GetSeconds() != secondEcDateTime.GetSeconds())<br>
{<br>
<code class="codeNewIndent">
outputAreTheseTimesNotEqual = true;<br>
</code>
}<br>
</code>
}<br>
</code>
}<br>
</code>
</code>
</code>
</code>
</code>
</code>
}<br>
}<br>
}<br>
}<br>
catch (NullReferenceException)<br>
It causes all of my closing braces to collapse to the left margin instead of nesting properly. Every other browser (IE6-8, C, O, S) handles the code beautifully, and I can tell from the page source view that even FF is getting the markup properly. I’ve never seen it make a change to the markup this drastic, and I’m not sure if I want to alter valid markup to make it happy. Are there any solutions to this issue?