303 maddec
12-19-2007, 02:07 PM
Hi there,
Using a custom version of the Adobe Rich Text Editor, I try to obtain a simplified version of the html content.
It is a rich text editor with only features: bold, italic, underlined, paragraph alignement and list (bullets).
The rte (rich text editor) is used to let the user edit text content which is used in another part of the application.
The problem is that the rte adds automatically text format information which I needn't and which makes interferences whith the final context where this text is used (css styled).
For example: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">content texttext</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">ss</FONT></P></TEXTFORMAT>
I would like to obtain the same content without textformat and fonts tags.
Is there a simple way of doing it?
I'm thinking about two approaches:
- using regular expressions to filter what I need in this text
- subclassing the RichTextEditor to prevent font and textformat automatic addition.
What's your piece of advice on this?
Thank you in advance for your help.
Using a custom version of the Adobe Rich Text Editor, I try to obtain a simplified version of the html content.
It is a rich text editor with only features: bold, italic, underlined, paragraph alignement and list (bullets).
The rte (rich text editor) is used to let the user edit text content which is used in another part of the application.
The problem is that the rte adds automatically text format information which I needn't and which makes interferences whith the final context where this text is used (css styled).
For example: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">content texttext</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">ss</FONT></P></TEXTFORMAT>
I would like to obtain the same content without textformat and fonts tags.
Is there a simple way of doing it?
I'm thinking about two approaches:
- using regular expressions to filter what I need in this text
- subclassing the RichTextEditor to prevent font and textformat automatic addition.
What's your piece of advice on this?
Thank you in advance for your help.