escapeHTML had exchanged < and >.

EscapeHTML had been exchanging < and >.  For example, if the text being escaped was '>1' it ended up being displayed in the browser as '<1'.