SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Tacoma, WA
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Anyone Used TinyMCE in their App

    I figured I would use TinyMCE on an application and the problem is that the stupid thing keeps on converting my character entities so instead of doing this " it does "

    The problem lies in that we are taking that content formating and putting it into an XML file for flash to then read off. Flash in all its glory of stupid limits can't display most of the crucial character entities thus leaving me in the frustrating cycle of wanting my computer over my co-workers head just so I could potentially feel good.

    Anyways...so here's my shin dig of a question... how I make it so that it won't encode these characters. I tried doing entity_encoding : "raw" and entities : "" and both of those did not work.

    So if you have any handy dandy tricks up your sleeve let me know.

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can't you simply convert them back in flash. If you try and use unencoded entities in XML it will result in errors within the XML it's self.


  3. #3
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Tacoma, WA
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I'm using PHP to ouput the xml and we placed it in a CDATA section. The problem is that flash can't even recognize the characters to convert. Flash uses VERY simple HTML which totally sucks and you would think that Adobe would get with the show and have Flash use HTML a lot better.

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is the data HTML or is the whole XML file consist of valid XML data?

    As the flash object should be able to read XML straight from the file without any changes unless your throwing in html or unencoded entities.


  5. #5
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Tacoma, WA
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's an examle

    <content>
    <![CDATA[<p>bllaaahhh</p>]]>
    </content>

    We are using HTML within the flash text areas to style them up dynamically with CSS. Gives us a bit more control over the text. That's the problem....we are throwing unencoded entities because Flash can't handle most encoded entites. That's what I have been trying to say this entire topic is that I need to know how to get TinyMCE to not encoded the entities so that flash will recognize them. LOL!

  6. #6
    SitePoint Member bluefooz's Avatar
    Join Date
    Mar 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm, have you tried to comment out the following code in your core TinyMCE script (tiny_mce.js)?
    Code:
    content=content.replace(/&quot;/g,'"');
    Even if this works, I'm not sure if this is the best solution to your problem. I hear entities such as ", ', and others should be encoded to conform XHTML standard and as a preventive measure to SQL injection?

  7. #7
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To be honest I don't see why your doing it this way, when you can create attributes to the content element to style it ie.

    <content fontWeight="bold" fontSize="12px" fontColor="Blue" textAlign="Center">
    bllaaahhh
    </content>

    Then you can use Flash to style the text using the attribute values emulating the original <p>bllaaahhh</p>

    Also, you do know you can support entities by writing code for them.

    When you receive the xml string from the source, you can simply do a replace on the data as in the code above to convert the encoded entities.

    Make sure you convert all the ones found below and your laughing.

    http://en.wikipedia.org/wiki/List_of...ntities_in_XML


  8. #8
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Tacoma, WA
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Beacuse Flash can't understand &quot; or &lsquo; or &rsquo; it wont' convert the entities it just shows the code. That's what I have been trying to explain to you guys. I don't know how much more clearer that could be.

    And it's not just a little paragraph this is like several large paragrahps in CDATA section.

    I hear you on the search and replace with a regex and we could do that, but I was just trying to find out a way from doing it within TinyMCE to handle it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •