2 Replies Latest reply on Feb 16, 2007 10:46 AM by nicetim

    RichTextEditor Bug

    nicetim Level 1
      The issue i found with the RTE is when using the HTMLText property and saving the contents somewhere, the font tag has the size property set to the value you choose in the font size drop down. This is Ilegal HTML syntax, and when displaying in a regular HTML page, the text is extremly large. The issue is that HTML does not recognize any number here higher than a 6, the lowest the editer will allow you to choose is an 8.

      This component should be updated!
      instead of using the font "size=N" attribute it should use a "style='font-size:N"
      that way the content of the HTMLText property when saved back to a source, can then be viewed in a standard html page.

      Or change the drop down font size list to show valid font size values and make the editor display them properly.

      Is there an update to address this?
      if not, can someone Please Fix it?

      TIA
      Tim

        • 1. Re: RichTextEditor Bug
          peterent Level 2
          This isn't a bug as such. It isn't much of a feature, either. I agree, and I think the Flash team would agree also, that having better HTML support would be good. Check out the blurb on Project Apollo on our Adobe Labs site. We'll have something much better.

          It would be very helpful if you would fill out this request form. The more customers complain about a feature, the more likely it will be addressed sooner.

          Adobe Feature Request/Bug Report Form

          Thanks.
          • 2. Re: RichTextEditor Bug
            nicetim Level 1
            Hi Peter,
            Thank you for the reply and helpful insight.

            I followed your advise and submited a bug report.
            Robert Vollmar answered the bug request and sent me the following:

            quote:

            "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."

            It's probably a good idea for us to add this note to the Flex documentation. I will file it as such.


            For my purposes we are using flex as a data manager UI. there are several DB Fields that hold Ntext data types that are edited via an RTE. I have been saving the data directly without modification because if you try and fix the font size issue, when you reload the data it is not viewable by the RTE. So i came up with a CFC format function to fix the issue on the fly when viewing it in the browser window.

            This function is probably not the best approach but it works. It will find all the font size attribs and values and add in a style tag with the font size value as the style value. This needs to be done because if you have several font tags all with different values you can not just replace them all with the first value found.

            Anyway I hope this article helps someone else besides me.
            Best Regards
            Tim

            On the HTML page to display the content:
            #formatRTEHTML(mytext)#

            -- CFC Function --
            <cffunction access="public" name="formatRTEHTML" returntype="string" output="false">

            <cfargument name="rte_text" type="string" required="yes">

            <cfset var new ="">

            <!---

            Format function.

            takes the RichTextEditor.HTMLText contents, and formats it for viewing in HTML

            --->

            <cfsilent>

            <cfloop list="#rte_text#" delimiters=">" index="L"><cfset r ="">

            <cfset x = FindNoCase("SIZE=",L)>

            <cfif x gt 0><cfset i = 0>

            <cfloop list="#L#" delimiters=" " index="LL"><cfset i = i + 1>

            <cfif LL contains "size=">

            <cfset fsv = ListLast(LL,chr(34))>

            <cfset r = " style='font-size:#fsv#px' ">

            <cfset r = Replace(L," "," #TRIM(r)# ")>

            </cfif>

            </cfloop>

            <cfset r = r & ">">

            <cfelse>

            <cfset r = L>

            </cfif>

            <cfset new = new & r>

            </cfloop>

            </cfsilent>

            <cfreturn new>

            </cffunction>