Is it possible for me to get a JSON representation of the contents of a CKEditor instance?
I know about getData()
but I want to know if I can get a JSON representation.
If not, what is the best way to parse the contents of getContents()
, because I need it in a JSON format to interact with another system that I don't control.
Update: Let's say I want to type
Hello, how are you?
getData()
returns this:
<p>Hello, <strong>how</strong> are you?</p>
I want this (specific format of the JSON is not important):
[{"text":"Hello, "},{"text":"how","bold":true},{"text":" are you?"}]