2

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,&nbsp;<strong>how</strong>&nbsp;are you?</p>

I want this (specific format of the JSON is not important):

[{"text":"Hello, "},{"text":"how","bold":true},{"text":" are you?"}]

Ezekiel
  • 2,383
  • 3
  • 19
  • 30

0 Answers0