stripping style from pasted text...

Andre Garzia andre at andregarzia.com
Wed Nov 7 12:27:33 EST 2007


Hello Andres,

Due to bad luck, I can't use that code snip. The field may contain
styled data already in there and the user is just adding more data.
This would remove the styles from the text that is already there. The
problem is that when pasting styled text, I have no control over the
styles inserted and revolution htmltext thingy will use "bad markup"
such as font faces, sizes and colors... I want to remove those things
to make my htmltext as xhtml as possible...

I have a routine for that in place, but it is expensive, lots of loops.

Thanks for your help
andre

On 11/7/07, Andres Martinez <andres at bakno.com> wrote:
> Hello Andre
>
> You can use something like.
>
> set the textstyle of field "Field" to plain
>
> But it needs to run after the text has been pasted in your field.
>
> Regards,
> Andres Martinez
> www.baKno.com
>
> On Nov 7, 2007, at 11:45 AM, Andre Garzia wrote:
>
> > Hello Friends,
> >
> > newbie question here. I have many fields where the user can paste
> > text. The problem is, I don't want the text to be styled, I want to
> > paste as plain text. I've added this to a frontscript:
> >
> > on pasteKey
> >     if the clipboard is "text" then
> >         ## Get rid of text styles...
> >         set the clipboardData["html"] to empty
> >         set the clipboardData["rtf"] to empty
> >     end if
> >     paste
> > end pasteKey
> >
> > but so far the text still paste with styles... any clue out there? The
> > field can contain styles but not the pasted text because, I want to
> > control how styles are applied to get rid of silly stuff such as
> > <font> from appearing in my htmltext properties.
> >
> > TIA
> > Andre
> >
> > --
> > http://www.andregarzia.com All We Do Is Code.
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>


-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list