Posts

Showing posts with the label xhtml

When will people learn to properly escape preformatted blocks?

I've noticed this when I first posted source code in Haskell to this blog few months ago. I think I have encountered this problem before (maybe even multiple times!), but it was so long ago that it slipped my mind. So it happened that I have posted unescaped code between <pre> and </pre> tags . This is trivially a silly act (imagine if your source code had </pre>...) and the standards are also clear on this issue: HTML 4.01 Specification: Character entity references [w3.org], Using character entities and NCRs: When to use escapes [w3.org]. Always remember to escape at least &lt;, &gt; and &amp; ! You may be wondering how I noticed that in the first place while most web browsers today are so forgiving. Some years ago when I first committed this error (perhaps with comparison operators), I have fixed it myself because on second thought it was trivially ill formed (and I have also looked it up in the standard later). But this time, it was by accident! :...