This has been an issue of discussions for a long time.
Just in case anyone happens upon this thread in the future, I am posting the following additional information.
First, see:
http://www.adobe.com/go/tn_14808
Flash TechNote
Using HTML text formatting in Flash 5
Last updated: September 4, 2002
Flash TechNote
Using HTML text formatting in Flash 5
Last updated: September 4, 2002
Yeah, it's a legacy thing. It is not unique to Flex 2, and it is not unique to the RichTextEditor (RTE) control. The problems Daniel reported for the RTE control are inherited through the RTE's TextArea subcontrol. The net result is that it may hinder the use of the RTE in cases that call for authoring HTML for eventual display in browsers.
One really unfortunate gotcha is that Flash/Flex may be alone among all HTML renderers to use point sizes on the <font> tag's size attribute. e.g. <font size="point sizes">
As the TechNote tn_14808 says:
The absolute point sizes used by the
Flash Player are not the same as the relative font sizes used in
standard HTML. In a web browser, <FONT SIZE=2> indicates a font
size that is one point smaller than the browser's default font size.
The Flash Player would interpret the tag literally as a font that is 2
pixels in height.
So where the RTE might create the following:
<FONT FACE="Verdana" SIZE="10">
To match Flash/Flex's rendering of this, other HTML renderers would need:<FONT FACE="Verdana" STYLE="font-size:10pt">
On another RTE topic ...
The Flex 2 Developer's Guide includes a section on Removing and adding RichTextEditor subcontrols. And in response to a post on FlexAussie Hilary Bridel subclassed the RTE adding 7 accessor methods for more easily removing RTE subcontrols. For samples and source of Hilary's subclass see Hilary's post here:
http://www.bridel.org/?p=18
hth,
g
---------- Forwarded message ----------
From: Stefan Schmalhaus <[EMAIL PROTECTED]>
Date: Aug 8, 2006 7:14 AM
Subject: [flexcoders] Re: How to let RichTextEditor export valid HTML?
To: [email protected]
--- In [email protected], "daniel_croona" <[EMAIL PROTECTED]> wrote:
> There must be someone at Adobe who has thought of the Idea that someone
> would liie Valid HTML as the result from this component, just how have
> they managed to hide this feature for me? ;-)
This has been an issue of discussions for a long time.> There must be someone at Adobe who has thought of the Idea that someone
> would liie Valid HTML as the result from this component, just how have
> they managed to hide this feature for me? ;-)
Here's my workaround: I usually save the ugly Flash/Flex-generated HTML code as it is (either as a file or in a database). Once I need a "clean" version of the HTML code I run it through a PHP function that strips off all the FONT, TEXTFORMAT, etc. crap. The result is a piece of HTML code that only contains simple <a>, <p>, <b>, etc. tags. Then I use a stylesheet to display the text the way I want (either in Flash or on a HTML page). - Does this help?
Stefan
---------- Forwarded message ----------
From: daniel_croona <[EMAIL PROTECTED]>
Date: Aug 8, 2006 6:39 AM
Subject: [flexcoders] How to let RichTextEditor export valid HTML?
To: [email protected]
Hi!
How can I get the builtin Flex2 RichTextEditor to export valid HTML?
When I try to use the htmlText property of the RTE Component I get some
HTML-looking crap that defenitely is not valid.
Like this:
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10"
COLOR="#000000" LETTERSPACING="0"
KERNING="0">Lorem</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P
ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#000000"
LETTERSPACING="0" KERNING="0">Ipsum</FONT></P></TEXTFORMAT><TEXTFORMAT
LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10"
COLOR="#000000" LETTERSPACING="0"
KERNING="0"><B>Dolor</B></FONT></P></TEXTFORMAT>
There must be someone at Adobe who has thought of the Idea that someone
would liie Valid HTML as the result from this component, just how have
they managed to hide this feature for me? ;-)
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Software development tool | Software development | Software development services |
| Home design software | Software development company |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___

