[Phpwm] CSS highlighting
David Goodwin
david at codepoets.co.uk
Thu May 10 21:23:29 BST 2007
Phil Beynon wrote :
> another question......
>
> Is there a way to use CSS & or javascript to highlight a text sub string, in
> a similar way as setting the background colour via tags?
>
> Obviously just in a bit of text printed on the screen its just a matter (as
> a minimum effort) of wrapping it in a font tag background = whatever, but
> I'm aiming to higlight pattern matched bits into and editable Iframe / text
> editor GUI bit, so I don't want scatered remains of tags etc lurking in the
> text should the user delete the highlighted bit.
> Since the user could edit all or anything anything around the highlighted
> bit it might be tricky to maintain exactly where any highlighting bits were
> initially once the edited text is returned back to the server.
>
> Something like a client side preg_replace() where the highlighting was
> actually at a level where it was untouchable during editing really.
I presume what you're asking for cannot be any different to how e.g.
tinymce (or other js editors) handle text that may be
formatted/highlighted etc. ?
In which case, why not just use something like TinyMCE?
David.
--
David Goodwin
[ david at codepoets dot co dot uk ]
[ http://www.codepoets.co.uk ]
More information about the Phpwm
mailing list