I have been having some nice success with direct HTML massaging, and what works well for me is to put the HTML into a string attribute on an object. Then you can format it as you like (not forced to remove line breaks, etc). If you don't have an object handy, you can create one...
Example:
<object name="holder">
<CharLayer>
<![CDATA[
<div id='CharLayer' style='position:absolute; z-index:100; visibility:hidden'>
<font face='verdana, arial, helvetica, sans-serif' size='2'>
<div style='float:left; background-color:#e0e0e0; padding:3px; border:1px solid black'>
<b>Stats</b><br>
Class: {player.classname}<br>
Combat Dice: {player.combatdice}<br>
Armour: {player.armour}+<br>
Wounds: {player.wounds}/{player.maxwounds}<br>
Magic Dice: {player.magicdice}<br>
Speed: {player.speed}<br>
Gold: {player.gold}<br>
<br>
<a href='javascript:void(0)' onclick='hideIt("CharLayer");'>Close</a>
</div>
</font>
</div>
]]>
</CharLayer>
</object>
Then you just do:
msg(holder.CharLayer)
Much nicer than forcing it all onto one line.