OSDN Git Service

Contents_UListクラスのコンストラクタの引数が間違っていた
authorarino <arino>
Tue, 10 Jun 2003 13:57:49 +0000 (22:57 +0900)
committerarino <arino>
Tue, 10 Jun 2003 13:57:49 +0000 (22:57 +0900)
convert_html.php

index 659dfb0..3cd26b7 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: convert_html.php,v 1.43 2003/06/04 02:04:16 arino Exp $
+// $Id: convert_html.php,v 1.44 2003/06/10 13:57:49 arino Exp $
 //
 function convert_html($lines)
 {
@@ -724,8 +724,13 @@ class Body extends Block
        {
                $this->last =& $this;
                
-               foreach ($lines as $line)
+               while (count($lines))
                {
+                       // Experimental: ¹ÔƬ<pre>¤«¤é¹ÔƬ</pre>¤Þ¤Ç¤òÀ°·ÁºÑ¤ß¤È¤ß¤Ê¤¹
+//                     $this->block($lines,'<pre>','</pre>','Pre');
+                       
+                       $line = array_shift($lines);
+                       
                        if (substr($line,0,2) == '//') //¥³¥á¥ó¥È¤Ï½èÍý¤·¤Ê¤¤
                        {
                                continue;
@@ -798,7 +803,7 @@ class Body extends Block
                        '' : " &aname($id,super,full)\{$_symbol_anchor};";
                $id = "content_{$this->id}_{$this->count}";
                $this->count++;
-               $this->contents_last =& $this->contents_last->add(new Contents_UList($text,$this->id,$level,$id));
+               $this->contents_last =& $this->contents_last->add(new Contents_UList($text,$level,$id));
                return array($text.$anchor,$this->count > 1 ? $top : '',$id);
        }
        function getContents()
@@ -828,10 +833,27 @@ class Body extends Block
                $text = preg_replace('/<(p|del)>#related<\/\1>/e','make_related($vars[\'page\'],\'$1\')',$text);
                return $text;
        }
+       function block(&$lines,$start,$end,$class)
+       {
+               if (rtrim($lines[0]) != $start)
+               {
+                       return;
+               }
+               array_shift($lines);
+               while (count($lines))
+               {
+                       $line = array_shift($lines);
+                       if (rtrim($line) == $end)
+                       {
+                               return;
+                       }
+                       $this->last = &$this->last->add(new $class($this,$line));
+               }
+       }               
 }
 class Contents_UList extends ListContainer
 {
-       function Contents_UList($text,$id,$level,$id)
+       function Contents_UList($text,$level,$id)
        {
                // ¥Æ¥­¥¹¥È¤Î¥ê¥Õ¥©¡¼¥à
                // ¹ÔƬ\n¤ÇÀ°·ÁºÑ¤ß¤òɽ¤¹ ... X(