Issues with returnJson not returning html? Im running in to issues with returnJson not returning html or just returning and empty object:

$userHtml = craft()-&gt;logic-&gt;renderSiteMacro('_macros/elements', 'listing', $args);

$this-&gt;returnJson(array(
     'success' =&gt; true,
     'existing' =&gt; $userHtml
));


The return JSON is always:

{"success":true,"existing":{}}


I have double checked the html output exists and the issue persists: 


Whether returning a simple string or large chunk of html
And with and without single quotes
When renderSiteMacro functions runs the code through the raw filter and not
It appears whitespace was the cause here, just running a quick whitespace filer on the return value resolved the issue:

$userHtml = craft()-&gt;logic-&gt;renderSiteMacro('_macros/elements', 'listing', $args);

$userHtml = preg_replace('~&gt;\\s+&lt;~m', '&gt;&lt;', $userHtml);

$this-&gt;returnJson(array(
    'success' =&gt; true,
    'existing' =&gt; $userHtml
));