Copy as ANSI (CSS)

Posted by Shadowfyr on Thu 06 Mar 2003 08:09 PM — 4 posts, 12,043 views.

USA #0
It occures to me that one major flaw in the existing 'Copy as HTML' feature it the inability for it to capture the background colors. My suggestion would be to either provide a setting that can be switched on in the general settings like - 'Use CSS when copying as HTML' or add that as a seperate copy option. Though having it as a general setting would be better.

Basically, instead of using a mess of <font color=...> ... </font> stuff, you instead use:

<span style="color: #00cc00; background: #00000"> ... </span>

This would preserve the correct color information for all lines and also should work on all but the really old browsers that lack CSS support. I doubt there are that many browsers that don't support this still in use.
Amended on Thu 06 Mar 2003 10:48 PM by Shadowfyr
Australia Forum Administrator #1
I didn't know you could do that. I presume you mean "copy as HTML", not "copy as ANSI". I have added it as suggestion 489.
USA #2
Yeah. Fixed that in my post. lol

I didn't know about it until recently either. Been fiddling with some page design issues and though CSS might solve a few issues. Unfortunately not, since my problem is best solved by a nice database, which geocities neither provides nor allows.

Hmm. Looking at the docs.. It appears that it may not work unless the <head></head> section of the resulting page also contains:

<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

since this is a requirement for inline styles. Kind of like having to declare <script language="javascript" type="text/javascript"> every place. Some browser may simply assume that you really intended to use javascript if you leave it off and automatically have it work, while others (and especially editors) will get really grabby and insist that you have to have it. ;)

Just tried it under Opera 6.05 and it worked without the META tag, so I assume Netscape and the new Opera 7 will both handle it correctly. It also works in a stripped down IE core based browser I have called Netsight, so odds are IE won't complain if the META tag is missing either. ;)
Amended on Thu 06 Mar 2003 11:09 PM by Shadowfyr
Australia Forum Administrator #3
I have implemented this in 3.35. Since HTML browsers should ignore unknown tags I haven't bothered about an option - it will just do it.

However, for efficiency it will only use the <span> technique if the background differs from the default background, so in many cases it won't appear at all.

My tests in IE seem to show that the meta tag isn't necessary, and in any case MUSHclient doesn't produce the <head> tag (assuming you might want more than one example from your MUD on one page), so it is up to you whether you put it there or not.