slayeroffice - web experiments gone horribly awry

04.15.2004 - Highlighter 1.1

I've made two modifications to the Highlighter Favelet based on the feedback of two users.

The first: Ben Holt let me know that the favelet was changing the case of highlighted text, meaning that searching for "html" would change "DHTML" to "Dhtml". Fixed.

The second: Dan Wood sent me a mail saying he'd added "color:black" to the highlight span so that you'd not end up with white text on yellow or some other difficult to read color combination. I've added that to my version as well. An excellent idea.

Thanks to both of them for the feedback!

What if you search for something like a or color or table? It brokes html. Sorry, this doesn't work ;-(
Posted by Hlc on April 16, 2004 @ 6:24 pm
Yes, you're right. It just does a regexp on the innerHTML of the body element which means the markup isnt safe. It should probably loop over the text nodes of elements, but that would make the code significantly larger. I may look into it, but feel free to modify it yourself if I don't get around to it.
Posted by Steve on April 16, 2004 @ 7:32 pm

Comments have been closed for this post.