Uncommited changes synced
[PHP_CodeDoc] / CodeDoc / Data / PhpDoc.php
index 33d6371..48b9da6 100644 (file)
@@ -25,6 +25,9 @@
 *   @author   Alan Knowles <alan@akbkhome.com>
 *
 */
+
+require_once 'Param.php';
+
 class PHP_CodeDoc_Data_PhpDoc {
     var $long = "";             // name of parameter
     var $short = "";            // default value
@@ -50,9 +53,8 @@ class PHP_CodeDoc_Data_PhpDoc {
     
     function __construct()
     {
-        $this->return = new stdClass();
-        $this->return->type = '';
-        $this->return->desc= '';
+        $this->return = new PHP_CodeDoc_Data_Param();
+       
     }
     
     function longToHTML()
@@ -60,6 +62,19 @@ class PHP_CodeDoc_Data_PhpDoc {
         $ret = '<p>'. $this->long .'</p>';
         $ret = preg_replace('/\n\s+\n/','</p><p>',$ret);
         
+        $bits = explode('```', $ret);
+        
+        if (count($bits) > 1) {
+            $otag = $tag ='<br/><code style="white-space: pre">';
+            $ret = '';
+            foreach($bits as $b) {
+                //if ($tag == '</code><br/>') {
+            //    $b = preg_replace('/\n/', "<br/>\n", $b);
+             //   }
+                $ret .= $b . $tag;
+                $tag = $tag == $otag ? '</code><br/>' : $otag;
+            }
+        }
         // code....
         
         return $ret;