darkie wrote:It works... but it produces bulky code with redundant tags. Mine does not (although the code produced may not be XML compatible)
There's lots of stuff you seem to be ignoring in your version..like keeping the background color (unless reset by a \003 or \017), keeping both colors through reversed parts etc...
Converting: "\037\00301,04\002a\00319b\026\037\002c\026d\003e"
Yours (almost total failure): <u><span style='color: #000000; background: #FF0000;'><b>a</span><span style='color: #FFFFFF;'>b<a style='color: #FFFFFF; background: #000000'><b>c<a style='color: #FFFFFF; background: #000000'>de</></span>
Mine (correct, but some redundant tags): <span style="text-decoration: underline"></span><span style="text-decoration: underline; color: #000; background-color: #F00"></span><span style="font-weight: bold; text-decoration: underline; color: #000; background-color: #F00">a</span><span style="font-weight: bold; text-decoration: underline; color: #009300; background-color: #F00">b</span><span style="font-weight: bold; text-decoration: underline; color: #FFF; background-color: #000"></span><span style="font-weight: bold; color: #FFF; background-color: #000"></span><span style="color: #FFF; background-color: #000">c</span><span style="color: #009300; background-color: #F00">d</span>e
Mine (with
new regsub at the end): <span style="font-weight: bold; text-decoration: underline; color: #000; background-color: #F00">a</span><span style="font-weight: bold; text-decoration: underline; color: #009300; background-color: #F00">b</span><span style="color: #FFF; background-color: #000">c</span><span style="color: #009300; background-color: #F00">d</span>e
I could probably rewrite my script to be more efficient, but people who like colors on irc tend to like scripts that suck, so why bother