I am designing a web application in Flex 4 and currently facing an issue rendering advanced HTML tags and entities in Flex 4.
All I want to do is basically render an HTML text coming to me something like the one given below:-
<p>< hkhj > £ ≤ ≥
¿ É Ò Netscape 4.7 <strong>dooesn</strong>'t
<span style="text-decoration: underline;">respond</span> for <em>following</em>
things.</p>
I am using the RichText Component of Flex Spark to render this html in the following manner.
<fx:Script>
<![CDATA[
var htmlString:String = "<p>< hkhj > £ ≤ ≥
¿ É Ò Netscape 4.7 <strong>dooesn</strong>'t
<span style="text-decoration: underline;">respond</span> for <em>following</em>
things.</p>"
]]>
</fx:Script>
<s:RichText width="100%"
textFlow="{TextConverter.importToFlow(htmlString,TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
What I observe is in my flex application is that the following HTML tags have no effect in on the HTML text:-
<strong> <span> <em>
Also, following HTML entites are displayed as it is (not converted to their respective symbols/characters):-
£ É Ò ¿ ≤ ≥
Is this a limitation in Flex?
Any pointers to render this HTML text with all the tags and entities mentioned shall be appreciated.
Thanks,
Mangirish
Flex supports only a subset of HTML tags within htmlText. See the documentation here:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d52.html
As for the entities, I could not find a list of what was supported and what was not.
As for your problem, it would be easiest to convert those tags to their equivalent (for example, you could change all strong tags to b since b is supported within Flex. You could do some regular expression work to convert them.