How do I convert text to HTML entities in a way compatible with CKEditor?

4

I need to do a textual search on a set of data produced by CKEditor. This editor converts text to HTML entities such as:

Serviços oferecidos ---> Serviços oferecidos

What I need, short-term, is that when the user enters a input with the "services" value, I can convert this to serviços so as to use that term in the search. At first I could do this on the client side (JavaScript) or server (Python), but my hope is that CKEditor itself had some utility to help me with it ...

I searched Google for something like this - both specific to CKEditor and general to JavaScript, but found nothing (at most code that converts the basics - type < to &lt; - but nothing that would make a more complete conversion ). Is there a simple, "clean" way to do this? ( Workaround: create an invisible editor, play the text there and get back using getData )

P.S. I'm using CKEditor 4.4.5, Full package . I suspect that the entity conversion manager is the "Escape HTML Entities" plugin in any installation , since the Basic package ), but I did not find any more detailed documentation of it except for the one shown on the download page (ie some settings, and only).

    
asked by anonymous 18.11.2014 / 21:41

1 answer

1

The "raw" CKEditor does only one basic conversion, the one responsible for converting the vast majority of entities is the "Escape HTML Entities" plugin - included by default in all distributions. Unfortunately this plugin does not provide a utilitarian function for accessing the same conversion rules, but after reading its source code (

13.04.2017 / 14:59