title: Display encoded HTML in Kendo UI
body: <p>I'm using the Kendo UI WYSIWYG editor to input formatted text into a MySQL database using PHP. This bit works fine. I have encoded HTML in my database.</p>
  
  <p>I'm using Kendo UI ListView to output the data from the database. I figured out I needed to use 2 functions to get the proper HTML encoding back:</p>
  
  <pre><code>$row["body"] = stripslashes(html_entity_decode($row["body"]));
  $row["body"] = str_replace("&amp;nbsp;", " ", $row["body"]);
  </code></pre>
  
  <p>Now the JSON feed outputs proper HTML (as far as I can see with minimal testing).</p>
  
  <p>The Javascript that takes takes the data from the JSON feed and displays it on the page in the ListView is showing the HTML code now, rather than the encoded HTML code, which is good, but what I'd really like is for it to display the actual formatted text.</p>
  
  <p>I have tried parsing the string through html_entity_decode() a second time, with no luck. I think this is something that has to be done with the JS, but I'm not sure how this can be achieved specifically with Kendo UI, since it is doing all the parsing.</p>
  
  <p>My JS:</p>
  
  <pre><code>$(document).ready(function() {
      var dataSource = new kendo.data.DataSource({
                  transport: {
                      read: {
                          url: "http://dev.openbill.co.uk/admin/crud/viewticket/main.json.php?id=&lt;?php echo $_GET['id']; ?&gt;",
                          contentType: "application/json; charset=utf-8",
                          type: "GET",
                          dataType: "json",
                      }
                  },
                  schema: {
                      data: "data",
                      total: "total",
                      parse: decode
                  },
                  serverPaging: true,
                  serverSorting: true,
                  pageSize: 10,
                  page: 1,
              });
  
      $("#pager").kendoPager({
          dataSource: dataSource
      });
  
      $("#listView").kendoListView({
          dataSource: dataSource,
          template: kendo.template($("#template").html())
      });
  });
  </code></pre>
  
  <p></p>