preserve format of node body for output display I used http://foundation.zurb.com/docs/components/accordion.html

I have the following code:

 &lt;section id="main-content"&gt;
&lt;dl class="row accordion" data-accordion&gt;
&lt;h2 style="text-transform: uppercase;"&gt;&lt;b&gt;About Us&lt;/b&gt;&lt;/h2&gt;&lt;br/&gt;
&lt;?php foreach ($view-&gt;result as $key =&gt; $value) {?&gt;
&lt;img class="media-object" src="&lt;?php print $GLOBALS['base_path']."sites/default/files/about/thumbnails/".$value-&gt;_field_data['nid']['entity']-&gt;field_about_us_image['und'][0]['filename'];?&gt;" alt=""&gt;
    &lt;h2&gt;&lt;?php echo $value-&gt;node_title;?&gt;&lt;/h2&gt;
  &lt;dd class="accordion-navigation"&gt;
    &lt;a href="#pane&lt;?php print $key;?&gt;"&gt;
    &lt;?php print $value-&gt;_field_data['nid']['entity']-&gt;body['und'][0]['summary'];?&gt;...&lt;/a&gt;
    &lt;div id="pane&lt;?php print $key;?&gt;" class="content"&gt;
     &lt;?php print $value-&gt;_field_data['nid']['entity']-&gt;body['und'][0]['value'];?&gt;&lt;/a&gt;
    &lt;/div&gt;
  &lt;/dd&gt;
  &lt;hr&gt;
  &lt;?php } ?&gt;
&lt;/dl&gt;
&lt;/section&gt;


I want to preserve the format HTML  of 

&lt;?php print $value-&gt;_field_data['nid']['entity']-&gt;body['und'][0]['summary'];?&gt;


and 

&lt;?php print $value-&gt;_field_data['nid']['entity']-&gt;body['und'][0]['value'];?&gt;


How Can I achieve this with Drupal 7?
Are you talking about the spacing in the html itself? So the code looks visibly nested? Such as:

&lt;div&gt;
   &lt;div&gt;
      &lt;div&gt;
         something
      &lt;/div&gt;
   &lt;/div&gt;
&lt;/div&gt;


If that's the case, you might want to try a WYSIWYG and add WYSIWYG CodeMagic