Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Normal mode STILL mangles HTML!

The following is a perfectly valid piece of JS using Overlib :

<span onmouseover="return overlib('Provided by the official <a href=http://www.cofe.anglican.org/services/ target=_blank>Church of England web site</a><br /><font size=1>© The Archbishops Council of the Church of England, 2002-2003</font>',CAPTION,'Daily Prayer',CAPTIONSIZE,12,CAPCOLOR,'#000',STICKY,TIMEOUT,'4000');" onmouseout="return nd();">

There's not space to describe the horrible mess that CD makes of this if you switch from HTML to Normal and back again. What's happening? I though V2 was supposed to have fixed this sort of thing. It makes advanced use of Overlib basically impossible.

Michael Wild
Thursday, September 18, 2003

It's probably because you have tags inside of tags..

Try two things...

First, remove all the html tags from your quoted string...

see if that fixes it...

if it does, change your string from

'blah <font>' to 'blah' + chr(60) + 'font' + chr(62)

this will remove all the <> tags from the string, but keep them intact for your entire string, yet not confuse the html parser.

Michael H. Pryor
Thursday, September 18, 2003

Thanks - that works, but it is pretty clunky.

I also tried :
<![CDATA[
<span onmouseover="return overlib('Provided by the official <a href=http://www.cofe.anglican.org/services/ target=_blank>Church of England web site</a><br /><font size=1>© The Archbishops Council of the Church of England, 2002-2003</font>',CAPTION,'Daily Prayer',CAPTIONSIZE,12,CAPCOLOR,'#000',STICKY,TIMEOUT,'4000');" onmouseout="return nd();">
]]>

but the parser just removes the whole thing! - I thought it was supposed (according to the XML spec) to leave such a thing alone.

Michael Wild
Friday, September 19, 2003

I don't believe < and > are allowed in attribute values.

You might try &lt; and &gt; instead.

Pat Rice
Friday, September 19, 2003

Correct, they're not, though most browsers don't try to parse markup inside quotes.  I can't really complain if CD does it "right".

However there's definitely something wrong with the CD parsing of the CDATA section :  'A CDATA marked section supresses markup recognition until "]]>".' (Steven deRose, the SGML FAQ Book, p38).

Michael Wild
Friday, September 19, 2003

*  Recent Topics

*  Fog Creek Home