title: Receiving malformed HTML error from Jive response, how can I proceed here?
body: <p>Currently been successful at every step thus far when trying to parse JSON to deploy on apps script from a JIVE JSON response. At this point, I receive a malformed HTML error and am not quite sure how to respond. I've posted to the Jive Community, but I don't think anyone works there anymore...</p>
  
  <p>Update:</p>
  
  <p>Here's the code I'm using to produce this issue in apps script:</p>
  
  <p>Code.gs</p>
  
  <pre><code>function doGet(request) { 
    return HtmlService.createTemplateFromFile('Page').evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME);
  }
  
  function include(filename) { 
    var finalRequest = UrlFetchApp.fetch('https://www.cloudconnect.xxx....');
  
    var data = finalRequest.toString().replace("throw 'allowIllegalResourceCall is false.';", "").trim(); 
  
    data = JSON.parse(data);
  
    var returnData = [];
  
    for(var i in data){
      if(i == "list"){
       var content = data[i];
      }
      for(var i in content){
       var text = content[i];
        var json_string = JSON.stringify(text).replace(/[&amp;]/g, "and");
        returnData.push(json_string);
      }
    }
    return returnData;
  }
  </code></pre>
  
  <p>Page.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;base target="_top"&gt;
      &lt;?!= include('Stylesheet'); ?&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;script&gt;
      function displayData(responseData) {
          document.getElementById('output').innerHTML = responseData.join(", ");
      } 
      google.script.run.withFailureHandler(displayData).withSuccessHandler(displayData).include();
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When publishing to a web app, this is the response I get:</p>
  
  <pre><code>Exception: Malformed HTML content: {"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:c062b27a-e734-42fb-a146-c2d978fb77da] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:c062b27a-e734-42fb-a146-c2d978fb77da] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"GCI - Partner Project Plan - Template","type":"file"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:1248f967-2b32-42d0-a9aa-a20f40485c77] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;span&gt;Unable to access trainingand#160;Google Cloud Sales Credential&lt;/span&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:1248f967-2b32-42d0-a9aa-a20f40485c77] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"Unable to access training Google Cloud Sales Credential","type":"update"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:67e6b807-8421-4e61-a3c9-a08943f8a368] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;span&gt;I am having issues with Capital Letter Confusion ie - Example.Com and example.com.I have major account confusion as a result.Thanks for reading.&lt;/span&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:67e6b807-8421-4e61-a3c9-a08943f8a368] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"I am having issues with Capital Letter Confusion ie - Example.Com and example.com.I have major...","type":"update"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:0013baf2-c12e-4869-9849-0959d99bdd77] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;p&gt;or how can I know who is the admin? if they no longer have any IT administrator and the last one they had quits two years ago with zero documentation?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:0013baf2-c12e-4869-9849-0959d99bdd77] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"Why a gsuite edu user shows that his admin is a domain instead of an name or email account?","type":"discussion"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:907a55ec-9332-43fe-876c-00384af7be79] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;span&gt;Startup FB Data Science University will launch in the San Francisco, CA and Cloud Tech developers as individuals or companies can be Partner of the Startup Tech University without capital.&lt;/span&gt;&lt;a class=\"jive-link-external-small\" href=\"https://www.cloudconnect.goog/external-link.jspa?url=http%3A%2F%2Fbit.ly%2Ffbdatascienceuniversity\" rel=\"nofollow\" target=\"_blank\"&gt;xxx&lt;/a&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:907a55ec-9332-43fe-876c-00384af7be79] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"Startup FB Data Science University will launch in the San Francisco, CA and Cloud Tech developers...","type":"update"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:c062b27a-e734-42fb-a146-c2d978fb77da] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:c062b27a-e734-42fb-a146-c2d978fb77da] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"GCI - Partner Project Plan - Template","type":"file"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:1248f967-2b32-42d0-a9aa-a20f40485c77] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;span&gt;Unable to access trainingand#160;Google Cloud Sales Credential&lt;/span&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:1248f967-2b32-42d0-a9aa-a20f40485c77] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"Unable to access training Google Cloud Sales Credential","type":"update"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:67e6b807-8421-4e61-a3c9-a08943f8a368] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;span&gt;I am having issues with Capital Letter Confusion ie - Example.Com and example.com.I have major account confusion as a result.Thanks for reading.&lt;/span&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:67e6b807-8421-4e61-a3c9-a08943f8a368] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"I am having issues with Capital Letter Confusion ie - Example.Com and example.com.I have major...","type":"update"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:0013baf2-c12e-4869-9849-0959d99bdd77] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;p&gt;or how can I know who is the admin? if they no longer have any IT administrator and the last one they had quits two years ago with zero documentation?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:0013baf2-c12e-4869-9849-0959d99bdd77] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"Why a gsuite edu user shows that his admin is a domain instead of an name or email account?","type":"discussion"},{"content":{"text":"&lt;body&gt;&lt;!-- [DocumentBodyStart:907a55ec-9332-43fe-876c-00384af7be79] --&gt;&lt;div class=\"jive-rendered-content\"&gt;&lt;span&gt;Startup FB Data Science University will launch in the San Francisco, CA and Cloud Tech developers as individuals or companies can be Partner of the Startup Tech University without capital.&lt;/span&gt;&lt;a class=\"jive-link-external-small\" href=\"https://www.cloudconnect.goog/external-link.jspa?url=xxx\" rel=\"nofollow\" target=\"_blank\"&gt;xxx&lt;/a&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:907a55ec-9332-43fe-876c-00384af7be79] --&gt;&lt;/body&gt;","editable":false,"type":"text/html"},"subject":"Startup FB Data Science University will launch in the San Francisco, CA and Cloud Tech developers...","type":"update"}.
      at [unknown function]([unknown file]:5:22)
      at [unknown function]([unknown file]:18:3)
      at doGet(Code:2:53)
  </code></pre>
  
  <p>Has anyone seen this before? Can you point me to any documentation on how to proceed here?</p>