If you inspect the .htmlText property, you should discover that
bold/italics are simply tags (e.g. <b> or <bold> or <strong>), so they
merely need to be included in your whitelist.
I suspect the problem may be that htmlText is not populated on a paste
event, and the clipboard contents may not yet be populated. So you
probably need to schedule an event (callLater?) when paste occurs, or
simply extend RichText, setting a flag on the paste event that you check
for in commitProperties, eg
function handlePaste( e:Event ) {
invalidatePastedText = true;
}
override function commitProperties() {
super.commitProperties();
On Thu, Sep 27, 2012 at 12:11 PM, Chris <[email protected]> wrote:
> Thanks Scott:
>
> There are lot of such special formatting characters(like the and many
> more used by MS-Word) and I cannot possibly identify all.
>
> However, as you suggest I can have a whitelist(which allows characters,
> numbers, roman numerals, CR,LF, tabs), use the regEx function of Flex to
> remove the non-storable characters. Yes, I need to tie this into RichText's
> paste event as that is how they are entering.
>
> How do I mark formatting(such as bold, underline features) returned by
> Flex's RichTextEditor as "flash formatting". I have not done it before.
>
> I appreciate your advice and time.
>
> ------------------------------
> *From:* Scott Talsma <[email protected]>
> *To:* [email protected]
> *Sent:* Tuesday, September 25, 2012 2:59 PM
> *Subject:* Re: [AFFUG Discuss] Changing special formatting to regular
> formatting in Flex.
>
> * *
>
> I would approach this from the Flex side instead. If you have already
> discovered that you cannot store the data in SQL, it is probably only a
> matter of time before you find something that breaks the AMF protocol used
> to transmit it.
>
> Have you identified which characters are the offensive ones? That is, can
> you assign a unicode identifier to them? I am thinking that you could use
> Flex's regEx to strip out everything outside a certain class of characters,
> e.g. printable plus a few extra chars (tabs, CRLF, etc.). Everything else
> should be replaced with "". So you essentially build a white list of
> allowed chars, and remove everything else. You could probably even tie
> into RichText's paste event, and prevent the offensive characters from ever
> entering the application.
>
> All the formatting that Flex returns should be marked up using standard
> "flash" formatting markup, so I don't think that you would have any issues
> w/those getting stripped out.
>
> On Tue, Sep 25, 2012 at 1:44 PM, Chris <[email protected]> wrote:
>
>
> The application is a Flex front end, Coldfusion 9 middle tier and MySQL
> back end. I am using a RichTextEditor in the Flex front end text boxes
> so that users have an option of formatting. However, some users copy and
> paste content from MS-Word documents and some formatting like the square box
>
> 2010:
>
>
> cannot be stored at the MySQL back end(version 5.5.27) so there is an
> error when such formatting is tried to be added to the tables.
>
> I realize one way is to use the ReReplace function in Coldfusion to
> replace the special formatting characters with blank, but since
> there might be hundreds of special formatting characters like the in
> MS-Word, I cannot not know which are the possible special formatting
> characters which need to be replaced.
>
> I cannot use the Textarea.text property to remove all formatting since if
> someone underlines or changes the color of text, that needs to be stored in
> the tables so that next time the record
> is retrieved, the underlined should show below the text
>
> 1. Is there a way I can convert just the special formatting characters to
> regular formatting like a • which can be stored in the MySQL tables or just
> remove the special formatting characters in Flex?
>
>
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com/>
> -------------------------------------------------------------
>
>
>
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
>